Views:

How to remove automapping of mailbox to Outlook

Task: This guide will go through step by step on how to update the automapping of mailboxes to Outlook. This will be used when a customer requests access to a mailbox but does not want it to be added to their Outlook.

Prerequisites:
Before proceeding, you will need to make sure the access to the mailbox requested is created, and that the user requesting access has approval to the mailbox from management (if the requestee is not management/owner). You will need the Global admin account of the customer to be able to perform the below tasks and will require an updated version of powershell.

Instructions:

Step 1:
Run powershell as administrator


Step 2:
Run the installation of the module by pasting this code into powershell :-
Install-Module -Name ExchangeOnlineManagement



Step 3:
Type in Y when requested :-



Step 4:
Type in A when requested :-



Step 5:
Paste this command in powershell and replace the email with the Global admin email address Connect-ExchangeOnline -UserPrincipalName navin@contoso.com



Step 6:
A window will open to sign into the clients environment, type in the password and it will then navigate you back to the powershell script


Step 7:
Next you will have to remove the permissions currently on the shared mailbox for the user by running the following command and then type A to accept all requests:
Remove-MailboxPermission -Identity <MailboxIdentity> -User <UserIdentity> -AccessRights FullAccess

MailboxIdentity is the name, alias, or email address of the mailbox where the permissions are being removed from.
UserIdentity is the name, alias, or email address of the mailbox user who's losing the permissions on the mailbox.




Step 8:
Next you will have to add the permissions back for the user with automapping set to false using the following command:
Add-MailboxPermission -Identity <MailboxIdentity> -User <UserIdentity> -AccessRights FullAccess -AutoMapping $false



Outcome:
Now you have successful added full permissions to the user for another mailbox without having it map to their Outlook. They can access the mailbox via the Outlook Web app.

Further Reading:
Automapping removal
Connecting to Exchange Online
Setting execution policy

Potential issues:
When connecting to the client environment you may come across this error:

The way to overcome this error is you will need to change the execution policy on your PC. First you will need to run this command and then type in A to accept all requests.