Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enumerate WMI namespace group/users and permissions.

Status
Not open for further replies.

mharcourt

Programmer
Apr 9, 2003
49
0
0
US
I can open wmimgmt.msc, go to Properties, then security and expose all the namespaces. After selecting a namespace I can select security and see the group/user names and permissions.

What I am trying to accomplish is using a list of server names to audit WMI and enumerate the namespace group/users and permissions.


My questions is Can you do this from a script and if so HOW?
Anyone have suggestion on how I can accomplish this task?

Thanks
 
Hello mharcourt,

Enum the namespace is recursive. Connect to root and query the __namespace system class.
Code:
strComputer="."
set svc=getobject("winmgmts:\\" & strComputer)
sQuery="select * from __namespace"
set cns=svc.execquery(sQuery)
'      wscript.echo cns.count
for each ons in cns
    wscript.echo ons.path_
next
regards - tsuji
 
Thanks. I know I can enumerate namespaces and enumerate the methods and qualifers for WMI:__SystemSecurity. But this does not give me the information I need.

I need the User\groups names and their permissions.


 
mharcourt,

I know my posting certainly won't solve your problem. I guess you have read and are looking for script version of the gui operation as discussed in ms article 325353 (or win2000 version):

But binary arrays are everywhere for security settings here which stretch too far scripting. Maybe other members better informed would voluntee, I certainly hope so...

- tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top