我一直在使用这些来列出我域中的锁定用户,并提示我输入samaccountname来解锁所需的一个:我用3个文件完成了它。第一个是ps1,列出所有这些 search-adaccount -lockedout | select name, samaccountnameuser = Read-Host "Enter user account (SAMACCOUNTNAME) to unlock or press ENTER to refresh list"
<
Disable object if not in DoNotDisable Security Groups $accounts = Search-ADAccount-SearchBase $OU.DistinguishedName -AccountInactive -TimeSpan ([timespan]7D) @scope Write-Host $account
#
然后,根据DistinguishedName字段,使用身份标志删除该计算机。#Get AD computers older than $DelCompDays if ($result -ne $NULL){ Remove-ADComputer -Identity $result.DistinguishedName-conf
如果使用这些参数之一,就会得到以下错误。为什么它不需要-live或-test,为什么如果我使用其中之一,它就失败了?C:\Users\Administrator\Documents\Disable-ADAccounts.ps1 :不能使用指定的命名参数解析参数集。一行:1字符:1+。.Disable object if not in DoNotDisable Security Groups $accounts = Search-ADAccou