none
Robocopy on Windows Server 2008 SP2 does not copy folder permissions

    Question

  • When using Robocopy to copy folders and files from one local hard disk to another, using /COPYALL /E /TEE options, the target folder does not contain the source folder's ACL. I've tried other options such as: /COPY:DATSOU or /SECFIX, it made no difference.

    Test scenario: Create a folder on C:, Test1. Add to Test1's permissions a local group with Read, e.g. Backup Operators. The ACL list should have permissions inherited from C:\ plus Backup Operators that's not inherited. Use Robocopy to copy Test1 to C:\Test2, check the ACL on Test2. Backup Operators is missing.

    It looks like Robocopy cannot override the target folder's permissions inheritance, the folder  retains the parent folder's ACL.

    I've also disabled User Access Control in troubleshooting this problem.

    To add to this issue, there's a workaround can be used to ensure the target folder's ACL is the same as the source folder's ACL. It's a two step process.

    1) Use XCOPY source_folder target_folder /I /E /X /T  -  This lays down the directory structure including the ACLs

    2) Use ROBOCOPY source_folder target_folder /COPYALL /SECFIX /E  - This will copy over the directories and files, enforcing the files to receive the parent folder's ACL. The target_folder's ACL remain intact, unaltered from XCOPY command.

    The end result: the target_folder ACL is identical to the source_folder ACL, the files copied to the target_folder will inherit ACL from their parent folder. Both source and target folders and files ACLs are identical.

    ROBOCOPY should do both steps, but doesn't. I've tested this scenario on bare-bones Windows Server 2008, physical and virtual machines.

    Darryl Miller

    Saturday, March 20, 2010 2:09 AM

Answers

All replies

  • What type of storage?
    Friday, April 9, 2010 4:44 PM
  • I love this post, it is very easy to read.

     

    I am new to Windows 2008 R2 and it's security model.

     

    I ran the xcopy command but the ACLs were not transferred over.  I am logged in as a Domain User, why am I not considered the all mighty?

    Wednesday, September 29, 2010 5:05 PM
  • To Wendy23,

    Just for clarity, the Windows Server 2008 OS that I ran ROBOCOPY and XCOPY on was the non-R2 version. Microsoft might have fixed this issue in R2.

    You'll probably need to logon as local Administrator or use an account belonging to the local Administrators group.

    Also, open the Command Prompt using "Run as Administrator" (right-click on Command Prompt), then run the XCOPY and ROBOCOPY commands from within this prompt.

    To answer G.Write, the storage is local hard disks.

     

    Wednesday, September 29, 2010 6:01 PM
  • To Wendy23,

    Just for clarity, the Windows Server 2008 OS that I ran ROBOCOPY and XCOPY on was the non-R2 version. Microsoft might have fixed this issue in R2.

    You'll probably need to logon as local Administrator or use an account belonging to the local Administrators group.

    Also, open the Command Prompt using "Run as Administrator" (right-click on Command Prompt), then run the XCOPY and ROBOCOPY commands from within this prompt.

    To answer G.Write, the storage is local hard disks.

     

    Thanks, was a long time ago, I was having a problem with robocopy not copying permissions on a SAN, and was wondering if the SAN was the problem, but your method worked fine for me, thanks.
    Wednesday, September 29, 2010 9:26 PM
  • p.p1 {margin: 0.0px 0.0px 10.0px 0.0px; font: 10.0px Verdana}

    Hi Darryl,

    Ran into this exact same issue on a Windows SBS 2008 R2 machine.

    Your post was very helpful, and you are right that the current version of robocopy included with Windows Server 2008 does not maintain directory permissions (even with R2). All windows updates are applied to the server, so it is not something that has been fixed as of April 15th, 2011.

    In my case I was copying from between two local hard drives. The standard drag and drop copy also does not maintain ACLs, so this is the only way I have been able to find that does without doing a entire volume copy.

    A big thanks!

    Michael

    Saturday, April 16, 2011 4:25 PM
  • Hi

    FYI There is a KB article available which you may be interested in

    http://support.microsoft.com/kb/979808

    Also usage of Robocopy

    http://technet.microsoft.com/en-us/library/cc733145(WS.10).aspx

     

    Thanks

     


    Jay
    Monday, August 1, 2011 3:33 AM
  • Same behavior is observerd on Windows 2008 R2 ( fully patched) . Robocopy version is 5.1.10.1027 ( like in KB979808).

    Using robocopy X010 version resolves issue , but i miss /DCOPY:t switch :)

    Running as Administrator doesnt change anything.

    Wednesday, April 18, 2012 6:54 AM
  • Hi

    FYI There is a KB article available which you may be interested in

    http://support.microsoft.com/kb/979808

    Also usage of Robocopy

    http://technet.microsoft.com/en-us/library/cc733145(WS.10).aspx

     

    Thanks

     


    Jay

    Does that Hotfix still applicable to the Windows Server 2012 R2 Robocopy that is builtin ?


    /* Server Support Specialist */

    Tuesday, July 15, 2014 8:35 AM