Step 2

Create the host group and the account

Create a group for the servers that may use the account, then the account itself. The group makes it easy to add a second server later.

10 minutesRun as CONTOSO\Administrator on a domain controller

Create the host group

Members are computer accounts, so each name ends with $.

A domain controller
$top = "OU=Contoso School,DC=ad,DC=contoso,DC=com"
New-ADGroup -Name "SG-CON-App-Hosts" -GroupScope Global -GroupCategory Security `
  -Path "OU=CON-Groups,$top" -Description "Servers allowed to use svc-app-gmsa"
Add-ADGroupMember -Identity "SG-CON-App-Hosts" -Members "CON-APP-01$"

Create the gMSA

A domain controller
New-ADServiceAccount -Name "svc-app-gmsa" `
  -DNSHostName "svc-app-gmsa.ad.contoso.com" `
  -PrincipalsAllowedToRetrieveManagedPassword "SG-CON-App-Hosts" `
  -Path "OU=CON-Service-Accounts,$top" `
  -Description "Runs the application service on CON-APP-01"
SettingWhat it does
NameThe account name. Keep it to 15 characters or fewer, so older systems can read it. Windows adds a $ on the end.
DNSHostNameRequired. Use the account name followed by your AD domain.
PrincipalsAllowedToRetrieveManagedPasswordThe group whose member servers may fetch the password.
PathPuts it in your service accounts OU, not the default container.

Check it

A domain controller
Get-ADServiceAccount -Identity "svc-app-gmsa" -Properties PrincipalsAllowedToRetrieveManagedPassword, DistinguishedName |
  Select-Object Name, Enabled, DistinguishedName, PrincipalsAllowedToRetrieveManagedPassword

Naming

Start service accounts with svc- and say what they run, such as svc-app-gmsa, svc-backup-gmsa or svc-entra-gmsa. Give each service its own account, so one compromised server exposes one service.

Done when

Check

The account shows Enabled True in CON-Service-Accounts, with SG-CON-App-Hosts as the group allowed to retrieve its password.

Your progress is kept in this browser only.