批量修改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 :

留言

這個網誌中的熱門文章

Office 2021 離線安裝封裝與KMS啟動步驟

Ollama使用心得與模型導入教學

ARC下NSMutableDictionary 無法使用retainCount