Re: Assigning Permissions for a home directory
- From: "jd71" <jdavis71@xxxxxxxxx>
- Date: 16 Oct 2006 08:23:26 -0700
I might be incorrect on this, but try setting ther perms for each user
on a seperate line, with the first using /t /g (replacing ACL), and the
rest using /t /e /g (editing ACL). This is the way I have my script
setup, and none of my new folders are inheriting perms from parent.
Below is an example of a script that I use to create student folders
and then add "administrators" as full and the "student" (acctname) as
full:
'create folder. acctname is student's id.
Set fso = CreateObject("Scripting.FileSystemObject")
FSO.CreateFolder("\\" & homesrvr & "\students$\" & acctname)
'Set perms. acctname is student's id.
Set objWSH = CreateObject("WScript.Shell")
strACLCommand = "cmd /c echo y|cacls \\" & homesrvr & "\students$\" &
acctname & " /t /g administrators:F"
objRTC = objWSH.Run (strACLCommand , 0, True)
strACLCommand = "cmd /c echo y|cacls \\" & homesrvr & "\students$\" &
acctname & " /t /e /g " & acctname & ":F"
objRTC = objWSH.Run (strACLCommand , 0, True)
-Jd
On Oct 16, 10:54 am, "K.J. 44" <Holleran.Ke...@xxxxxxxxx> wrote:
Hi,
I wrote a VBScript logon script to check to see if the user has a home
directory, if not create it, and then check the permissions on it.
Here is a sample of my code:
If objFSO.FolderExists(strFolder) Then
' Assign user permission to home folder.
intRunError = objShell.Run("%COMSPEC% /c Echo Y| cacls " _
& strFolder & " /t /c /g " & strUserName & ":F Administrators:F ", 2,
True)
The permissions work fine but the directory is still inheriting
permissions from the parent folder. This is not good... Is there a
way to prevent that?
Thanks.
.
- References:
- Assigning Permissions for a home directory
- From: K.J. 44
- Assigning Permissions for a home directory
- Prev by Date: Re: Need Help Converting VBA to VBS
- Next by Date: LDAP Authentication
- Previous by thread: Assigning Permissions for a home directory
- Next by thread: Stuck on a Script
- Index(es):
Relevant Pages
|