Directory migration - setting user home directory permission

If you are moving users home directories over different servers and forgot to do the permissions when migrating, the following command can still be used to do the permissions. Lets say you wanted System=Full, User=Full, Admin=Full, and each directory name was the same as username for example: E:\Users\User1; E:\Users\User2; E:\Users\User3 .... for /f "delims=" %a in ('dir /ad /b') do cacls %a /G System:F Domain\%a:F Domain\SecAdmin:F