Created
March 9, 2014 08:55
-
-
Save omerh/9444726 to your computer and use it in GitHub Desktop.
Restart all NewRelic Service Agent (from file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$servers = Get-Content C:\servers.txt | |
foreach($server in $servers) | |
{ | |
if( Get-Service -ComputerName $server -Name "New Relic Server Monitor Service" -ErrorAction SilentlyContinue) | |
{ | |
sc.exe \\$server stop nrsvrmon | Out-Null | |
sleep 5 | |
sc.exe \\$server start nrsvrmon | Out-Null | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment