skip to Main Content

Reset Office 365 delegate access with PowerShell

How to reset Office 365 delegate access with PowerShell? You have a user that gets an error every time they open their delegate access in Outlook. You already did remove the delegate permissions, but it still gives them problems. How do you ensure that users edit and set their delegate access without problems? Let’s look at how to reset Office 365 delegate permissions with PowerShell.

Introduction

To check the delegate permissions in Outlook, go to File > Account settings > Delegate Access.

Reset Office 365 delegate access permissions with PowerShell Outlook setting

There you can see which user and access rights are set.

Reset Office 365 delegate access permissions with PowerShell Delegates

If you already tried to remove the delegate access from the calendar, recreate the Outlook profile, and the user still can’t add a delegate or remove a delegate, you have two options:

  1. Download MFCMAPI and remove the delegate access rights
  2. Reset the delegate access rights with PowerShell

MFCMAPI is great if you have an Exchange on-premises mailbox with this problem. That’s because you can’t use the PowerShell command with on-premises mailboxes. But, if you have a mailbox in Office 365/Microsoft 365, it’s excellent to run one PowerShell command and reset the delegate access rights.

An excellent way to understand more about how to add, edit and remove calendar permissions is to read the article Manage calendar permissions in Office 365 with PowerShell.

How to reset delegate permissions

Go through the steps and reset Office 365 calendar delegate access.

1. Connect to Exchange Online PowerShell

The first step is to connect to Exchange Online PowerShell.

PS C:\> Connect-ExchangeOnline

2. Get delegate permissions

Run the Get-MailboxFolderPermission cmdlet to get the calendar permissions.

PS C:\> Get-MailboxFolderPermission -Identity "testexo@exoip.com:\Calendar" | ft -auto

FolderName User           AccessRights       SharingPermissionFlags       
---------- ----           ------------       ----------------------       
Calendar   Default        {AvailabilityOnly}                              
Calendar   Rees, Grace    {Reviewer}                                      
Calendar   Grant, Richard {Editor}           Delegate                     
Calendar   Fraser, Max    {Editor}           Delegate, CanViewPrivateItems

Export the calendar permissions output to CSV file in the C:\temp folder with the name permissions.csv. Create a temp folder if you don’t have one.

PS C:\> Get-MailboxFolderPermission -Identity "testexo@exoip.com:\Calendar" | Select-Object FolderName,User,AccessRights,SharingPermissionFlags | Export-Csv C:temp\permissions.csv -NTI

Now that you have the output and export for backup, let’s reset Office 365 calendar permissions to their default settings.

3. Reset delegate access

Run the Remove-MailboxFolderPermission cmdlet including the -ResetDelegateUserCollection parameter. Press Y and Enter.

Note: The ResetDelageUserCollection switch will clear any corrupted delegate information from the mailbox. The output will show that it’s resetting the DelegateUserCollection.

PS C:\> Remove-MailboxFolderPermission -Identity "testexo@exoip.com:\Calendar" -ResetDelegateUserCollection

Confirm
Are you sure you want to perform this action?
Using ResetDelegateUserCollection changes existing calendar Delegate permissions. You will need to re-assign the Delegate flag to these
recipients using Set-MailboxFolderPermission -SharingPermissionFlags Delegate. It is suggested that this ResetDelegateUserCollection
option is only used when you believe there is corruption that is preventing managing calendar permissions.
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "Y"): Y
WARNING: Resetting DelegateUserCollection...
WARNING: DelegateUserCollection is reset.

4. Verify delegate access reset

Verify that the SharingPermissionFlags column is empty. It means that it successfully reset the delegate user collection.

PS C:\> Get-MailboxFolderPermission -Identity "testexo@exoip.com:\Calendar" | ft -auto

FolderName User           AccessRights       SharingPermissionFlags
---------- ----           ------------       ----------------------
Calendar   Default        {AvailabilityOnly}                       
Calendar   Rees, Grace    {Reviewer}                               
Calendar   Grant, Richard {Editor}                                 
Calendar   Fraser, Max    {Editor}                                 

5. Set delegate access

Tell the user that they can access their Delegate Access in Outlook and add, remove, or edit the permissions. Another way is to set the delegate permissions back to how it was with the Set-MailboxFolderPermission cmdlet.

In our example, we will set delegate permissions back for both the users.

PS C:\> Set-MailboxFolderPermission -Identity "testexo@exoip.com:\Calendar" -User "Grant, Richard" -SharingPermissionFlags Delegate -AccessRights Editor

PS C:\> Set-MailboxFolderPermission -Identity "testexo@exoip.com:\Calendar" -User "Fraser, Max" -SharingPermissionFlags Delegate, CanViewPrivateItems -AccessRights Editor

6. Final delegate access check

The last check confirms that the delegate access is set like it was. Only this time, it’s without any corrupted delegate.

PS C:\> Get-MailboxFolderPermission -Identity "testexo@exoip.com:\Calendar" | ft -auto

FolderName User           AccessRights       SharingPermissionFlags       
---------- ----           ------------       ----------------------       
Calendar   Default        {AvailabilityOnly}                              
Calendar   Rees, Grace    {Reviewer}                                      
Calendar   Grant, Richard {Editor}           Delegate                     
Calendar   Fraser, Max    {Editor}           Delegate, CanViewPrivateItems

Everything looks great!

Keep reading: Configure permissions in Exchange Hybrid »

Conclusion

You learned how to reset Office 365 delegate access with PowerShell. First, connect to Exchange Online and run the Remove-MailboxFolderPermission cmdlet, including the -ResetDelegateUserCollection parameter. After that, add the delegate permissions back or tell the user they can edit the permissions themself.

Did you enjoy this article? You may also like Manage Teams meeting delegate permission. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 0 Comments

Leave a Reply

Your email address will not be published.