The RemoveAllOrpahns PowerShell script fails if ZPA is enabled. Specifying -OverrideZPA parameter also doesn't work.
Problem: To remove orphan objects run the following PowerShell script“.\RemoveAllOrphans.ps1”, but the following error is encountered “Cannot remove users from zone because auto provisioning is enabled” if ZPA is currently running.
Cause: To run script “.\RemoveAllOrphans.ps1” with ZPA enabled / running you have to include “-OverrideZPA” otherwise it will throw the error “Cannot remove users from zone because auto provisioning is enabled”
Workaround: Run script specifying “-OverrideZPA” to get around error, but this doesn't seem to work "Ex. PS C:\Program Files\Centrify\PowerShell\Centrify.DirectControl.PowerShell\Samples>.\RemoveAllOrphans.ps1 -OverrideZPA"
Solution: Add to the “end” of the following lines below “-OverrideZPA” in the RemoveAllOrphans.ps1 script and save changes. (See screenshot example below)
# Delete all the orphan use profile in computer zone