This script is awesome! However, I ran into two issues related to permissions:
-
Windows Search service would automatically restart before the script was done. I just added commands to the Service-Stop and Serivce-Start functions to change the startup type:
Set-Service -StartupType Disabled WSearch
Set-Service -StartupType AutomaticDelayedStart WSearch
-
Permissions for ALL subkeys, which first requires taking ownership for ALL subkeys. I initially missed the checkbox option to "Replace owner on subcontainers and objects". So, I had to change the owner back, then try again. Also, don't forget the checkbox option to "Replace all child object permission entries with inheritable permission entries from this object".
This script is awesome! However, I ran into two issues related to permissions:
Windows Search service would automatically restart before the script was done. I just added commands to the Service-Stop and Serivce-Start functions to change the startup type:
Set-Service -StartupType Disabled WSearchSet-Service -StartupType AutomaticDelayedStart WSearchPermissions for ALL subkeys, which first requires taking ownership for ALL subkeys. I initially missed the checkbox option to "Replace owner on subcontainers and objects". So, I had to change the owner back, then try again. Also, don't forget the checkbox option to "Replace all child object permission entries with inheritable permission entries from this object".