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?

link|improve this question

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? – Beaming Mel-Bin Apr 12 '11 at 20:05
feedback

3 Answers

up vote 4 down vote accepted

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.

link|improve this answer
This seems like the way to go! I'll give it a try. – Beaming Mel-Bin Apr 12 '11 at 20:09
feedback

Try this:

SET SOURCEFOLDER=\\server\share\folder
SET DESTFOLDER=C:\folder

REM copy all security ACLs
ROBOCOPY "%SOURCEFOLDER%" "%DESTFOLDER%" /IS /E /COPY:S /NDL /TEE /LOG+:C:\temp\robocopy.log  

/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.

link|improve this answer
feedback

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

link|improve this answer
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. – Beaming Mel-Bin Apr 12 '11 at 20:03
feedback

Your Answer

 
or
required, but never shown

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