PowerShell Genie

Remove-ADUser

Use Remove-ADUser to delete an Active Directory user account. Confirm the identity first — deletion is immediate and hard to undo.

Command 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn — Remove-ADUser

Syntax

1PS> Remove-ADUser [-Identity] <ADUser> [-Server <String>] [-Credential <PSCredential>] [-WhatIf] [-Confirm] [<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.

Remove-ADUser [-Identity] <ADUser> [-Server <String>] [-Credential <PSCredential>] [-WhatIf] [-Confirm] [<CommonParameters>]
  1. Stage 1Remove-ADUser-Identity -Server -Credential -WhatIf -Confirm

    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

    Remove-ADUser -Identity jsmith

    1PS> Remove-ADUser -Identity jsmith
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Name       SamAccountName
    ----       --------------
    Amit Jones ajones
    Mei Chen   mchen

    Remove-ADUser -Identity jsmith

    1PS> Disable-ADAccount -Identity jsmith # the usual first step instead
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Name        SamAccountName
    ----        --------------
    Priya Nair  pnair
    Amit Sharma asharma

    Get-ADObject -Filter "isDeleted -eq $true"

    1PS> Get-ADObject -Filter "isDeleted -eq $true" -IncludeDeletedObjects | Select-Object Name
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Name
    ----------
    Jane Smith
    Alex Jones

    Parameters

    Parameter definitions:

    • -Identity
    • -Server
    • -Credential
    • -WhatIf
    • -Confirm

    Remove-ADUser on Microsoft Learn

    Practical use and troubleshooting

    Practical scenario: Use Remove-ADUser when you need to delete an Active Directory user account. Confirm the identity first — deletion is immediate and hard to undo. 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: Identity not found can indicate the wrong domain or an account already removed. Resolve the exact object and review dependencies before any destructive retry. 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. Remove-ADUser deletes the directory user; Disable-ADAccount preserves the object while preventing account use. Offboarding requirements should decide which operation is appropriate. Read the linked command before substituting it; similar names do not imply identical inputs or output.

    Remove-ADUser reference on Microsoft Learn

    Recap

    Remove-ADUser Use Remove-ADUser to delete an Active Directory user account. Confirm the identity first — deletion is immediate and hard to undo.

    Next: New-ADUser
    Genie guideRemove-ADUser

    Use Remove-ADUser to delete an Active Directory user account. Confirm the identity first — deletion is immediate and hard to undo. The console below is pre-loaded — run it, then change a value and run it again.