top of page

PowerShell - Search list of services against list of servers for status

  • Writer: Jon Boyette
    Jon Boyette
  • Jan 11, 2022
  • 1 min read

Save as named.ps1 and specify servers to check in c:\temp\servers.txt, populate c:\temp\services.txt with ALL services you want to check on each server.

$Machines = Get-Content -Path "c:\Temp\servers.txt"

$Services = Get-Content -Path "c:\Temp\services.txt"

foreach ($computer in $machines){

Write-host "Checking if service is running on $computer" -b "green" -foregroundcolor "red"

Get-Service -Displayname $Services -ComputerName "$computer"

}


 
 
 

Recent Posts

See All
PowerShell - List All Domain SPNs

Save as same List_ALL_SPNs.ps1 or similar, this LDap calls the Domain for all Service Principal names and accounts related #Build LDAP...

 
 
 
PowerShell - Start-Monitoring

This is a great script used to Monitor and Email if a server is up or down, once ran, and smtp and from address is set, then run:...

 
 
 

Comments


Post: Blog2 Post
  • Facebook
  • Twitter
  • LinkedIn

©2022 by Boyette Technical Services. Proudly created with Wix.com

bottom of page