Skip to content

PowerShell··1 min read

Exchange Online

Common Exchange Online admin gets and sets: mailbox permissions, send as, and calendar permissions.

Exchange Online

Common Admin Gets

Get mailbox permissions

Sometimes you just need to know who has access to a mailbox. The below will return the current permissions on the mailbox.

$Identity = username@domain.com
Get-MailboxPermission -identity $Identity

Common Admin Sets

Adding Permission to a mailbox without automapping

In the below example “mailbox@domain.com” - is the UPN of the mailbox that will receive the new permissions. The “usergettingrights@domain.com” is the UPN of the user who will now be able to access the mailbox. The Automapping set to false - will prevent the calendar of the mailbox from mapping to the end user in question.

Add-MailboxPermission -Identity mailbox@domain.com -User usergettingrights@domain.com -AccessRights FullAccess -AutoMapping $false

Adding send as to a mailbox

When granting the full access control to a mailbox. This does NOT include the ability to send mail as the user, or shared mailbox. This permission is a different delegation, called a trustee right. In the below example “mailbox@domain.com” - is the UPN of the mailbox that will receive the new permissions. The “usergettingrights@domain.com” is the UPN of the user who will now be able to send mail as the “mailbox@domain.com” user.

Add-RecipientPermission -Identity mailbox@domain.com -trustee usergettingrights@domain.com -AccessRights SendAs

Add Calendar Permissions

Calendar permissions are dangerous, but you can do those too. It’s important to keep in mind the “send notification to user” option. You should also keep an eye out for changes like this, as they can indicate someone sneaking access to calendar invites.

In the below example the identity param “youownmycalendar@domain.com:\Calendar” indicates the calendar called “calendar” is what permissions are being given to. The user param is who is getting the permissions.

Add-MailboxFolderPermission -identity youownmycalendar@domain.com:\Calendar -User whoownsyourcalendar@domain.com -SendNotificationToUser $false -AccessRights Editor

Comments

Comments are GitHub Discussions, loaded on request.