Create setPermissions.bat and paste code below

Change DOMAIN to your domain name.



D:

cd D:\Users\

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

  icacls %%i /inheritance:r

  cacls "%%i" /T /E /G "CREATOR OWNER":F

  cacls "%%i" /T /E /G "SYSTEM":F

  cacls "%%i" /T /E /G "DOMAIN\Domain Admins":F

  cacls "%%i" /T /E /G "DOMAIN\%%i":C

)