We have two machines on the same domain: Machine A (Windows 2003) and Machine B (Windows 2003). Both have a set of files that are identical and have been kept identical by a scheduled process. However, the Machine A is now offline (i.e., not on the network but I still have physical access to the machine) and we realize that the ACL's were not identical.

What would be the most elegant way to copy over the ACL's with Machine A being offline?

  • When you say Machine A is offline, do you mean that it is gone or that it is merely powered down and can be brought back up if needed? – Dave Wise Apr 12 '11 at 19:52
  • Sorry, I meant to say it is not longer on the network. However, I do have access to the actual machine. Just won't be able to connect between machines. Does that make sense? – Belmin Fernandez Apr 12 '11 at 20:05

Assuming that your dataset is identical on both machines, except for the ACL, you could do:

icacls c:\path\to\data\* /save ACLData /T

Copy the "ACLData" file to the destination machine, and then:

icacls c:\path\to\data /restore ACLData

This will replicate the ACLs (and just the ACLs) assuming the data structure is identical, and you have the rights to do so.

  • This seems like the way to go! I'll give it a try. – Belmin Fernandez Apr 12 '11 at 20:09

Try this:

SET SOURCEFOLDER=\\server\share\folder

REM copy all security ACLs

/IS - include "same" files
/E - copy subdirectories, including Empty ones.
/COPY:S - copy NTFS acls
/TEE - output to screen and log file
/NDL - don't include directory name in log
/LOG+: append to log file

You may need to use quotes if the folders have spaces in the names.


If I'm understanding your question correctly xcopy with /o could do this for you.

  • Sorry about my question not being clear enough. I tried to explain what I meant by offline. Now about using xcopy, from technet.microsoft.com/en-us/library/bb491035.aspx, Copies file ownership and discretionary access control list (DACL) information. I'm not sure how that would help. I'd need a way to export it from Machine A and import it to Machine B. – Belmin Fernandez Apr 12 '11 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.