Jump to content


dharris21

Reboot pending WQL query

Recommended Posts

Hello all,

 

i have been trying to implement this query found here on SCCM 2012 SP1 CU3 with no success http://social.technet.microsoft.com/Forums/en-US/844afc93-0611-4470-a109-f51b37babd3e/config-manager-2012-collection-to-query-rebootsfor-patch-management?forum=configmanagersecurity

 

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

 

normally if i found a query online, i could paste it in and would work, or i could look at what values they were using and implement it from scratch, but this query doesnt seem to work for me.

 

when i paste this query into query design, it give me back a message " this query either has a syntax error or is using features of the language not supported in design view.

 

I scoured through the query wizard looking for the values it seems to be calling, but cannot find them.

 

i can not find:

 

SMS_UpdateComplianceStatus

LastEnforcementMessageID

 

What am i missing?

 

Any help would be appreciated.

Share this post


Link to post
Share on other sites

were you able to just paste it in, or did you have issue getting the syntax right from the paste. I figured it could be the copy/paste from the website I found it on as linked, but I didn't mess around with reorganizing the query in wizard. ill have to look at it when I get to work tomorrow. please let me know if copy/paste worked for you. I am surprised that the values aren't available in the wizard to be selected as options.

Share this post


Link to post
Share on other sites

I think I might have figured it out, but wont be able to verify till I get to work. I started the virtual lab from TechNet, and was able to get query to work. i think i was getting hung up on a normal procedure i do when working with queries. If I paste one in, instead of creating it from scratch with designer, i always click "Show Query Design" so i can see what selections it was making. it never dawned on me that just clicking OK would work, but it also never dawned on me that there was a query out there that didn't have a design per say for viewing.

Share this post


Link to post
Share on other sites

Query worked when pasted in for me too, although I definitely needed to add a "DISTINCT" to the initial SELECT statement as I had many, many entries for each system found by the query.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.