Solved

Copy folder to new system and retain security permissions on the folders.

Posted on 2006-11-02
12
563 Views
Last Modified: 2008-02-20
How do I copy a folder to a new system and retain the security permissions of the original location in Server 2003.

Thx,
0
Comment
Question by:Linette_Laiminger
  • 5
  • 5
  • 2
12 Comments
 
LVL 22

Accepted Solution

by:
WMIF earned 125 total points
ID: 17862987
xcopy is a built in command line tool that can copy ACL information.  at a command prompt type "xcopy /?" and you will see all the options.

G:\>xcopy /?
Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
                           [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
                           [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z]
                           [/EXCLUDE:file1[+file2][+file3]...]
...
  /O           Copies file ownership and ACL information.
...
0
 
LVL 4

Expert Comment

by:PaulRKrueger
ID: 17863188
I thought a simple copy (not move) did the trick.
0
 
LVL 22

Expert Comment

by:WMIF
ID: 17863239
i just tried setting specific permissions on a file on my local computer, then copying (drag and drop) that file to a server share.  the permissions took the inherited permissions of that server share folder.

using xcopy without any options, i copied the file over to the share and got the same result and dragging it there.  using the /O option, it copied all the existing permissions, but also inherited the server share permissions.
0
 
LVL 38

Expert Comment

by:younghv
ID: 17863469
For safety, 'copy' the folder to another location on the same hard drive, then 'move' the original over to the target drive.

Check permissions.
0
 
LVL 22

Expert Comment

by:WMIF
ID: 17863540
a move doesnt take the permissions with it either...
0
 
LVL 38

Expert Comment

by:younghv
ID: 17863574
WMIF,
Oh really?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 38

Expert Comment

by:younghv
ID: 17863590
Linette,

If you're moving files to the same 'Volume', the 'move' command will keep the same permissions as were assigned prior to the move.

If you're moving to another volume (or Host)m reading this short page from MS, it will tell you all you need to know:
http://support.microsoft.com/kb/310316


Good Luck,
Vic
0
 
LVL 22

Expert Comment

by:WMIF
ID: 17863641
@younghv - the asker is wanting to move to a new machine.  i would consider that a different volume, no?  i also found these lines in the document that you linked to, which is exactly what my suggestion is.

-To preserve permissions when files and folders are copied or moved, use the Xcopy.exe utility with the /O or the /X switch.
The object’s original permissions will be added to inheritable permissions in the new location.
-To add an object's original permissions to inheritable permissions when you copy or move an object, use the Xcopy.exe utility with the –O and –X switches.
0
 
LVL 38

Expert Comment

by:younghv
ID: 17863797
You can modify how Windows Explorer handles permissions when objects are copied or "MOVED TO ANOTHER" NTFS volume. When you copy or move an object to another volume, the object inherits the permissions of its new folder. However, if you want to modify this behavior to preserve the original permissions, modify the registry as follows.

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk. 1. Click Start, click Run, type regedit in the Open box, and then press ENTER.
2. Locate and then click the following registry key:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
 
3. On the Edit menu, click Add Value, and then add the following registry value:
Value name: ForceCopyAclwithFile
Data type: DWORD
Value data: 1
4. Exit Registry Editor.
0
 
LVL 22

Expert Comment

by:WMIF
ID: 17863909
no offense man, but why dance around in the registry when there are tools like xcopy and robocopy to do it?
0
 
LVL 38

Expert Comment

by:younghv
ID: 17865450
None taken - the way I read that piece from MS, it looked as though you had to prep the target box BEFORE you tried the xcopy.
I may be wrong of course - which happens no more than 52 times a day.

Vic
0
 
LVL 4

Expert Comment

by:PaulRKrueger
ID: 17865744
It's been a while since 70-270... thanks for the refresher!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction How to create multiboot configuration with XP\Vista and Windows 7 on it? And most important question - how to do this correctly so not to have any kind of nightmares we get when system gets screwed? First of all one should realize t…
Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now