From: admin@lists.myITforum.com [mailto:admin@lists.myITforum.com] On Behalf Of Nepal, Santosh
Sent: Friday, February 27, 2009 11:38 AM
To: msmom@lists.myitforum.com
Subject: [msmom] RE: Restarting Exchange IMAP Process with SCOM

David,

 

You can add the diagnostic option and use the following script to kill any processes you want (I am killing two processes within this script). Add recovery option to restart any service you want. I love this option within SCOM. Hope this helps.

 

Option Explicit

Dim objWMIService, objProcess, colProcess

Dim xComputer, xProcessKill ,xProcessKill2

xComputer = "."

xProcessKill = "'notepad.exe'"

xProcessKill2 = "'calc.exe'"

 

Set objWMIService = GetObject("winmgmts:" _

& "{impersonationLevel=impersonate}!\\" _

& xComputer & "\root\cimv2")

 

Set colProcess = objWMIService.ExecQuery _

("Select * from Win32_Process Where Name = " & xProcessKill)

For Each objProcess in colProcess

objProcess.Terminate()

Next

 

WScript.Sleep 5000

 

Set colProcess = objWMIService.ExecQuery _

("Select * from Win32_Process Where Name = " & xProcessKill2)

For Each objProcess in colProcess

objProcess.Terminate()

Next

 

Regards,

 

Santosh Nepal

 

From: admin@lists.myITforum.com [mailto:admin@lists.myITforum.com] On Behalf Of David Strebel
Sent: Friday, February 27, 2009 10:09 AM
To: msmom@lists.myitforum.com
Subject: [msmom] Restarting Exchange IMAP Process with SCOM

Our IMAP service on Exchange seems to lockup sometimes. We receive an alert for the error. I know I can just use the recovery option to remediate the error. Does anyone have a powershell or vbscript that can kill and restart a process. Or if anybody has any other ideas on how to use auto recovery this I am open to ideas.

___________________________

David Strebel

Systems Administrator

Kellogg School of Management


==============
Missed an email? Check out the list archive:
http://myitforum.com/cs2/blogs/momlist/


==============
Missed an email? Check out the list archive:
http://myitforum.com/cs2/blogs/momlist/

Trackbacks

No Trackbacks

Comments

No Comments