批量修改AD帳號限制登入電腦設定 VIA Powershell
使用者之前都有設定
Logon Workstations,現在想改成
All computers
用 PowerShell 批量修改
$users = Get-ADUser -Filter * -SearchBase 'OU=USER,DC=fender,DC=com' -properties * #This gets all the users in AD
Foreach($user in $users){
Set-ADUser -Identity $user.DistinguishedName -LogonWorkstations 'All Computers'
$info=$user.SamAccountName + "has been set to logon all computer"
Write-Output $info
}
footer
See also :
留言