September 8, 2016

HOW TO BACKUP AND RESTORE NTFS AND SHARED FOLDER PERMISSIONS



HOW TO BACKUP AND RESTORE NTFS AND SHARED FOLDER PERMISSIONS

To backup & restore NTFS permission you will find many utilities like NTBACKUP,  iCacls, Robocopy and FSMT.
Backup and Restore of Shared Permissions:
Generally, shared folder permissions are stored in registry at the following location.
HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares,
you need to backup and restore this key values using export and import options.
Step 1: Open the registry ( Run | Regedit.exe )
Step 2: Navigate to the following location:
 HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares
Step 3: Right Click on Shares Registry key in the Left pane, from context menu select Export.
Step4: Give the filename as shareperms.reg

When you want to restore the permissions, copy shareperms.reg file and paste to another server where you want to restore and then double click on that file to import.

USING COMMAND LINE UTILITY.
reg export HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares c:\shareperms.reg
If you need to restore, copy and paste the file to C: location, just run:
reg import c:\shareperms.reg

Note: After restore you need to restart the Server service.
net stop lanmanserver
net start lanmanserver

BACKUP AND RESTORE OF NTFS PERMISSIONS

If your are using NTBackup to restore the data, you should select the checkbox to restore permissions as well.
Using icacls command to backup NTFS permissions:
icacls d:\sharedata /save ntfsperms.txt /t /c
The /T switch allows it to get subfolder permissions too. The /C switch allows it to continue even if errors are encountered (although errors will still be displayed).
Use this command to restore them:
icacls d:\ /restore ntfsperms.txt


0 comments:

Post a Comment