Wednesday, June 8, 2016

Powershell: Get a list of your Domain Controllers including Name, IPv4Address, OS and Site

The following PS one liner will export all your Domain Controllers to a text file including information like:

Name,IPv4,OS,Site

The text file will look like the following example:

 

Script:

Get-ADDomainController -Filter * | Select Name, ipv4Address, OperatingSystem, site | Sort-Object -Property Name >C:\DC_Overview.txt 

If you remove >C:\DC_Overview.txt the output will be displayed in Powershell.

Get-ADDomainController -Filter * | Select Name, ipv4Address, OperatingSystem, site | Sort-Object -Property Name
 
Have fun!

Technet Link:
https://gallery.technet.microsoft.com/PS-Get-a-list-of-your-121f6086