Re: Assigning Permissions for a home directory

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.

.



Relevant Pages

  • Re: Deny User permissions upon moving files within shared folder
    ... set permissions on the shared folder in question so the targeted users ... users who should have more elevated permissions (to modify). ... permissions group (likely Modify perms). ...
    (microsoft.public.backoffice.smallbiz2000)
  • Re: Redirected Folders wont allow offline folders (article 288991
    ... The 9 sites are single server sites ... This folder subfolders and files ... and the Home folder security settings, share permissions, and GPO's for ... permissions to Allow: ...
    (microsoft.public.windows.server.general)
  • Re: Shared folder file permissions
    ... Mike, if you shared folder is on an NTFS volume, you should leave the ... default Share permissions of Everyone - Full Control and use only the ... The Share perms are only there to allow some control over ...
    (microsoft.public.win2000.security)
  • Re: NTFS Permissions
    ... > I want to be able to secure my network file shares through NTFS permissions so that users cannot accidently delete subfolders or the root foler of their file share but have come across an interesting problem. ... > Then I have a test group called test1 with a bunch of users in the test group and I apply this group to have modify permissions on the test folder. ... Grant the users Read, Write, and Execute perms on the given folder, ...
    (microsoft.public.windows.server.general)
  • Re: Document not saved
    ... I used the permissions settings to remove the inherited ... permissions to the folder, using the option to copy them from above to ... preserve the perms. ...
    (microsoft.public.windows.vista.general)