-
Notifications
You must be signed in to change notification settings - Fork 10
Running Against Multiple Servers
The QA checks will work against just one server (local or remote) or against lots of servers. There are several different ways you can run against multiple servers. It all comes down to how many you want to scan.
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
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')
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.