Copying File/Share Permissions
Last Updated: 04 Nov 2003
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** PLEASE NOTE: Link(s), If Provided, May Be Wrapped ***
There is often a need to copy permissions from one system
to another, whether for duplication/redundancy, or as part
of an upgrade or migration.
The following tools can be used to copy SHARE and/or FILE
level permissions:
CONSOLE
• XCOPY .................. Native Command (File Perms - Win2K and later)
• ROBOCOPY ............... Resource Kit (File Perms)
• SCOPY .................. Resource Kit (File Perms)
• SUBINACL ............... Resource Kit (File Perms/Ownership)
• PERMCOPY ............... Resource Kit (Share Perms)
• FILEACL ................ http://www.gbordier.com/gbtools/fileacl.htm
• SUPERCACLS ............. http://www.trustedsystems.com/scacls.htm
GUI
• Domain Assistant ....... http://www.softwareshelf.com/products/domain.asp
• Hyena .................. http://www.systemtools.com/hyena/
• Secure Copy ............ http://www.smallwonders.com/?c=securecopy/welcome
• Security Explorer ...... http://www.smallwonders.com/
• Setup Explorer ......... http://www.admwin.com/umanu_ae.htm
• Setup Batcher .......... http://www.admwin.com/umanu_ab.htm
WHITEPAPERS & TECH DOCUMENTS
• http://www.sans.org/rr/win/NTFS.php
• http://www.jsiinc.com/SUBA/TIP0000/rh0075.htm
• http://www.winnetmag.com/windowsnt20002003faq/Article/ArticleID/15161/windowsnt20002003faq_15161.html
• http://www.winnetmag.com/windowsnt20002003faq/Article/ArticleID/14760/windowsnt20002003faq_14760.html
• http://support.microsoft.com/?KBID=323275
• http://support.microsoft.com/?KBID=266083
• http://support.microsoft.com/?KBID=125996
• http://support.microsoft.com/?KBID=141589
• http://support.microsoft.com/?KBID=265704
• http://support.microsoft.com/?KBID=160513
• http://support.microsoft.com/?KBID=268546
• http://support.microsoft.com/?KBID=296865
• http://www.windowsitlibrary.com/Content/592/toc.html
SCRIPTING SAMPLES
Here's a script to enumerate the permissions of all the
shares on one server:
*** Requires NT4 or higher PLUS Server ResKit ***
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FOR /F "SKIP=4 TOKENS=1*" %V IN ('RMTSHARE \\myserver') DO RMTSHARE \\myserver\%V
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PERSONAL NOTES
• The version of ROBOCOPY that can duplicate permissions
is v1.95 or higher. This was first found in the NT4
ResKit, Supplemental #4. It is also available in the
Win2K ResKit.
• Also, SCOPY is no longer available in the Win2K ResKit,
as the appropriate functionality was rolled into Win2K
version of XCOPY.
• XCOPY in Win2K and later, will copy permissions with
the /O parameter, but ONLY explicit permsissions. If
the permissions on the source are inherited from higher
up in the tree, they will not be copied over to the
destination (tested with XP/SP1 and 2000/SP3)
• ROBOCOPY does not appear to have this limitation.
• FILEACL is a powerful permissions tool which can be
used to copy the permissions of a directory tree to
a file, so that it can be copied back at a later time.
• Several of the scripts below will duplicate file and
shares from one server to another. Great for replacing
servers.
RELATED SCRIPTS (ALSO IN THIS ARCHIVE)
• http://KB.UltraTech-llc.com/Scripts/?File=AcctInfo.BAT
• http://KB.UltraTech-llc.com/Scripts/?File=CopyShares.BAT
• http://KB.UltraTech-llc.com/Scripts/?File=DupPerms-A.BAT
• http://KB.UltraTech-llc.com/Scripts/?File=DupPerms-B.BAT
• http://KB.UltraTech-llc.com/Scripts/?File=HomeDirs-A.BAT
• http://KB.UltraTech-llc.com/Scripts/?File=HomeDirs-B.BAT
• http://KB.UltraTech-llc.com/Scripts/?File=HomePerms.BAT
• http://KB.UltraTech-llc.com/Scripts/?File=ViewPerms-A.BAT
• http://KB.UltraTech-llc.com/Scripts/?File=ViewPerms-B.BAT
RELATED TOPICS (ALSO IN THIS ARCHIVE)
• http://KB.UltraTech-llc.com/?File=Perms.TXT
• http://KB.UltraTech-llc.com/?File=SetPerms.TXT
• http://KB.UltraTech-llc.com/?File=HomeDirs.TXT
• http://KB.UltraTech-llc.com/?File=NewServer.TXT
• http://KB.UltraTech-llc.com/?File=Toolkit.TXT
• http://KB.UltraTech-llc.com/?File=ResKit.TXT