atfnet Posted May 6, 2011 Posted May 6, 2011 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. 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
Arthur Posted May 6, 2011 Posted May 6, 2011 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 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now