Hello,
I tried the script inside how-to-prerequisites to create a gMSA to test Azure AD Connect cloud sync; the script is this:
$Name = 'aadsyncgMSA'
$Description = "Azure AD Cloud Sync service account for LAB-DC1 server"
#$Server = "LAB-DC1.marcosoft.local"
$Server = "aadsyncgMSA.marcosoft.local"
$Principal = Get-ADGroup 'Domain Computers'
# Create service account in Active Directory
New-ADServiceAccount -Name $Name `
-Description $Description `
-DNSHostName $Server `
-ManagedPasswordIntervalInDays 30 `
-PrincipalsAllowedToRetrieveManagedPassword $Principal `
-Enabled $True `
-PassThru
when I try the command Install-ADServiceAccount -Identity $Name
I otain the error "Cannot install service account. Error Message: 'An unspecified error has occurred'"; I found that some people use the Set-ADServiceAccount -Identity $Name -PrincipalsAllowedToRetrieveManagedPassword $Principal
but when I use the cmdlet to test Test-ADServiceAccount -Identity aadsyncgMSA | Format-List
what I obtain is "WARNING: Test failed for Managed Service Account aadsyncgMSA. If standalone Managed Service Account, the account is linked to another computer object in the Active Directory. If group Managed Service Account, either this computer does not have permission to
use the group MSA or this computer does not support all the Kerberos encryption types required for the gMSA. See the MSA operational log for more information."; I also found in the event viewer, in the Security-Netlogon section, that when I give the install command there are 2 errors:
ID 9000: Netlogon failed to retrieve the password for account aadsyncgMSA in domain NULL. Object Name not found.
ID 9002: Netlogon failed to add aadsyncgMSA as a managed service account to this local machine. {Access Denied}
A process has requested access to an object, but has not been granted those access rights.
Any idea to try to solve this issue?