PowerShell script to get the server details from the domain controller

Login to the Domain controllers or RSAT / Relevant features installed client machines.

To get AD computer details from Windows 2003 Domain Controllers use below command in command prompt::

dsquery * -filter "(objectCategory=computer)" -limit 1000 -attr cn whenChanged whenCreated > ad_domainname.txt
Note: We can use the above command without ‘–limit 1000’

To get AD computer detail from Windows 2008 Domain Controllers use below commands in PowerShell::

1. Import-module ActiveDirectory
2. Get-ADComputer -properties * -LDAPFilter "(&(objectcategory=computer))"|export-csv c:\ad_domainname_computers.csv

Comments