This batch file allows you to reset  permissions on re-directed folders. Download and install subinacl and adjust the batch as necessary. Insert relevant domain name on the first line.

 set domain-name=

for /f %%a in (‘cd’) do set currdir=%%a
for /f “tokens=*” %%a in (‘dir /b’) do call :updateit %%a
goto :eof

:updateit
c:subinaclsubinacl.exe /file %currdir%%1 /setowner=”%domain-name%%1″
c:subinaclsubinacl.exe /subdirectories %currdir%%1 /setowner=”%domain-name%%1″
c:subinaclsubinacl.exe /file %currdir%%1 /grant=”%domain-name%%1″=F
c:subinaclsubinacl.exe /subdirectories %currdir%%1 /grant”%domain-name%%1″=F
c:subinaclsubinacl.exe /file %currdir%%1 /grant=”Domain Admins”=F
c:subinaclsubinacl.exe /subdirectories %currdir%%1 /grant=”%domain-name%Domain Admins”=F
goto :eof

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s