Query returns contents of a "not like" ad group (Full Version)

All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager



Message


dspecht -> Query returns contents of a "not like" ad group (5/8/2008 7:52:52 PM)

Hi,

I am trying to create a query that contains all servers except ones that are in a specific AD group.
 
Problem is this query:
 
select SMS_R_System.Name from  SMS_R_System inner join SMS_G_System_SYSTEM on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SYSTEM.SystemRole = "Server" and SMS_R_System.SystemGroupName not like "MyDomain\\DONT REBOOT, just patch"
 

Returns all servers (which is good) including those in the Don’t reboot group (which is bad)
 
What am I doing wrong?
 
Thanks,
 
Dan
 






jdavis375 -> RE: Query returns contents of a "not like" ad group (5/8/2008 8:59:23 PM)

Dan,
You are battling with what has become one of my favorite items...you need a subselect query. Rod Trent wrote a great article on it on this forum. You can look at it here:
http://www.myitforum.com/articles/1/view.asp?id=179

I fought with trying to create these blasted things by hand for a couple of years before finally finding Rod's article. Made things a lot easier. I also wrote about my experience with these queries in this blog post:  http://verbalprocessor.com/2008/02/26/subselect-query-in-sccm/

Caution...Rod's instructions are pretty detailed. Don't get tempted to skip a step. They are all there for a reason.

Hope that helps.




dspecht -> RE: Query returns contents of a "not like" ad group (5/9/2008 12:10:15 AM)

Thanks Jarvis, I will give it a try in the morning.

ps: I went to your blog and read around... Hey I seen you in that video at MMS to!!




dspecht -> RE: Query returns contents of a "not like" ad group (5/10/2008 1:22:08 PM)

 I followed the directions from your Blog and Rod Trent's "How to" and was able to get the results I needed.

   Thanks!




jdavis375 -> RE: Query returns contents of a "not like" ad group (5/10/2008 4:00:01 PM)

Awesome...it was certainly more of Rod's post than my blog that helped!

Also...glad you enjoyed the video. :-)




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.796875