Enable-ADAccount
Use Enable-ADAccount to enable a disabled Active Directory user or computer account.
Documentation: Microsoft Learn — Enable-ADAccount
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Enable-ADAccount [-Identity] <ADAccount> [-Server <String>] [-Credential <PSCredential>] [-PassThru] [-WhatIf] [<CommonParameters>]- Stage 1Enable-ADAccount
-Identity -Server -Credential -PassThru -WhatIf
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Enable-ADAccount -Identity jsmith
Show reference output
Sample output · fictional data, shaped like the real thing
DistinguishedName : CN=John Smith,OU=Users,DC=corp,DC=local Enabled : True GivenName : John Name : John Smith ObjectClass : user SamAccountName : jsmith UserPrincipalName : jsmith@corp.local
Get-ADUser -Identity jsmith
Show reference output
Sample output · fictional data, shaped like the real thing
Enabled LockedOut ------- --------- True True
Unlock-ADAccount -Identity jsmith
Show reference output
Sample output · fictional data, shaped like the real thing
Name LockedOut ---- --------- Jane Smith False
Parameters
Parameter definitions:
-Identity-Server-Credential-PassThru-WhatIf
Practical use and troubleshooting
Practical scenario: Use Enable-ADAccount when you need to enable a disabled Active Directory user or computer account. Review syntax and sample output, then try an example in the browser lab. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: An enabled account can still fail sign-in because it is locked, expired or subject to another restriction. Inspect those conditions separately instead of repeatedly enabling it. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Disable-ADAccount. Enable-ADAccount changes the enabled flag to allow account use; Disable-ADAccount disables the account. Neither operation is the same as unlocking a temporarily locked account. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Recap
Enable-ADAccount Use Enable-ADAccount to enable a disabled Active Directory user or computer account.
Next: Disable-ADAccount