lenivan
asked on
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?
Folder A\%username%
copy all NTFS permissions including folder ownership to:
Folder B\%username%
What is the best way to go about doing this?
ASKER
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?
I DO NOT want the copy the folder or its contents. I only want to copy the permissions. Will robocopy still work?
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.
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.
it may take a little time to get running but this might work.
http://support.microsoft.com/default.aspx/kb/825751
http://support.microsoft.com/default.aspx/kb/825751
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
http://www.sh-soft.com/front_content.php?idcat=19&lang=1&client=1
I don't believe robocopy will do what you want. Sorry about the confusion.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
madperk, so I am unable to copy ownership info from 1 folder and apply it to another?
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...
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...
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