Advertisement
tfl

ImprovedPSHCommand2

tfl
Oct 4th, 2018
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $Service = Get-CimInstance -ClassName Win32_Service -Namespace Root\Cimv2 -ComputerName Lisbon |
  2.     Where-Object { $_.Name -eq 'BITS' }
  3. $Return = $Service.ChangeStartMode('Manual')
  4. if($Return.ReturnValue -eq 0) {
  5.   'Changed start mode on Lisbon'}
  6. Else {
  7. " $($Return.ReturnValue) was reported from Lisbon"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement