Question Locked

Multiple user folder permissions

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi, I'm trying to find a way to create multiple user folders on a network resource and add permissions for each folder. For example; Create a folder for John Doe | jdoe | and have permissions set for full control for jdoe and also domain admins. Is there a way I can do this without having to create a folder and change the options for every user I have?

I mean it sure would be nice to have some sort of program to where I could just add name into a text box and have it create the folder and set the permissions for the name in the text box and also add domain users to the permissions also.

4 replies

by Member 25348569

or maybe batch files. I use a utility called SETACL and there's a Microsoft program called CACL.

Follow a part of my user-creation script that creates a folder and assigns full rights for the user. If you can't follow it then you've some work to do but it will be rewarding.

[pre]
Set oFSO = CreateObject("Scripting.filesystemobject")
Set oShell = CreateObject("wscript.Shell")

sRootPath = "\\wherever\you\want\to\put\them\"
sResourcePath = "\\Wherever\you\store\stuff\"

sLogonName = inputBox("Enter user's logon name")
sDomain = "yourdomain"

' Check it's not already there

If Not oFSO.FolderExists(sRootPath & sLogonName) Then
oFSO.CreateFolder sRootPath & sLogonName
End If

oShell.Run sResourcePath & "SETACL.EXE -on " & sRootPath & sLogonName & _
" -ot file -actn setowner -ownr n:" & sDomain & "\" & sLogonName, 2, True
oShell.Run sResourcePath & "SETACL.EXE -on " & sRootPath & sLogonName & _
" -ot file -actn setprot -op dacl:p_c", 2, True
oShell.Run sResourcePath & "SETACL.EXE -on " & sRootPath & sLogonName & _
" -ot file -actn ace -ace n:" & sDomain & "\" & sLogonName & ";p:change", 2, True

[/pre]

There may be typos! :)

by tonythetiger

to Neil's response, you may want to reconsider giving the user "full control" of the folder, and give them "modify" instead.

"Full control" will give them the ability to change the ownership of files as well as the permissions, meaning that they could "exclude" admins and backup operators, which probably isn't a good idea.

by Member 25348569

the code snippet above does only give Modify rights. SETACL calls it "change"

This discussion is closed to new replies.