It should be noted that the script appears to work only on domain controllers originally installed in English. Group names such as Domain Admins and Enterprise Admins may vary depending on the installation language, particularly in the JSON files and prerequisites.
To make the script language-independent, these groups could be identified using their SIDs:
# Domain Admins
$DomainAdminsSID = "$((Get-ADDomain).DomainSID)-512"
$DomainAdmins = Get-ADGroup -Identity $DomainAdminsSID
# Enterprise Admins (located in the forest root domain)
$RootDomain = Get-ADDomain (Get-ADForest).RootDomain
$EnterpriseAdminsSID = "$($RootDomain.DomainSID)-519"
$EnterpriseAdmins = Get-ADGroup -Identity $EnterpriseAdminsSID
The DC’s original installation language can also be checked with:
Get-ItemPropertyValue `
-Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language' `
-Name InstallLanguage
0409 corresponds to US English. At a minimum, this limitation should be documented if it has not already been addressed
It should be noted that the script appears to work only on domain controllers originally installed in English. Group names such as Domain Admins and Enterprise Admins may vary depending on the installation language, particularly in the JSON files and prerequisites.
To make the script language-independent, these groups could be identified using their SIDs:
The DC’s original installation language can also be checked with:
0409 corresponds to US English. At a minimum, this limitation should be documented if it has not already been addressed