Scripts Thread, Taking ownership without removing existing user rights in Coding and Web Development; Hi All,
I have a network share with lots of folders and files with ownership set to different users and ...
6th May 2011, 05:49 PM #1
- Rep Power
Taking ownership without removing existing user rights
I have a network share with lots of folders and files with ownership set to different users and explicit denies set against the domain admins group (don`t ask). I need to move the files to a new server, the existing server is a snap server.
I want to run a script to take ownership over every file and modify the existing rights. I have written a batch file (see below). The problem I have is that takeown /d y will strip out the existing rights on some folders.
Is there a way to preserve all existing user rights while taking ownership and adding full access to a certain group?
takeown /f %1 /r /d y
icacls %1 /grant "domain\Domain Admins:F" /t > "C:\Logs\icacls.txt"
IDG Tech News
6th May 2011, 06:10 PM #2
If you don't mind using SetACL, you could try this...
SetACL -on %1 -ot file -actn setowner -ownr "n:Domain\Domain Admins;s:n" -actn ace -ace "n:Domain\Domain Admins;p:full" -log C:\Logs\SetACL.txt
6th May 2011, 06:23 PM #3
- Rep Power
By Fantom in forum Learning Network Manager
Last Post: 26th April 2011, 05:36 PM
By sonofsanta in forum Licensing Questions
Last Post: 15th February 2011, 09:47 AM
By WithoutMotive in forum MIS Systems
Last Post: 1st December 2010, 01:48 PM
By Bugs in forum Windows Server 2000/2003
Last Post: 4th February 2009, 03:06 PM
By OutLawTorn in forum Scripts
Last Post: 30th November 2007, 01:15 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)