Pulvinar tempor cras amet ac turpis tristique tristique ... (read more)close
Pulvinar tempor cras amet ac turpis tristique tristique ... (read more)close

LukeTaylor.org Blog

Making I.T that little bit easier !

Using SETACL to reset user directory folder permissions

by in Windows Blog
  • Font size: Larger Smaller
  • Hits: 6054
  • 0 Comments
  • Subscribe to this entry
  • Print
6054

b2ap3_thumbnail_vbs.png

The following script resets the permissions of a profile or My documents folder to some custom groups and the Folder owner.

Inside the folder where the user accounts folders are stored place SetACL.exe and create a file called Perms.bat

 

Inside perms.bat put the following

 for /D %%i in (*) do ( 

subinacl /file %%i /grant=SERVER\%%i=C "/grant=SERVER\domain admins=f" /grant=SERVER\staff=c /setowner=SERVER\%%i

subinacl /subdirectories %%i\* /grant=SERVER%%i=f "/grant=SERVERdomain admins=f" /grant=SERVER\staff=c /setowner=SERVER\%%i )

The above script sets all files/folders inside the directory with the following permissions

Server\%%i = if the name of the users folder is Ltaylor it adds this to the security

Server\domain admins = add domain admins full control

Server\staff = add staff full control

/setowner/%%i = set the owner

 

 

Rate this blog entry:
0
Tagged in: bat script

Comments

  • No comments made yet. Be the first to submit a comment

Leave your comment

Guest Friday, 15 November 2019