Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|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? –  Belmin Fernandez Apr 12 '11 at 20:05
add comment

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.

share|improve this answer
    
This seems like the way to go! I'll give it a try. –  Belmin Fernandez Apr 12 '11 at 20:09
add comment

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.

share|improve this answer
add comment

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

share|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. –  Belmin Fernandez Apr 12 '11 at 20:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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