Solved

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

Posted on 2006-11-02
12
562 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 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

20 Experts available now in Live!

Get 1:1 Help Now