home Exchange Online, Powershell Powershell – Useful commands for Exchange Online

Powershell – Useful commands for Exchange Online

Some useful Powershell commands for Exchange Online

Here is some useful Powershell commands I often use, this page will be updated regularly 

Set an individual user’s password to never expire – PasswordExpiration

This Guide explains how to set a password for an individual user to not expire

Type Connect-AzureAD for logging into Azure AD

Enter your Admin username and Click Next

Enter your Password and Click Next

Vertify your MFA 

You are now connected to Azure AD

Type in Set-AzureADUser -ObjectId <user ID> -PasswordPolicies DisablePasswordExpiration

You are done 🙂

Official Documentation: https://docs.microsoft.com/en-us/microsoft-365/admin/add-users/set-password-to-never-expire?view=o365-worldwide


Change Send and Receive Limits for Exchange Online – Mailboxplan

This Guide explains how to change the standard send and receive limit, from 35MB to the max (150MB)

First connect to Exchange online

To see a current users limit

Use; Get-Mailbox <user ID> | fl mailboxplan,maxsendsize,maxreceivesize

This user can send max 35MB, and receive max 36MB for the moment


To change the default limit to the maximum 150MB

Use Get-MailboxPlan | Set-MailboxPlan -MaxSendSize 150MB -MaxReceiveSize 150MB

Now all future users will automaticlic get the 150MB limit. Keep in mind all current users still have their old mailboxplan.

Our test user still have the old mailboxplan


To change the limit for all current users

Use Get-Mailbox | Set-Mailbox -MaxReceiveSize 150MB -MaxSendSize 150MB

Now our test user got the new mailboxplan to.


Change language of a shared mailbox

From time to time, we have to change the language of a shared mailbox. Here is how to do it

First connect to Exchange online

Run Set-MailboxRegionalConfiguration -Identity <user ID> -LocalizeDefaultFolderName:$true -Language en-US

For full guide go to this post; Change language of a shared mailbox in Exchange Online – W365.DK


Change Mailbox from Shared to Regular/ User mailbox

Use the Set-Mailbox PowerShell command to convert your 365 mailbox from/to a shared mailbox. The below example shows you how to convert a Shared mailbox to a regular mailbox:

To convert from a Regular / User mailbox to a Shared mailbox, use Set-Mailbox <user ID> -Type Shared insted 🙂

To verify the mailbox type status use;

Run Get-Mailbox <user ID> | fl Name,RecipientTypeDetails Name

in this example we have a shared mailbox

To change the mailbox type to regular;

Use: Set-Mailbox <user ID> -Type regular

Let’s verify the conversion;

Now the mailbox is converted to a Regular mailbox


How to find which mailbox is linked to a specific email address

Get-Recipient -Identity <Email Address>

You can also see what type of object the email address is associated with e.g. Usermailbox/ Shared mailbox / distribution group 

Leave a Reply

Your email address will not be published. Required fields are marked *