+ Post New Thread
Results 1 to 3 of 3
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 ...
  1. #1

    Join Date
    Feb 2007
    Posts
    73
    Thank Post
    3
    Thanked 4 Times in 2 Posts
    Rep Power
    16

    Taking ownership without removing existing user rights

    Hi All,

    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.

    Code:
    takeown /f %1 /r /d y
    icacls %1 /grant "domain\Domain Admins:F" /t > "C:\Logs\icacls.txt"
    Is there a way to preserve all existing user rights while taking ownership and adding full access to a certain group?

    Thanks
    Andy

  2. #2


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,918
    Thank Post
    226
    Thanked 2,676 Times in 1,973 Posts
    Rep Power
    787
    If you don't mind using SetACL, you could try this...

    Code:
    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

  3. Thanks to Arthur from:

    atfnet (6th May 2011)

  4. #3

    Join Date
    Feb 2007
    Posts
    73
    Thank Post
    3
    Thanked 4 Times in 2 Posts
    Rep Power
    16
    You Star :-)

SHARE:
+ Post New Thread

Similar Threads

  1. User file ownership
    By Fantom in forum Learning Network Manager
    Replies: 6
    Last Post: 26th April 2011, 04:36 PM
  2. Staff taking ownership of laptops
    By sonofsanta in forum Licensing Questions
    Replies: 17
    Last Post: 15th February 2011, 08:47 AM
  3. [SIMS] Taking ownership of reports [Solved]
    By WithoutMotive in forum MIS Systems
    Replies: 17
    Last Post: 1st December 2010, 12:48 PM
  4. Ownership of user folders
    By Bugs in forum Windows Server 2000/2003
    Replies: 10
    Last Post: 4th February 2009, 02:06 PM
  5. User drive permissions and ownership
    By OutLawTorn in forum Scripts
    Replies: 0
    Last Post: 30th November 2007, 12:15 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •