Managed Service Accounts (MSA)
Using a MSA takes five steps:
If using a workstation: Add-WindowsFeature -Name RSAT-AD-Powershell
- Add Key Distribution Center Root Key (one time operation per domain)
- You create the MSA in AD.
- You associate the MSA with a computer in AD.
- You install the MSA on the computer that was associated.
- You configure the service(s) to use the MSA.
1. KDCRootKey
| Import-Module activedirectory
Add-KdsRootKey -effectivetime((get-date).addhours(-10))
|
2. Account Creation
| Import-Module activedirectory
New-ADServiceAccount <serviceaccount> –RestrictToSingleComputer
|
3. Account Association
| Import-Module activedirectory
Add-ADComputerServiceAccount -Identity <computer> -ServiceAccount <serviceaccount>
|
4. Account Installation
| Import-Module activedirectory
Install-ADServiceAccount -Identity <serviceaccount>
|
5. Service Configuration
You configure the MSA as you would configure any virtual service account (eg. DOMAIN\ServiceAccount$), without specifying a password.
Group Managed Service Accounts (gMSA)
gMSA behave just like a MSA. The primary difference is that you can associate further
devices with the account, not just a single device. You do so by allowing the device access and then repeating the association process on each endpoint you want to be associated with the gMSA.
1. Account Creation
| Import-Module activedirectory
New-ADServiceAccount <serviceaccount> –dnshostname <domaincontroller>
|
2. Account Association (once per endpoint)
| Import-Module activedirectory
Set-ADServiceAccount -Identity <serviceaccount> -PrincipalsAllowedToRetrieveManagedPassword <endpoint1>
|
3. Account Installation (once per endpoint)
| Import-Module activedirectory
Install-ADServiceAccount -Identity <serviceaccount>
|