How can we query the AD site name of a server with PowerShell? One way to do this is through the .NET ActiveDirectorySite Class:
[System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().Name
An alterative approach is to query the value for the DynamicSiteName registry key under HKLM:\SYSTEM\CurrentControlSet\services\Netlogon\Parameters.
(Get-ItemProperty "HKLM:\System\CurrentControlSet\Services\Netlogon\parameters").DynamicSiteName
No comments:
Post a Comment