Thursday, July 7, 2011

Determine if an Active Directory account is locked from CLI

Q: How can I quickly check the Account Locked status of an Active Directory AD account?
A: From Command Line run this:
net user /domain <username> | find "Account active"

Unlocked: Account active               Yes
Locked:    Account active               Locked

To go ahead and unlock them from CLI run this:
net user /domain <username> /Active:YES