Powershell to Query Active directory
Posted by Krishna - MVP on July 30, 2010
Powershell to Query Active directory and get the list of Domain controllers in the current AD Site which you server is located
%{[System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().Servers | % { $_.Name} }
Powershell to Query Active directory to get the current AD sites
[System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().name
Like this:
Be the first to like this post.
This entry was posted on July 30, 2010 at 3:54 pm and is filed under Active Directory, Powershell. Tagged: AD site, DirectoryServices, Powershell. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

