LuckyDuck528
Programmer
Hello-
First of all, thanks to all of you who have helped me before. I've learned alot from my errors but I still can't wait till I'm done with this project... Almost there!
I created a Master script that runs on my PC. It maps drives to different servers and runs another script (also from my PC) on the server.
Part of what the second script does is to find a particular folder, get the security group names and then get the names of all of the users that belong to that group.
The program works perfectly until it has to Get the security object. The program works fine if it is being run on the actual server itself.
I guess I need to know if anyone thinks it is possible to have the program somehow say "go to mapped drive S: and get this security for this path"... any ideas on how to fix this would be appreciated! If you need more code or information let me know!
Thanks for your time, AGAIN! I sincerely appreciate it!
First of all, thanks to all of you who have helped me before. I've learned alot from my errors but I still can't wait till I'm done with this project... Almost there!
I created a Master script that runs on my PC. It maps drives to different servers and runs another script (also from my PC) on the server.
Part of what the second script does is to find a particular folder, get the security group names and then get the names of all of the users that belong to that group.
The program works perfectly until it has to Get the security object. The program works fine if it is being run on the actual server itself.
I guess I need to know if anyone thinks it is possible to have the program somehow say "go to mapped drive S: and get this security for this path"... any ideas on how to fix this would be appreciated! If you need more code or information let me know!
Thanks for your time, AGAIN! I sincerely appreciate it!
Code:
Function FindUsers(SubFolder)
[COLOR=green]
Wscript.Echo SubFolder.Path
'I put this in to check that it's looking for the
'right folder, which it is.
[/color]
Set RootDSE = GetObject("LDAP://rootDSE")
Domain = RootDSE.Get("DefaultNamingContext")
Set ObjConnection = CreateObject("ADODB.Connection")
ObjConnection.Open "Provider=ADsDSOObject;"
Set ObjCommand = CreateObject("ADODB.Command")
ObjCommand.ActiveConnection = ObjConnection
[COLOR=red]
Set ObjSecurity = GetObject("winmgmts:\\" & ServerName & "\root\cimv2:Win32_LogicalFileSecuritySetting='" & SubFolder.Path & "'")
[/color]
ObjSecurity.GetSecurityDescriptor ObjSD
Set ObjOwner = ObjSD.Owner
For Each ObjACE In ObjSD.DACL
Permissions = "Special"
If ObjACE.AccessMask = 2032127 Then Permissions = "Full"
more code..... etc....
'***************************************************
For the record... The code above was adapted from a script I found on the web.. it's documented at the end of my program... Sorry, I always like to include that sort of thing when posting!
Thanks!
'******************************"
'* Script: EnumFolderPerms.vbs"
'* Creation Date: 6-17-2003"
'* Author: Ron Rosenkoetter"