Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Possible to save password in script?

$
0
0

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


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>