Advertisement
Guest User

Untitled

a guest
Apr 7th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. set-executionpolicy -scope CurrentUser -executionPolicy bypass -force
  2.  
  3. $username = "UserName"
  4. $password = cat C:securestring.txt | convertto-securestring
  5. $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $password
  6.  
  7. invoke-command {restart-service "ServiceName"} -computer lust-ze -Credential $cred
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement