Re: let user change permission on his home-folder
- From: "billy" <wcasse@xxxxxxxxx>
- Date: 1 Dec 2005 22:10:31 -0800
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)
.
- Prev by Date: Re: Create computer account in specified AD OUs
- Next by Date: Re: Wireless WMI class
- Previous by thread: Find File and authorization, Help Me...
- Next by thread: Re: Wireless WMI class
- Index(es):
Relevant Pages
|