PowerShell Logo Small


This is the built-in help made by Microsoft for the command 'Remove-ADServiceAccount', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.


Removes an Active Directory managed service account or group managed service account object.


Remove-ADServiceAccount [-Identity] <ADServiceAccount> [-AuthType {Negotiate | Basic}] [-Credential <PSCredential>] [-Partition <String>] [-Server <String>] [-Confirm]
[-WhatIf] [<CommonParameters>]

Search powershellhelp.space


The Remove-ADServiceAccount cmdlet removes an Active Directory managed service account (MSA). This cmdlet does not make changes to any computers that use the MSA. After this
operation, the MSA no longer exists in the directory, but computers will still be configured to use the MSA.

The Identity parameter specifies the Active Directory MSA to remove. You can identify a MSA by its distinguished name (DN), GUID, security identifier (SID) or security
accounts manager (SAM) account name. You can also set the Identity parameter to a MSA object variable, such as $<localSerivceAccountObject>, or you can pass a MSA object
through the pipeline to the Identity parameter. For example, you can use the Get-ADServiceAccount cmdlet to retrieve a MSA object and then pass the object through the
pipeline to the Remove-ADServiceAccount cmdlet.

Note: Removing the service account is a different operation than uninstalling the service account locally.



Online Version: http://go.microsoft.com/fwlink/p/?linkid=291100




-------------------------- EXAMPLE 1 --------------------------

PS C:\>Remove-ADServiceAccount -Identity SQL-SRV1

This command removes the managed service account named service1.

-------------------------- EXAMPLE 2 --------------------------

PS C:\>Get-ADServiceAccount -Filter {Name -like 'SQL*'} | Remove-ADServiceAccount

This command removes all managed service accounts with names that start with SQL.