myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


Query for local admin users

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> Query for local admin users Page: [1]
Login
Message << Older Topic   Newer Topic >>
Query for local admin users - 8/11/2008 12:29:01 PM   
dwilson111

 

Posts: 1
Score: 0
Joined: 8/11/2008
Status: offline
Running SMS 2003. Is there a process I can run to query the local WMI on users PC's to see who has admin rights?

Thanks
Post #: 1
RE: Query for local admin users - 8/11/2008 1:32:28 PM   
skissinger


Posts: 2119
Score: 134
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
Check out this article.  Note the blog entry, especially if you have Vista clients.

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
My Blog
Microsoft MVP - ConfigMgr

(in reply to dwilson111)
Post #: 2
RE: Query for local admin users - 8/11/2008 1:45:05 PM   
gkamenjati


Posts: 108
Score: 0
Joined: 6/8/2005
From: San Jose, California
Status: offline
Sherry, I have MOFWIZARD from DudeWorks, will pasting Lange's code at the end of my sms_def.mof  file be enough, or do i still have to mofcomp it on the Client?

thank you.

(in reply to skissinger)
Post #: 3
RE: Query for local admin users - 8/11/2008 2:05:56 PM   
skissinger


Posts: 2119
Score: 134
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
MofWizard, or Inventory Manager?  Not that it matters much; I think you are still limited by SMS2003 clients needing to mofcomp.  Check with Rob to be sure, but with SMS2003 clients, I believe you'd need to at least mofcomp the Data section, so the clients know "how" to report on that class.  You might want to consider the script running on your clients instead, though--it's useful for Vista clients & works w/XP clients (32 bit for both--I suppose I could spend some time updating that script to be 32- or 64- agnostic).  If you use the script, the script will create the wmi section so you wouldn't need to mofcomp.  You'd only need the reporting section in sms_def.mof.

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
My Blog
Microsoft MVP - ConfigMgr

(in reply to gkamenjati)
Post #: 4
RE: Query for local admin users - 8/11/2008 2:46:00 PM   
gkamenjati


Posts: 108
Score: 0
Joined: 6/8/2005
From: San Jose, California
Status: offline
Thx Sherry, I just edited my sms_def.mof, and mofcomped couple of clients, and as you see from the DTALDR trace i don't see any errors.

My question to you is, how long it will be before I can see something in the report?

because I still get:

An error occurred when the report was run. The details are as follows:Invalid object name 'v_GS_LocalAdmins'.


Thumbnail Image


Attachment (1)

(in reply to skissinger)
Post #: 5
RE: Query for local admin users - 8/11/2008 2:54:32 PM   
joemonkey

 

Posts: 202
Score: 2
Joined: 2/28/2007
From: Kentucky
Status: offline
Hardware inventory has to be reported, then you'll see it in a report.

(in reply to gkamenjati)
Post #: 6
RE: Query for local admin users - 8/11/2008 3:07:00 PM   
gkamenjati


Posts: 108
Score: 0
Joined: 6/8/2005
From: San Jose, California
Status: offline
Thank you Sherry, I forced H/W cycle and as you see it worked perfectly.

Sherry, how can I change the Report to prompt for a specific machine?

Thanks.


Thumbnail Image


Attachment (1)

(in reply to joemonkey)
Post #: 7
RE: Query for local admin users - 8/11/2008 5:41:13 PM   
skissinger


Posts: 2119
Score: 134
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
Assuming you are referring to this report from the article:
quote:

select distinct Name0 as 'Computer Name', substring(AccountName0,charindex('Domain=',Accountname0)+8,(charindex('Name=',Accountname0)-charindex('Domain=',Accountname0)-10)) as 'Domain Name', substring(AccountName0,len(AccountName0)-charindex('"',reverse(AccountName0),2)+2,charindex('"',reverse(AccountName0),2)-2) as 'User Name'
from v_GS_SYSTEM INNER JOIN v_GS_LocalAdmins ON v_GS_SYSTEM.ResourceID = v_GS_LocalAdmins.ResourceID where (AccountName0 not like '%Administrator%' AND AccountName0 not like '%Domain Admins%')


