Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xcacls and VB variable

Status
Not open for further replies.

punta30

Technical User
Dec 18, 2002
8
0
0
AU
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??
 
cmdline = "xcacls d:\userdata\home\" & strUserId & " /P administrators:F /Y"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top