Skip to content

Instantly share code, notes, and snippets.

@omerh
Created March 9, 2014 08:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save omerh/9444726 to your computer and use it in GitHub Desktop.
Save omerh/9444726 to your computer and use it in GitHub Desktop.
Restart all NewRelic Service Agent (from file
$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