search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Checking Windows Service Status with Powershell
Posted in Windows Powershell, Windows Server | No Comment | 2,805 views | 17/08/2009 10:59

Today, I created a Powershell script to check a service status and if it is stopped, that starts it.

1
2
3
4
5
$Status = (Get-Service MEMTAS).Status
If ($Status -eq "Stopped")
{
Start-Service MEMTAS
}

Then add this to Cronjob and set it to run every 5 minutes. MEMTAS is a service name of Mail Enable.



Leave a Reply