PowerShell Logo Small

Remove-ADServiceAccount



This is the built-in help made by Microsoft for the command 'Remove-ADServiceAccount', in PowerShell version 3 - as retrieved from Windows version 'Microsoft Windows Server 2012 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.

SYNOPSIS

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

SYNTAX


Remove-ADServiceAccount [-Identity] <ADServiceAccount> [-AuthType <ADAuthType>] [-Credential <PSCredential>] [-Partition <String>] [-Server
<String>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


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.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkID=219339
Get-ADServiceAccount
Install-ADServiceAccount
New-ADServiceAccount
Set-ADServiceAccount
Uninstall-ADServiceAccount

REMARKS

<

Examples


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

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



Description

-----------

Remove the managed service account named 'service1'.




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

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



Description

-----------

Remove all managed service accounts with names that start with 'SQL'.