[Windows Security Gurus] scripting permissions on the fly

Recar

Veteran XV
I am looking for a way to script file shares and permissions for users on the fly. Here is the setup.....

User logs in and wants to store a file on the server. When they goto store a file I need a few things to happen.

1. New folder is created with name supplied by them.
2. Folder share is created name supplied by them.
3. Need to add their login to have read/write permissions on that new share.
4. Need to remove 'EVERYONE' user from newly created folder permissions.

I would like to do all of this via script. Let me know if you need more info.
 
Recar said:
I am looking for a way to script file shares and permissions for users on the fly. Here is the setup.....

User logs in and wants to store a file on the server. When they goto store a file I need a few things to happen.

1. New folder is created with name supplied by them.
2. Folder share is created name supplied by them.
3. Need to add their login to have read/write permissions on that new share.
4. Need to remove 'EVERYONE' user from newly created folder permissions.

I would like to do all of this via script. Let me know if you need more info.

VBScript (.VBS file) with ADSI can do it: http://www.microsoft.com/windows2000/techinfo/howitworks/activedirectory/adsilinks.asp

You could also make a vbscript that gathers the info you need, creates the folder and share and then use CACLS.EXE (http://support.microsoft.com/default.aspx?scid=kb;en-us;135268) to modify stuff..

You can find samples out there, now that you know to look for cacls.exe, ADSI or "vbscript change acl"..

You could do the whole thing is a DOS .BAT file, but it would probably be easier to VBScript it and use and use WshShell (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsobjwshshell.asp) to call the DOS / command line ACL setting program.. Whichever that may be,.,

Hope it helps you get an idea of what you could use..
 
Back
Top