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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cacls problem

Status
Not open for further replies.

bookouri

IS-IT--Management
Feb 23, 2000
1,464
US
Im working on a script that creates users and their home folders.

oShell.Run ("%COMSPEC% /c Echo Y| cacls " & ParentDir & "\" & objuser.sAMAccountName & " /E /T /C /G " & domain & "\" & objuser.sAMAccountName & ":F")

This cacls command is working and sets the security permissions for the user, but I need to keep the administrators permissions on the folder. I tried stacking users like "/E /T /C /G Administrators:F& domain & "\" & objuser.sAMAccountName & ":F") Ive seen examples done this way, but it just wont work for me. Can anybody point me to the right way to remove existing rights and grand Full rights to administrators and the samaccountname user?

thanks for any help

 
I finally found the right format.

oShell.Run ("%COMSPEC% /c Echo Y| cacls " & ParentDir & "\" & objuser.sAMAccountName & " /T /C /G Administrators:F " & domain & "\" & objuser.sAMAccountName & ":F")

for some reason all the examples I found left out the space after administrators:F so the user was being jammed up against administrators and the line failed..

 
Use WScript.Echo to ensure you are formating your string appropriately.

Maybe...

"/E /T /C /G Administrators:F " & domain & "\" & objuser.sAMAccountName & ":F"

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top