Jump to content


kungfumang

SCCM Query help

Recommended Posts

Hey Everyone,

 

I'm new to the whole SCCM world and I'm trying to figure out how to find all the computers on the network that do not have a specific application installed. I've tried to copy and paste examples from search and modifying it to fit my needs but it's not returning any information. Ultimately the goal is to push out the applcation to the computers that do not have the application installed.

 

So I've setup 2 queries in an attempt to find information. Through searching it seems like the norm to find all systems WITH the app first and then create a 2nd subselection.

 

I did limited the query to a collection that list all of the site computers.

 

1. find all computers with the application

select SMS_R_System.Name from SMS_R_System inner join

SMS_G_System_ADD_REMOVE_PROGRAMS on

SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceId =

SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "Microsoft Lync 2010"

 

2. Query to find systems not in 1st query.

select SMS_R_System.ResourceId, SMS_R_System.Name from SMS_R_System

where SMS_R_System.ResourceId not in (select SMS_R_System.Name from

SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on

SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceId = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = "Microsoft Lync 2010")

 

 

Anyone see what is wrong? Thanks in advance!

 

Share this post


Link to post
Share on other sites

I see what wrong you are not comparing apples to apples.. in you subselct query, what are you returning?

In your Where section of your second query what are you returning?

 

Will they ever match????

 

 

 

 

Hint: Nope.. Make them the same it will work.

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.