Solved

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

Posted on 2006-11-02
12
568 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.
Suggested Courses

632 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