Scheduled task Query
Hello,
Does anyone know how to run a query in SCCM on a specfic scheduled task on all workstations in a collection.
We have a task called shutdown2 which shutdowns all our workstations at 4:30am. However some users with elevated privellages have deleted the schedule task preventing shutdown.This has caused many problems when we tried to patch those specfic workstations.
I have tried the following query for workstations that are pending reboot but the results are inaccurate.
select SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client from sms_r_system AS sms_r_system inner join SMS_UpdateComplianceStatus as c on c.machineid=sms_r_system.resourceid
where c.LastEnforcementMessageID = 9
Thanks for all your help :)
Rahim
November 4th, 2010 11:16am
That sounds like a perfect scenario for a DCM baseline / CI: all clients with that scheduled task are compliant. Clients missing that scheduled task are non-compliant.
Free Windows Admin Tool Kit Click here and download it now
November 4th, 2010 11:34am
How are you collecting, which WS have the schedule task data?
Are you following our suggestion to create a mof edit to collect the Schedule task data?
http://social.technet.microsoft.com/Forums/en-US/configmgrsum/thread/69f6ebe0-52e8-4ae6-9e2c-a96e81bc2022/
Or are you using DCM?
http://www.enhansoft.com/
November 4th, 2010 1:15pm
Sounds like a perfect scenario for a third party power management tool to me.
John Marcum | http://myitforum.com/cs2/blogs/jmarcum |
Free Windows Admin Tool Kit Click here and download it now
November 4th, 2010 1:20pm
Rahim, are you double posting? You haven't provided any feedback on the other similar question you made at http://social.technet.microsoft.com/Forums/en-US/configmgrsum/thread/69f6ebe0-52e8-4ae6-9e2c-a96e81bc2022
Also, take a look at http://social.technet.microsoft.com/Forums/en-US/configmgrinventory/thread/f6914e9b-94e9-4efe-8a0c-34e5b1d93347 for some ideas.
Regards,
Tom Watson,
E-Mail: Tom_... @...
Blog: http://myitforum.com/cs2/blogs/tom_watson
November 5th, 2010 9:55am
Sorry I think I was having network problems and accidently double posted.
Free Windows Admin Tool Kit Click here and download it now
November 15th, 2010 3:51pm
How are you collecting, which WS have the schedule task data?
Are you following our suggestion to create a mof edit to collect the Schedule task data?
http://social.technet.microsoft.com/Forums/en-US/configmgrsum/thread/69f6ebe0-52e8-4ae6-9e2c-a96e81bc2022/
Or are you using DCM?
http://www.enhansoft.com/
Hello Garth
At the moment don't have a way of collecting information which computers are missing the scheduled task. The way we can tell is when computers are pending a reboot after we distribute patches by checking advertisments. However checking the advertisments
is giving us inacurrate results since we have 1500 workstations. I am unfamilar with using DCM. Is there resources you know of on how I would configure DCM for our scheduled task?
Thanks for your help!
Rahim
November 15th, 2010 5:04pm
In this post
http://social.technet.microsoft.com/Forums/en-US/configmgrsum/thread/69f6ebe0-52e8-4ae6-9e2c-a96e81bc2022/ , We tell you what you need to enable within the sms_def.mof to collect this info.http://www.enhansoft.com/
Free Windows Admin Tool Kit Click here and download it now
November 20th, 2010 10:06pm
Insted of using a schedule task to shutdown all your workstations, why don't you use a mandatory and silent advertisement to run %windir%\system32\shutdown.exe -s and schedule this mandtory advertisement to run at 4:30 am every day.
This way you don't have to bother about users deleting scheduled tasks.
Regards, Madan
November 21st, 2010 2:15am
Insted of using a schedule task to shutdown all your workstations, why don't you use a mandatory and silent advertisement to run %windir%\system32\shutdown.exe -s and schedule this mandtory advertisement to run at 4:30 am every day.
... because each and every machine that is offline at 04:30am will run the advertisement just after it was powered on. That might not be a desired result.
Free Windows Admin Tool Kit Click here and download it now
November 21st, 2010 5:26am
yes are correct, sorry. I was breaking up the wrong tree.Regards, Madan
November 21st, 2010 8:19am
I should of been more specific, how would I make a collection based query with workstations that have not been shutdown for a long period of time?
Free Windows Admin Tool Kit Click here and download it now
November 30th, 2010 1:03pm
something like this, from Kent Agerlund?
http://blog.coretech.dk/confmgr07/config-mgr-inventory-and-reporting/query-and-report-all-workstations-that-havent-rebooted-the-last-7-days/Standardize. Simplify. Automate.
November 30th, 2010 1:13pm