CmdID / PowerShell / Cmdlets / Remove
Remove-LocalUser
Deletes local user accounts. PowerShell reference
From the PowerShell reference
5 parameters
Alias rlu
What it does
Deletes local user accounts. The Remove-LocalUser cmdlet deletes local user accounts.
Remove-LocalUser [-InputObject] <LocalUser[]> [-WhatIf] [-Confirm] [<CommonParameters>]Remove-LocalUser [-Name] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]Remove-LocalUser [-SID] <SecurityIdentifier[]> [-WhatIf] [-Confirm] [<CommonParameters>]
Delete a user account
Remove-LocalUser -Name "AdminContoso02"IdentifyIts page in the reference: Remove-LocalUser.
Parameters
-InputObjectSpecifies an array of user accounts that this cmdlet deletes. To obtain a user account, use the
Get-LocalUser cmdlet.-NameSpecifies an array of names of the user accounts that this cmdlet deletes.-SIDSpecifies an array of security IDs (SIDs) of user accounts that this cmdlet deletes.-ConfirmPrompts you for confirmation before running the cmdlet.-WhatIfShows what would happen if the cmdlet runs. The cmdlet is not run.