Re: let user change permission on his home-folder



your script presumes that standard "domain users" have full permission
and security rights in \\server01\home$ (must be able to create a
folder and set acl). many domain admins would consider this a mistake,
but all networks are different and you may have a good reason for
having it this way. you use cacls with the /e switch - which edits the
acl instead of replacing it. if this is so then every user in the
domain (including the intended user) will have full access to the
folder and you should not be having any problem. as you are having a
problem, perhaps there is a permission or security issue with your
home$ share. attempt to manually create the folder and set security as
a standard domain user.

if it does work manually, perhaps the script needs a breather between
creating the folder and setting the acl; try adding a half second
sleep. also, cacls will take multiple users with one command; try
combining the last two lines of your sub routine. try this:

Dim WshNetwork, WshShell, objFS, strUser
Const USER_ROOT_UNC = "\\server01\home$"
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set WshShell = Wscript.CreateObject("Wscript.Shell")
Set objFS = CreateObject("Scripting.FileSystemObject")
strUser = WshNetwork.UserName
objFS.CreateFolder(USER_ROOT_UNC & "\" & strUser)
WScript.Sleep 500
WshShell.Run("cacls " & USER_ROOT_UNC & "\" & strUser & _
" /g Administrators:F /g " & strUser & ":F",0,True)

.



Relevant Pages

  • Re: Add or modify ACL on folder after using FSMT
    ... I created a folder User_a on the Windows NT DC with the following security: ... I suggest you check the ACL by Whoami.exe. ... current user's security context) in the command window. ...
    (microsoft.public.windows.server.migration)
  • Re: .LDB file has no security tab
    ... Domain Admins, Full - Allow, This folder & subfolders & files ... Domain Users, Read & Execute? ... Allow, This folder Only ... It has no security tab on it. ...
    (microsoft.public.windows.server.general)
  • Re: Sharing permission overwrite Security Permission
    ... Even I only added a few users (domain users) under ... "Security" and assigned different access rights. ... But everyone in the domain can have full access to the folder. ...
    (microsoft.public.windows.file_system)
  • Re: << Small Bus Server news of the week>>
    ... > will pick up the mail that is in the Incoming Mail folder. ... > A Chinese security group has released sample ... > Cyber law expert Pavan Duggal feels India's ... > A California blood bank has retrieved a stolen ...
    (microsoft.public.backoffice.smallbiz)
  • Re: << Small Bus Server news of the week>>
    ... > will pick up the mail that is in the Incoming Mail folder. ... > A Chinese security group has released sample ... > Cyber law expert Pavan Duggal feels India's ... > A California blood bank has retrieved a stolen ...
    (microsoft.public.backoffice.smallbiz2000)