Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change NTFS inheritance flag on files

Status
Not open for further replies.

defective

MIS
Aug 14, 2006
3
US
I need to set the NTFS inheritance flag for all files in a tree but not modify any folders. It is a directory tree on a Windows 2003 Standard server and has about 50K files spread through about 8k folders.

I need to go through this entire structure and set every file to inherit NTFS permissions of its parent but leave each folder’s setting alone. I didn’t see a way to do that with xcacls.vbs. Is there another way to write such a script or some other way to go about it?

Thanks,
a
 
Just so I am clear on this you want all files contained within a folder to inherit the folders permission and you DO NOT want the Folders' permissions to change?

Tried this on a small scale and this might work:

Using a test folder - run a search for *.* - Select all Files (NOT folders) - right click - properties - advanced - Click Inheritence and then if asked Copy the permissions.

Like I said this worked for 5 folders deep and about 40 files that I did the test on. You may find some files that you don't have permission to, for them you will need to retake ownership.

Iain
 
I did try that before. The files are all permissioned differently and when I search for and select a list of files as described; I am asked to permission all files the same in order to get to the point where I could check the box to inherit permissions. I thought that would make all permissions the same. I tried it out and was wrong. What you say works great.

A small problem raised by that approach is that when searching for everything, we will also find files that are contained in zip files (or other archives, presumably). If those are in the list of selected files then I would never get to the security screen. Can I make search stop finding the file inside of the zip?
 
Sorry, I think I am missing something. [hammer][hammer][hammer]

Theres third party tools that can do selective searchs, pop it into google or theres a couple in there.

I'd want to change the inheritence on all files to sort this out including zipz, rars, etc.
 
I would want to change the permissions on the zip file.

Say I took two pictures of my ox (ox1.jpg and ox2.jpg). I then put those pictures inside of an archive file named ox_pics.zip and put that into "my documents".

When I search for all files in "my documents", the resulting list would contain not only ox_pics.zip, but also ox1.jpg and ox2.jpg. If I then select all files found, right-click properties, there will not be a "security" tab in the resulting window. While ox_pics.zip has NTFS attributes associated with it, as far as Widows is concerned ox1.jpg and ox2.jpg do not. The options that would be on the security tab are therefore not consistent across all selected items so you don’t get the tab. I need the tab.

You could get around this by selecting everything but ox1.jpg and ox2.jpg, but I am dealing with so many files that would be difficult. A third party search tool may still be the best answer.

I do not actually have an ox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top