May 28, 2013
Category: microsoft, windows-server-2012
Tags: microsoft-service-account, microsoft-sql-server, msa, server-2012
Create A MSA Group Using PowerShell - Server 2012
For those who are struggling to create service accounts:
Open PowerShell
Import-Module Activedirectory
Create the Service Account:
New-ADServiceAccount -name <Service Account Name> -Enabled $true -DNSHostName <Service Account Name>.domain.com -PrincipalsAllowedToRetrieveManagedPassword "<Group or Computer>"
Example:
New-ADServiceAccount -name MSA1 -Enabled $true -DNSHostName MSA1.domain.com -PrincipalsAllowedToRetrieveManagedPassword "Sql Server Group"
Add computer to service account:
Add-ADComputerServiceAccount -Identity <Servername> -ServiceAccount <Service Account Name>$
Example:
Add-ADComputerServiceAccount -Identity SQL1 -ServiceAccount MSA1$
Install Service Account:
Install-ADServiceAccount -Identity <Service Account Name>$
Example:
Install-ADServiceAccount -Identity MSA1$
To test to see if this has worked:
Test-ADServiceAccount -Identity <Service Account Name>$
Example:
Test-ADServiceAccount -Identity MSA1$