Obtaining Active Directory Site of a Computer Object using Powershell

In order to obtain the Active Directory site to which a computer object within your domain is a member of , you can query the computer object using the ActiveDirectorySite.GetComputerSite method as below;

[System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite()


Leave a comment