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

Published on May 18, 2020 by Anandan M
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}

Discover more from ComputerCarriage

Subscribe to get the latest posts sent to your email.

Leave a Reply

Discover more from ComputerCarriage

Subscribe now to keep reading and get access to the full archive.

Continue reading