Link to home
Start Free TrialLog in
Avatar of idealsw
idealsw

asked on

WMI not finding Domain Local on Servers Local Administrators Group

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?
Avatar of RobSampson
RobSampson
Flag of Australia image

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.
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of idealsw
idealsw

ASKER

Thank you. I'll get the hotfixes.
Best wishes
Bish