Advertisement
Guest User

Untitled

a guest
Apr 7th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. function start() { Start-Service MyService // verify service started here }
  2.  
  3. function stop() { Stop-Service MyService // verify service stopped }
  4.  
  5. function status() { // Return Running/Stopped for MyService }
  6.  
  7. ssh user@server powershell.bat
  8.  
  9. import wmi
  10.  
  11. # Open a connection to a remote machine
  12. c = wmi.WMI (
  13. computer="other_machine",
  14. user="you",
  15. password="something"
  16. )
  17.  
  18. # start the service
  19. c.<service>.StartService ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement