I want to copy a folder with its permissions but without copying its content. So an example:
C:\pictures and it has cat photos in it
I want to copy only the permission to
D:\pictures (has other pictures)
and I want to copy it to
E:\pictures (this folder is not existing)
I tried it with robocopy and with icacls. But I am not able to restore the data with icacls:
icacls C:\pictures /save ntfspermissions.txt /c
icacls D:\pictures /restore C:\ntfspermissions.txt
and it just says: 1 error.
In robocopy I tried it with the parameter “/COPY:SAO“. But it is not working too. It only works with “/MIR” but if I do that, I have the content copied too.
Use get-acl and set-acl :
More detailed answer by Don Jones : http://technet.microsoft.com/en-us/magazine/2008.02.powershell.aspx