List all Active Directory servers using PowerShell Commands

The following is a comparison between obtaining list of servers in AD with Windows PowerShell and ADManager Plus:

Windows PowerShell

Steps to obtain list of servers in AD using PowerShell:

  • Identify the domain from which you want to retrieve the report.
  • Identify the LDAP attributes you need to fetch the report.
  • Compile the script.
  • Execute it in Windows PowerShell.
  • The report will be exported in the given format.
  • To obtain the report in a different format, modify the script accordingly to the needs of the user.

Sample PowerShell script:

 Copied
Import-Module ActiveDirectory
Get-ADComputer -Filter 'operatingsystem -like "*server*" -and enabled -eq "true"' ` -Properties Name,Operatingsystem,OperatingSystemVersion,IPv4Address | Sort-Object -Property Operatingsystem |
Select-Object -Property Name,Operatingsystem,OperatingSystemVersion,IPv4Address
Click to copy entire script

ADManager Plus

  • Select Reports -> Computer Reports -> OS Based Reports.
  • Select the domain and OU.
  • Select the OS from the list and click Generate.

Screenshot

» Start 30-day Free Trial

Limitations:

  • We can run this script only from the computers which have Active Directory Domain Services role.
  • Adding even minor modifications to the script—such as adding additional attributes to the reports—require it to be modified and executed again, which is time-consuming.
  • For each format type, the script has to be modified accordingly to export in that format, leading to increased LDAP query complexity in the scripts.
  • Troubleshooting the script requires extensive AD and scripting expertise.

ADManager Plus will retrieve details of servers in any CSV, XLSX, PDF, or HTML format from a simple and intuitively designed UI.

Get critical insights on Active Directory computers in your domains with purpose-built reports.

  Get 30-day free trial.

Embark on your script-free AD management, reporting, and automation journey with ADManager Plus.

  •  
     
  • By submitting you agree to processing of personal data according to the Privacy Policy.

Thanks

Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Powershell How-to Guides:

The one-stop solution toActive Directory Management and Reporting

Email Download Link Email the ADManager Plus download link