I have a vbscript that adds user accounts in bulk. However I need to modify home directory permissions from within the script. I can do it when xcacls has a real user name in the command line. My query is can xcacls execute a VB variable?
The following is part of my script:
'Create user's home folder
objUser.GetInfo
strHomePath = "\\Server01\home\"
Set objFolder = objFSO.CreateFolder(strHomePath _
& StrUserID)
'home folder permissions
dim wsh
set wsh = Wscript.createobject("Wscript.Shell"
cmdline = "xcacls d:\userdata\home\Don_Jones /P administrators:F /Y"
Return = wsh.run(cmdline,0,true)
cmdline = "xcacls d:\userdata\home\Don_Jones /E /G Don_Jones:F /Y"
Return = wsh.run(cmdline,0,true)
This works OK with the actual user name Don_Jones. Is there a method to have xcacls execute the variable strUserID instead of the actual user name Don_Jones??
Is xcacls the way to go??
The following is part of my script:
'Create user's home folder
objUser.GetInfo
strHomePath = "\\Server01\home\"
Set objFolder = objFSO.CreateFolder(strHomePath _
& StrUserID)
'home folder permissions
dim wsh
set wsh = Wscript.createobject("Wscript.Shell"
cmdline = "xcacls d:\userdata\home\Don_Jones /P administrators:F /Y"
Return = wsh.run(cmdline,0,true)
cmdline = "xcacls d:\userdata\home\Don_Jones /E /G Don_Jones:F /Y"
Return = wsh.run(cmdline,0,true)
This works OK with the actual user name Don_Jones. Is there a method to have xcacls execute the variable strUserID instead of the actual user name Don_Jones??
Is xcacls the way to go??