change ownership using Icacls on windows
I got the same problem on Windows 2008 R2, I was trying to set ownership to Administrators, so after getting the same error, I check the users on the domain, and found out that Administrators is NOT a username or group for the domain, but for the PC/SERVER, so, what I did is instead of
ICACLS name /setowner <computername>\adminuser
simply did
ICACLS name /setowner adminuser
and it worked.
Related videos on Youtube
user1874594
Updated on September 18, 2022Comments
-
user1874594 over 1 year
On a windows 7 enterprise 64 bit OS - I want to change ownership of a folder inherited to all sub-folders using ICACLS
I am logged in as standard user. The folder is owned by an administrator user, and I run the
icacls
as that elevated user's command prompt I am not all very privy with windows but I want to do this as standard user running an elevatedcmd
so this is what I tried and did not workICACLS name /setowner <computername>\adminuser
Before that I used
icacls
to grantF
to adminuser and it succeeded.
What did not succeed is changing owner from the command prompt usingicacls
and the command prompt is from a user who owns the folder. So the folder owner is runningicacls
and making another user the owner. I get this error
setowner No mapping between account names and security IDs was done. Successfully processed 0 files; Failed processing 0 files