PowerShell Genie

Enable-ADAccount

Use Enable-ADAccount to enable a disabled Active Directory user or computer account.

Command 1 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn — Enable-ADAccount

Syntax

1PS> Enable-ADAccount [-Identity] <ADAccount> [-Server <String>] [-Credential <PSCredential>] [-PassThru] [-WhatIf] [<CommonParameters>]
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>]
  1. Stage 1Enable-ADAccount-Identity -Server -Credential -PassThru -WhatIf

    Try it

    Windows PowerShell

    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.

    Interactive simulation · fictional data

    Examples

    Enable-ADAccount -Identity jsmith

    1PS> Enable-ADAccount -Identity jsmith -PassThru
    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

    1PS> Get-ADUser -Identity jsmith -Properties Enabled, LockedOut | Select-Object Enabled, LockedOut
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Enabled  LockedOut
    -------  ---------
    True     True

    Unlock-ADAccount -Identity jsmith

    1PS> Unlock-ADAccount -Identity jsmith # for lockout, not disablement
    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

    Enable-ADAccount on Microsoft Learn

    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.

    Enable-ADAccount reference on Microsoft Learn

    Recap

    Enable-ADAccount Use Enable-ADAccount to enable a disabled Active Directory user or computer account.

    Next: Disable-ADAccount
    Genie guideEnable-ADAccount

    Use Enable-ADAccount to enable a disabled Active Directory user or computer account. The console below is pre-loaded — run it, then change a value and run it again.