Win2008/2012r2下批量更改域用戶密碼
阿新 • • 發佈:2018-09-08
hbase 執行 2012r2 password 指定 更改 als 更改所有 ext 使用Windows PowerShell批量更改AD用戶的密碼,使用以下命令,修改對應字段,執行即可。
4、設置域用戶下次登陸時不需要更改密碼:
1、打開Windows PowerShell加載AD模塊:
Import-Module ActiveDirectory
2、更改所有域用戶的密碼:Get-ADUser -filter * -SearchBase ‘DC=xxx,DC=com‘ | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "abc123AA" -Force)
3、更改指定“test”OU中所有域用戶的密碼:Get-ADUser -filter * -SearchBase ‘OU=test,DC=xxx,DC=com‘ | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "123!@#" -Force)
4、設置域用戶下次登陸時不需要更改密碼:
Get-ADUser -filter * -SearchBase ‘DC=xxx,DC=com‘ | Set-ADUser -ChangePasswordAtLogon $false
Win2008/2012r2下批量更改域用戶密碼