I've made this script to reboot any workstations listed in the txt file and it seems to work great however the only catch is that it prompts for the admin password. My goal it to schedule this to run after hours weekly without intervention. Any way to do this?
Here's what I have so far:
Restart-Computer (Get-Content C:\Users\administrator\Desktop\ComputerList.txt) -credential "MYDOMAIN\administrator" -force