Solved

WMI not finding Domain Local on Servers Local Administrators Group

Posted on 2010-08-17
3
1,304 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now