This Script/Process is all about backing up permissions & restoring when required.
This was the requirement from one of the projects, as their backup software was not able to take permissions backup, therefore on restoring, permissions were not getting applied.
Thanks to Powershell & Creator of File System Security PowerShell Module 4.0.1 which has come to our rescue 🙂
Here is the process /scripts that will accomplish this task, Download the zip file from below link & extract it.
First let’s follow the process to backup permissions:
Update the file named : folderstobackup.txt
Now just schedule the batch file from task scheduler as per requirements/frequency needed
you can execute it manually in case manual dump of permissions is required.
Backup will be dumped inside the backup folder & time stamp will be added:
Now lets check how to restore the file permissions or folder permissions or entire permission set till root path.
Go back to the root folder & execute restore.bat, It will prompt you for the information of dump file from which you want to restore the permissions.
Provide the path of folder, file or root path to restore..
It will further ask ,if you want to include subfolders in permission restore(Type Yes or No –> Y & N will not work)
It will wait for 20 secods if you want to cancel the restore otherwise it will go ahead with it.
You can check logs in logs folder & restore file in restore folder which will provide you information about what was restored.
I hope that this process/Script will also assist you when you are in similar situation.