Re: Win32_LogicalShareSecuritySetting not returning results



If ColItems.Count is 0, there aren't any shares. Try creating a share
on the local system to some dir temporarily to see what happens then...

Have you tried doing this from the command prompt, instead of inside
Excel? just to check?

As well, this WMI method doesn't enumerate Administratively shared
shares like C$ or ADMIN$, however, if you create something like
drivers$, then it will work with that share... as you are not able to
modify admnistrative shares easily (or at all?) -- only the local
administrators group has access there, and even then, you could find
out who they are by enumerating the group for members.

Throw this in a VBS file and run cscript scriptname.vbs

Set WMIService = GetObject("winmgmts:\\.\root\cimv2")
Set ColItems = WMIService.ExecQuery("Select * from" &_
"Win32_LogicalShareSecuritySetting",,48)
For Each Item in ColItems
WScript.Echo "Caption: " & Item.Caption
WScript.Echo "ControlFlags: " & Item.ControlFlags
WScript.Echo "Description: " & Item.Description
WScript.Echo "Name: " & Item.Name
WScript.Echo "SettingID: " & Item.SettingID
Next

Output:
Caption: Security settings of drivers
ControlFlags: 32772
Description: Security settings of drivers
Name: drivers
SettingID:

Hope this helps.

Steven

DwightInTx wrote:
I've seen quite a few examples of Win32_LogicalShareSecuritySetting and each
one that I try returns a colItems.count of 0

Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_LogicalShareSecuritySetting")

Im not tied to using this solution, but, overall, what Im trying to do it an
audit on remote servers,

For each server, what shares exsist, and for each share, who has access.

I'm able to get the win32_shares objects back, so I know the names of the
shares, but, from there I can't get the "who has what access"

Im not sure if it has any affect, but, im doing this script in VBA (in excel
2003). Im happy for those that say "works for me" but, it does not work for
me, and Im posting to find out what I should do to fix it.

I get the same results if servername = "." or remote a servername

.



Relevant Pages


Loading