How do I use PowerShell to stop and start a "Generic Service" as seen in the Microsoft "Cluster Administrator" software?
views:
283answers:
2
+1
A:
It turns out the answer is to simply use the command line tool CLUSTER.EXE to do this:
cluster RES MyGenericServiceName /OFF
cluster RES MyGenericServiceName /ON
Rob Paterson
2008-09-22 08:27:07
+2
A:
You can also use WMI. You can get all the Generic Services with:
$services = Get-WmiObject -Computer "Computer" -namespace 'root\mscluster' `
MSCluster_Resource | Where {$_.Type -eq "Generic Service"}
To stop and start a service:
$timeout = 15
$services[0].TakeOffline($timeout)
$services[0].BringOnline($timeout)
Bruno Gomes
2008-09-26 17:57:42