r/PowerShell•
GregJ7

How to add Administrator with Full Control to a file/folder recursively?

What is the simplest and fastest way to add me (or an Administrator) to a file or directory (or one of them recursively) security access list with Full Control? In my mind, I would have to put the current owner into a variable, then take ownership, add myself to the access list, and then reassign the owner back to what it was. But I doubt that would be fast, because it is changing one file/folder at a time through a whole tree (when recursion is desired) which sometimes will be tens of thousands of files.

Posted Oct 17, 2023, 1:42 PM UTC

119
loveforallkids•

Can l ask you something if you don’t mind

1
GregJ7OP•

Did you mean to respond to my post (which is what you did)? Ask away, if so.

1
loveforallkids•

Thanks can l dm if you don’t mind

1