Querying if a service is running / paused / stopped
Hi, I'm trying to create a report in SCCM 2007 to see which PCs have the service McShield set to "Paused". I have snagged a query that displays a list of all computers with the service installed (below), but the "State" and "Started" column always remains completely blank - as well, if I add any condition to the WHERE statement referencing either, it acts as a null value as well. Am I overlooking something? I'm not great with SQL, but it seems like it should work.Query:SELECT GS.Name0 as 'PC Name', GSS.DisplayName0 as 'Service', GSS.StartMode0 as 'Startup', GSS.State0 as 'State', GSS.Started0 as 'Started'FROM v_GS_SERVICE GSS, v_GS_COMPUTER_SYSTEM GSWhere GSS.ResourceID = GS.ResourceID AND GSS.DisplayName0 = 'McAfee McShield'ORDER BY GS.Name0, GSS.DisplayName0
September 15th, 2009 5:47pm

Check your sms_def.mof, those fields are no set to true by default. Once set to true your PCs will start collecting this info. http://www.enhansoft.com/
Free Windows Admin Tool Kit Click here and download it now
September 15th, 2009 7:43pm

Definately what I needed to do - thanks. That's a huge part of SCCM that I've overlooked.Thanks for the script, too!
September 16th, 2009 11:29am

Garth Jones, I know this is closed but I wanted to know which field needs to be set as True in sms_def.mof. Please help me.
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2012 5:08am

I couldn't find this entry in sms_mof [SMS_Report (TRUE) ] string State; Let me know where can I find this.
August 31st, 2012 7:54am

Then you can simply add it. Make sure you are looking under the Win32_Service class though.Jason | http://blog.configmgrftw.com
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2012 8:33am

Then you can simply add it. Make sure you are looking under the Win32_Service class though.Jason | http://blog.configmgrftw.com
August 31st, 2012 8:38am

I tried but after SMS_mof file is saved, its getting reverted back to original state Let me know what to do.
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2012 9:39am

If the sms_def.mof is getting reset, it is because there is a typo in your sms_def.mof. Check you edit.. Is it right?http://www.enhansoft.com/
August 31st, 2012 1:34pm

If the sms_def.mof is getting reset, it is because there is a typo in your sms_def.mof. Check you edit.. Is it right?http://www.enhansoft.com/
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2012 1:39pm

I copy pasted, I typed manually etc..but still same, no idea what is wrong. under this class Win32_Service & end of class statement I used this [SMS_Report (TRUE) ] string State;
September 1st, 2012 12:56am

ok I got it, there was already a "string State" text in the class, I was trying to add extra entry, that's the reason it was failing. Now I could get service status details.
Free Windows Admin Tool Kit Click here and download it now
September 1st, 2012 1:39am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics