Solved

Robocopy script to copy only NTFS permission of Top/Root directory

Posted on 2014-01-19
6
3,191 Views
Last Modified: 2014-02-18
Hi,

Need Robocopy script to copy only NTFS permission of Top/Root directory, should exclude all Sub directories and Files under Top/Root directory.

The following script doesn't work as expected:

ROBOCOPY C:\RTest\source Y:\RTest\source /ZB /LEV:0 /COPY:SOU /XF *.* /R:10 /W:5 /log+:C:\CopyOnlyNTFSRootDir.txt
0
Comment
Question by:nssasikumar
6 Comments
 
LVL 6

Expert Comment

by:alexgreen312
ID: 39793629
You need your /sec switch in there to copy the security structure I think
0
 
LVL 25

Expert Comment

by:Zephyr ICT
ID: 39793631
If Robocopy doesn't work you could take a look at icacls? http://technet.microsoft.com/en-us/library/cc753525.aspx

You can backup the NTFS rights from one directory and restore them on the new directory...
0
 
LVL 24

Expert Comment

by:lionelmm
ID: 39794194
The command as you have it now (ROBOCOPY C:\RTest\source Y:\RTest\source /ZB /LEV:0 /COPY:SOU /XF *.* /R:10 /W:5 /log+:C:\CopyOnlyNTFSRootDir.txt ) will not copy any files or subdirectories. If you want to copy the NTFS permissions of the source folder to the destination folder it must be set to copy something. Will it work if we let it copy the files in the source and then delete them afterwards?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Accepted Solution

by:
nssasikumar earned 0 total points
ID: 39817186
The Following script worked for me:

ROBOCOPY C:\RTest\source Y:\RTest\source /ZB /E /LEV:0 /COPY:SOU /XF *.* /XD *.* /R:10 /W:5 /log+:C:\CopyOnlyNTFSRootDir.txt
0
 
LVL 24

Expert Comment

by:lionelmm
ID: 39817489
Good thinking
0
 

Author Closing Comment

by:nssasikumar
ID: 39866929
The Script Copies only NTFS Permission for Specified folder e.g Source in our Example. Does not copy any Data, Also the Permission for Sub directories/Files are not copied.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Not many admins are aware that GPOs can be activated and deactivated time-based. Time to change that :)
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 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

17 Experts available now in Live!

Get 1:1 Help Now