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