首页 » 操作系统 » Windows » Windows Server 2008下批量更改域用户密码

Windows Server 2008下批量更改域用户密码

 

利用Windows PowerShell批量更改AD用户的密码,根据下面命令,修改对应地段,执行即可。
 
1、打开Windows PowerShell,在PowerShell中加载AD模块:

Import-Module ActiveDirectory

2、更改所有域用户的密码:

Get-ADUser -filter * -SearchBase 'DC=firm-letter,DC=com' | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "abc123!@#" -Force)

3、更改“sales”OU中所有域用户的密码:

Get-ADUser -filter * -SearchBase 'OU=sales,DC=firm-letter,DC=com' | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "123!@#" -Force)

4、设置域用户下次登陆时不需要更改密码:

Get-ADUser -filter * -SearchBase 'DC=firm-letter,DC=com' | Set-ADUser -ChangePasswordAtLogon $false

changepass

原文链接:Windows Server 2008下批量更改域用户密码,转载请注明来源!

3