Backup and restore of permission in windows using icacls

 Windows PowerShell

Copyright (C) 2014 Microsoft Corporation. All rights reserved.


PS C:\Users\Administrator> cd desktop

PS C:\Users\Administrator\desktop> reg export HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares shareperms.reg

The operation completed successfully.

PS C:\Users\Administrator\desktop>

PS C:\Users\Administrator\desktop>

PS C:\Users\Administrator\desktop>

PS C:\Users\Administrator\desktop>

PS C:\Users\Administrator\desktop>

PS C:\Users\Administrator\desktop>

PS C:\Users\Administrator\desktop>

PS C:\Users\Administrator\desktop>

PS C:\Users\Administrator\desktop>

PS C:\Users\Administrator\desktop>

PS C:\Users\Administrator\desktop> icacls c:\data /save ntfsperms.txt /t /c

c:\Documents and Settings\*: Access is denied.

PS C:\Users\Administrator\desktop>

PS C:\Users\Administrator\desktop> icacls c:\test /save ntfsperms.txt /t /c

processed file: c:\test

processed file: c:\test\test2

processed file: c:\test\Test3

processed file: c:\test\Test3\test.txt

Successfully processed 4 files; Failed processing 0 files

PS C:\Users\Administrator\desktop> notepad ntfsperms.txt

PS C:\Users\Administrator\desktop> icacls c:\ /restore ntfsperms.txt

processed file: c:\test

c:\test\test2: The system cannot find the file specified.

Successfully processed 1 files; Failed processing 1 files

PS C:\Users\Administrator\desktop> icacls c:\ /restore ntfsperms.txt

processed file: c:\test

processed file: c:\test\test2

processed file: c:\test\Test3

processed file: c:\test\Test3\test.txt

Successfully processed 4 files; Failed processing 0 files

PS C:\Users\Administrator\desktop> icacls c:\ /restore ntfsperms.txt

processed file: c:\test

processed file: c:\test\test2

processed file: c:\test\Test3

processed file: c:\test\Test3\test.txt

Successfully processed 4 files; Failed processing 0 files

PS C:\Users\Administrator\desktop> icacls c:\ /restore ntfsperms.txt


Comments

Popular

icegate registration with dsc | Unable to execute PKI Component

MFS100 mantra driver installation and RD service

Repair Hikvision IP Camera | Cable color codding