Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.

Running Against Multiple Servers

My Random Thoughts edited this page Jul 18, 2017 · 3 revisions

The QA checks will work against just one server (local or remote) or against lots of servers.

Mutli-Server Options

There are several different ways you can run against multiple servers. It all comes down to how many you want to scan.

Manually typed

If you only have a few servers to scan, you can add their names to the end of the command line as shown below.

QA.ps1 -ComputerName server01, server02, server03

Text File

If you have a list of servers in a text file (one per line) you can get PowerShell to read this in and have the QA script scan against them.

QA.ps1 -ComputerName (Get-Content -Path 'C:\Path\To\File.txt')

Scan Active Directory

Similar to reading in a text file, you can read in the list of servers defined in Active Directory. The example below loads the ActiveDirectory module then gets all computers with a server operating system.

Import-Module -Name 'ActiveDirectory'
QA.ps1 -ComputerName (Get-ADComputer -Filter {OperatingSystem -Like 'Windows Server*'} | Select-Object -ExpandProperty Name)

See the Microsoft documentation on Get-ADComputer for more information on possible filters.

Clone this wiki locally