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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s