Copy NTFS permissions from 1 folder to another

I have a folder that holds each of my user's data (%usernam%). I want to copy thos NTFS permissions as well as ownership of folders to another folder that has the same users but different data. Here is the example:

Folder A\%username%
copy all NTFS permissions including folder ownership to:
Folder B\%username%

What is the best way to go about doing this?
lenivanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hlarseCommented:
Robocopy has this ability, to preserve NTFS permissions when copying.

http://en.wikipedia.org/wiki/Robocopy
It's part of the resource kit http://www.microsoft.com/Downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en

Something like this:
robocopy source destination /COPYALL
0
lenivanAuthor Commented:
To be clear...

I DO NOT want the copy the folder or its contents. I only want to copy the permissions. Will robocopy still work?
0
Madison PerkinsConsultantCommented:
get the server 2003 resource kit and use xcopy.exe in conjunction with permcopy.exe.  use xcopy /? and permcopy /? to get the proper command line switches.  with these two tools you can do excactly what you want.
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

Madison PerkinsConsultantCommented:
hmmm.  just read your reply.  so you want to read the ntfs permissions from one folder and apply those ntfs permissions to another folder that already exists.  I know how to apply specific ntfs permissions to a folder with a script but not sure about reading them.  
0
Madison PerkinsConsultantCommented:
it may take a little time to get running but this might work.  
http://support.microsoft.com/default.aspx/kb/825751
0
Madison PerkinsConsultantCommented:
here is a GUI for xcalcs.vbs script.  I am testing your senario right now.

http://www.sh-soft.com/front_content.php?idcat=19&lang=1&client=1
0
hlarseCommented:
I don't believe robocopy will do what you want.  Sorry about the confusion.
0
Madison PerkinsConsultantCommented:
xcalcs will read and display the ntfs permissions of a folder.  you can then use xcalcs to edit/grant/deny/replace the permissions as well as ownership of files and/or folders contained within another folder.  I was able to do what you are looking for from the command line with xcalcs.vbs.  the gui worked for everything but the ownership portion.  

I was not able to find something that will look at one folder, read the rights then apply it to another folder.  it is possible and there may be an app out there that will but i was unable to find it.  
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lenivanAuthor Commented:
madperk, so I am unable to copy ownership info from 1 folder and apply it to another?
0
ziad270Commented:
Setacl (sourceforge project)  is able to do that.
http://setacl.sourceforge.net/html/examples.html

I just tested it successfully. From subfolder 1 to another subfolder 2 somewhere else

setacl -on "Folder1\Subfolder1" -ot file -actn list -lst "f:sddl;w:d,o" -bckp "E:\Listing.txt"

Then edit the listing.txt   "Folder1\Subfolder1" -->   "Folder2\Subfolder2"

and :

setacl -on "folder2\Subfolder2" -ot file -actn restore -bckp "E:\Listing.txt"

Your done...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.