Just limit it to a prompted value, like
quote:

select distinct Name0 as 'Computer Name', substring(AccountName0,charindex('Domain=',Accountname0)+8,(charindex('Name=',Accountname0)-charindex('Domain=',Accountname0)-10)) as 'Domain Name', substring(AccountName0,len(AccountName0)-charindex('"',reverse(AccountName0),2)+2,charindex('"',reverse(AccountName0),2)-2) as 'User Name'
from v_GS_SYSTEM INNER JOIN v_GS_LocalAdmins ON v_GS_SYSTEM.ResourceID = v_GS_LocalAdmins.ResourceID where (AccountName0 not like '%Administrator%' AND AccountName0 not like '%Domain Admins%') and name0 like @ComputerName



And you've added Prompt for ComputerName

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
My Blog
Microsoft MVP - ConfigMgr

(in reply to gkamenjati)
Post #: 8
RE: Query for local admin users - 8/11/2008 6:03:36 PM   
gkamenjati


Posts: 108
Score: 0
Joined: 6/8/2005
From: San Jose, California
Status: offline
Yes it worked perfectly,

And I wanted to thank you before I go home...

Till next time...

(in reply to skissinger)
Post #: 9
RE: Query for local admin users - 8/13/2008 11:19:19 AM   
gkamenjati


Posts: 108
Score: 0
Joined: 6/8/2005
From: San Jose, California
Status: offline
Sherry, do I have to MofComp all clients? or the couple clients I've done are enough to build the DB fields/views?


(in reply to gkamenjati)
Post #: 10
RE: Query for local admin users - 8/13/2008 4:04:19 PM   
skissinger


Posts: 2119
Score: 134
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
For this specific one, the one from Ward Lange, if you are SMS2003 you will need to mofcomp at least the data section on all your clients.  If you are ConfigMgr, naturally no mofcomp is required.  (Upgrade! if only for this one less headache!)

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
My Blog
Microsoft MVP - ConfigMgr

(in reply to gkamenjati)
Post #: 11
RE: Query for local admin users - 8/13/2008 4:55:19 PM   
gkamenjati


Posts: 108
Score: 0
Joined: 6/8/2005
From: San Jose, California
Status: offline
Do you think it is best to do it through Login Script via GPO (which I know how to do); or via SMS2003 which I need your help to show me how?

Thx Sherry.

(in reply to skissinger)
Post #: 12
RE: Query for local admin users - 8/13/2008 6:07:36 PM   
skissinger


Posts: 2119
Score: 134
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
Way back when I was SMS2003 (ah, memories, that was so 2 months ago), I used a mini.mof which had all of the stuff in it that needed to be compiled on the clients.  Within that mini.mof was a static class which stamped a 'version' into WMI.  Then you can create a collection based off the lack of the latest version to target the mofcomp to your clients.  NOTE! based on your environment, edit the .vbs to either do or do not have your clients do a full HW inventory when they mofcomp.  If you have a lot of clients, you can backlog your environment quickly!

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
My Blog
Microsoft MVP - ConfigMgr

(in reply to gkamenjati)
Post #: 13
RE: Query for local admin users - 8/13/2008 6:14:14 PM   
gkamenjati


Posts: 108
Score: 0
Joined: 6/8/2005
From: San Jose, California
Status: offline
Thx Sherry, I'm glad you're on my side, you keep me busy...

Thx for the link and I'm sure  I'll be learning a lot from this one... We are planning to upgrade to SCCM2007 early Jan 09, after the upgrade of the Active Directory to 2003 and Exchange to 2007 which is taking place as we speak...

Many Gracias.

(in reply to skissinger)
Post #: 14
Page:   [1]
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> Query for local admin users Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.281