With the following powershell script, you can get a service status on remote servers Script : $ErrorActionPreference = “SilentlyContinue” $strCategory = “computer” $objDomain = New-Object System.DirectoryServices.DirectoryEntry $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.Filter = (“(objectCategory=$strCategory)”) $colProplist = “name” ,
Generates a full-memory minidump of a process
Get server hostnames on which MSSQLServer service is installed
Execute a cmdlet on a remote system with Invoke-Command
Robocopy process management
Restart a service on remote servers
This script restart the service name “SMS Agent Host” on the servers listed in the file C:\temp\BOOK1.txt Script : ForEach($MachineName In $hosts){ $service = Get-Service -ComputerName $MachineName -name “sms agent host” Write-Host $MachineName, $service.status, $service.name (new-Object System.ServiceProcess.ServiceController(‘sms agent host’,$MachineName)).Stop() (new-Object
Monitor if a process is frozen
Kill all instances of the same process name
This script kill all instances of the process “Robocopy” Script : (get-process |where {$_.processname -eq “Robocopy”}) | stop-process Reference : Using the Stop-Process Cmdlet Terminating a Process Syntax Stop-Process -name string[] [-passThru] [-Force] [-confirm] [-whatIf] [CommonParameters] Stop-Process [-id] Int32[] [-passThru]