0

Using Windows 2008R2. I have an ad account "fileadm" which have some permissions of many folders and files and for some it's a owner. I need to replace this account with another account (with the same permission) and change owner. I found the command iacls, and it's perfect to add or remove the permission of account, but I didn't find how find and replace the old account by the new account with the same permission and change owner.

I tested this command just to add a permission and it's ok :

icacls "D:\test12" /grant "domain\newadmfile":(OI)(CI)F /T

1 Answers1

0

You can use takeown for this on an elevated cmd prompt.

duenni
  • 2,959
  • 1
  • 23
  • 38
  • I think that takeown is the same as iacls but how do to find specific owner and replace it automatically by another account when the script find this specific owner ? – puffydee Jun 02 '17 at 09:21
  • 1
    No it's not the same. If you want to replace the owner automatically for a given share or whatever you should write a script, your best bet would be PowerShell in this case. – duenni Jun 02 '17 at 09:27
  • Also: if the "new" account is also an AD account and has the same permissions, what's the purpose of this exercise? Couldn't you just simply rename the `fileadm` account? ;) – duenni Jun 02 '17 at 09:34
  • The purpose is to replace old account by new account which have inherit of the same permission of security of the file or/and folder. – puffydee Jun 02 '17 at 09:46