In the past I had done something like:
- Get the list of computers I need to run against from Active Directory or a csv file.
- For each computer, attempt to ping it and if it responds run ye’ commands.
From there we can use PSRemoting or tools like psexec.exe with the –d switch to (relatively) quickly run a set of commands against our computers that are up and running!
Many thanks to Lee Holmes for the script that creates the above code block on the clipboard for pasting from any script, truly awesome.