Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set-executionpolicy -scope CurrentUser -executionPolicy bypass -force
- $username = "UserName"
- $password = cat C:securestring.txt | convertto-securestring
- $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
- invoke-command {restart-service "ServiceName"} -computer lust-ze -Credential $cred
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement