Solved

WMI not finding Domain Local on Servers Local Administrators Group

Posted on 2010-08-17
3
1,312 Views
Last Modified: 2013-11-08
I am running the following WMI query from a domain account which is in the local Administrators group on my server:

select * from Win32_GroupUser where GroupComponent = "Win32_Group.Domain='WIN2000SERVER1',Name='Administrators'"

and it returns most of the members of the group. However, it doesn't return domain groups which are "Domain Local" groups.  It returns "Global" groups correctly and all users and local groups.

Any ideas?
0
Comment
Question by:idealsw
  • 2
3 Comments
 
LVL 65

Expert Comment

by:RobSampson
ID: 33460450
Hi, what you have should work, but I prefer to make the server and group a variable, like this

strServer = "SERVER"
strGroup  = "Administrators"
strNameSpace = "root\cimv2"
strDomain = "DOMAIN"
strUserName = "administrator"
strPassword = "password"
Set objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objWbemLocator.ConnectServer(strServer, strNameSpace, strDomain & "\" & strUserName, strPassword)
objWMIService.Security_.AuthenticationLevel = WbemAuthenticationLevelPktPrivacy
Set colGroups = objWMIService.ExecQuery("Select * FROM Win32_GroupUser WHERE GroupComponent = 'Win32_Group.Domain=""" & strServer & """,Name=""" & strGroup & """'")
But, your problem relates to this article:
http://support.microsoft.com/kb/320489
However, even if I run against a 2003 server, the Domain Local group is still not listed, although I have not  installed the hotfix on that server.
Even running *from* a 2003 server *against* another 2003 server, it doesn't show Domain Local either....perhaps install the hotfix and see if that helps you.
Regards,
Rob.
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 33460465
Actually, here's the 2003 Server article:
http://support.microsoft.com/kb/940527/
Regards,
Rob.
0
 
LVL 1

Author Comment

by:idealsw
ID: 33463108
Thank you. I'll get the hotfixes.
Best wishes
Bish
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question