Finding Locked-Out Users
This topic explains how to use the Active Directory module for Windows PowerShell to find users who are locked out of the system.
Example
The following example demonstrates how to find locked-out users in the Fabrikam.com domain:
Search-ADAccount -LockedOut | where {$_.ObjectClass -eq 'user'} | FT Name,ObjectClass -A
Search-ADAccount -LockedOut | where {$_.ObjectClass -eq 'user'} | FT Name,ObjectClass -A
Additional information
For a full explanation of the parameters that you can pass to Search-ADAccount, at the Active Directory module command prompt, type Get-Help Search-ADAccount –detailed, and then press ENTER.
Setting a User's Password
This topic explains how to use the Active Directory module for Windows PowerShell to set a user’s password.
Example
The following example demonstrates how to set the password for the user account U1.
Set-ADAccountPassword –Identity U1 -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "p@ssw0rd" –Force)
Set-ADAccountPassword –Identity U1 -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "p@ssw0rd" –Force)
Additional information
For a full explanation of the parameters that you can pass to Set-ADAccountPassword, at the Active Directory module command prompt, type Get-Help Set-ADAccountPassword –detailed.
Unlocking a User Account
This topic explains how to use the Active Directory module for Windows PowerShell to unlock users who are locked out of the system.
Example
The following example demonstrates how to unlock the user account U1 in the organizational unit (OU) Test in the Fabrikam.com domain:
Unlock-ADAccount -Identity "CN=U1,OU=Test,DC=FABRIKAM,DC=COM"
Unlock-ADAccount -Identity "CN=U1,OU=Test,DC=FABRIKAM,DC=COM"
Additional information
For a full explanation of the parameters that you can pass to Unlock-ADAccount, at the Active Directory module command prompt, type Get-Help Unlock-ADAccount –detailed, and then press ENTER.
No comments:
Post a Comment