List all Windows Servers in Domain

Import-Module ActiveDirectory

Get-ADComputer -Filter { OperatingSystem -Like ‘*Windows *Server*’ } -Properties OperatingSystem,CanonicalName,Description | Select Name, OperatingSystem,CanonicalName,Description | Export-Csv C:\scripts\Servers.csv

Leave a Reply

Your email address will not be published. Required fields are marked *