I'd like to use WMI to query the shares on a pc, or array of pc's as in this script:
On Error Resume Next
arrComputers = Array("127.0.0.1")
For Each strComputer In arrComputers
WScript.Echo "Computer: " & strComputer
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("S
ELECT * FROM Win32_Share Where Type = 0 ")
I'd also like to get the permissions for each item it returns with the script here:
I've been trying to set the first line in this script to:
strFolderName = objItem.Path (rather than strFolderName = "C:\scripts\sec_center")
But it hasn't worked. Also using just the path won't really work on a remote pc share, as c:\something\something is not a valid share name.
perhaps strFolderName = strComputer\objItem.Name (not that that is a valid statement, but it should get the idea accross)
I'll probably need a for each... in there, anyone have any ideas? Should I post this to a different TA?