Re: Querying machines missing win32_LocalAdmins class
- From: Jpatridge <Jpatridge@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 31 May 2007 19:27:00 -0700
Ah, that's where I ran into trouble - didn't change SMS_R_System.Name to
SMS_R_System.ResourceID.
Works great, Garth. Thanks for all your help.
"Garth" wrote:
To get the positive query, change SMS_R_System.Name to SMS_R_System.ResourceID.
select distinct SMS_R_System.ResourceID from SMS_R_System inner join
SMS_G_System_LOCALADMINS on SMS_G_System_LOCALADMINS.ResourceID =
SMS_R_System.ResourceId where SMS_G_System_LOCALADMINS.GroupName =
"Win32_Group.Domain=\"BUILTIN\",Name=\"Administrators\""
Then add the following to the beginning and ")" to the end
select distinct SMS_G_System_COMPUTER_SYSTEM.Name
from SMS_G_System_COMPUTER_SYSTEM
where SMS_G_System_COMPUTER_SYSTEM.ResourceID not in (
So now your query should look like this. Notice that the positive query is highlighted in blue below.
select distinct SMS_G_System_COMPUTER_SYSTEM.Name
from SMS_G_System_COMPUTER_SYSTEM
where SMS_G_System_COMPUTER_SYSTEM.ResourceID not in (select distinct SMS_R_System.ResourceID from SMS_R_System inner join
SMS_G_System_LOCALADMINS on SMS_G_System_LOCALADMINS.ResourceID =
SMS_R_System.ResourceId where SMS_G_System_LOCALADMINS.GroupName =
"Win32_Group.Domain=\"BUILTIN\",Name=\"Administrators\"")
I hope this helps..
"Jpatridge" <Jpatridge@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:E60633E5-19BD-4602-8C2C-81CC6ACD68D4@xxxxxxxxxxxxxxxx
Thanks Garth - I think I'm almost there. So I've got a query that provides me
a list of all users who have the local admins group defined (see query
below). I'm a bit of a SQL rookie and am having a tough time converting it to
the negative query. Any suggestions?
select distinct SMS_R_System.Name from SMS_R_System inner join
SMS_G_System_LOCALADMINS on SMS_G_System_LOCALADMINS.ResourceID =
SMS_R_System.ResourceId where SMS_G_System_LOCALADMINS.GroupName =
"Win32_Group.Domain=\"BUILTIN\",Name=\"Administrators\""
"Garth" wrote:
duh...These
http://smsug.ca/blogs/garth_jones/archive/2007/05/10/303.aspx
http://smsug.ca/blogs/garth_jones/archive/2007/05/08/302.aspx
"Kim Oppalfens [MVP]" <""Kim dot Oppalfens\"@google mail.com"> wrote in
message news:evSWdWSoHHA.2452@xxxxxxxxxxxxxxxxxxxxxxx
What blog?
Garth wrote:
Yes, this blog can help you out with that.
"Jpatridge" <Jpatridge@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EF6CAD24-8EBC-4727-83A0-A8EDC67A9976@xxxxxxxxxxxxxxxx
We have updated our sms_def.mof to inventory the win32_localadmins
class, and
will be using SMS to distribute a script that creates the
win32_localadmins class on each machine.
What we'd like to do now is to create a collection that queries the
machines
that don't have the win32_localadmins class defined, and have a
permanent
advertisement to that collection which will distribute the appropriate
script.
Is this possible? Any suggestions on a SQL query that would make this
happen?
My hope is that the collection will be "self-regulating", in that it
will be
comprised of machines missing the class, the advertisement will create
the
class on the machine, and ultimately the collection wll go down to zero
members. Does this sound right?
Thanks...
--
"Everyone is an expert at something"
Kim Oppalfens - Sms Expert for lack of any other expertise
Windows Server System MVP - SMS
http://www.blogcastrepository.com/blogs/kim_oppalfenss_systems_management_ideas/default.aspx
- Follow-Ups:
- Prev by Date: Http verification .sms_aut (port 80) failed
- Next by Date: SMS 2003 slows down client computers during boot
- Previous by thread: Http verification .sms_aut (port 80) failed
- Next by thread: Re: Querying machines missing win32_LocalAdmins class
- Index(es):
Relevant Pages
|
Loading