Advertisement
Cogger

Services-SQL-Restart.ps1

Jan 10th, 2022
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $services = @(
  2.  'MSSQLSERVER',
  3.  'SQLSERVERAGENT',
  4.  'SQLBrowser',
  5.  'SQLTELEMENTRY',
  6.  'SQLWriter')
  7.  
  8.  Get-service |
  9.  Where { $Services -Contains $_.Name} |
  10.  Foreach {
  11.   Restart-Service
  12.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement