Remove orphaned users and groups from legacy public folder ACL in Exchange

ComputerCarriage > Posts > Exchange > Remove orphaned users and groups from legacy public folder ACL in Exchange

When you are doing the public folder migration (legacy to modern) chances are there for migration to get failed if the orphaned users (deleted users ) still being part of public folders

In these scenarios we must remove the orphaned users from the public folders for the successful public folder migration.

To remove the orphaned users from the specific public folder, use the following command,

Get-PublicFolder "\<name of the public folder>" | Get-PublicFolderClientPermission | ?{$_.User.UserType -like “NT User:S-1-*”} | ForEach {Remove-PublicFolderClientPermission -Identity $_.Identity -User $_.User -AccessRights $_.AccessRights -Confirm:$false}

PF

To remove the orphaned users from the specific public folder recurse (all public folders from the root ) use the following command,

Get-PublicFolder "\" -Recurse -ResultSize Unlimited | Get-PublicFolderClientPermission | ?{$_.User.UserType -like “NT User:S-1-*”} | ForEach {Remove-PublicFolderClientPermission -Identity $_.Identity -User $_.User -AccessRights $_.AccessRights -Confirm:$false}

Leave a Reply