Must know Office 365 PowerShell commands

Office365 Logo

Many enterprise migrated to cloud services, especially for email management.  Office 365 is one of them, maybe most popular Exchange online solution.  If you migrated to Office 365, there is a little adminitrative panel which offer you minimal possibility.

Download Microsoft’s PowerShell (Online Services Module) :

Real administrative tasks are on PowerShell side, it’s hard to find commands and how to operate them, so here a list of must know Office 365 PowerShell commands :



– Log onto Microsoft’s Office 365 Exchange servers (should ask you for password twice)

  • Set-ExecutionPolicy unrestricted
  • $LiveCred = Get-Credential
  • $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $LiveCred -Authentication Basic -AllowRedirection
  • Import-PSSession $Session
  • Connect-MsolService


– Disable Force Password Change

Set-MsoluserPassword -UserPrincipalName -ForceChangePassword $False


– Disable Password Expiration

Set-MsolUser -UserPrincipalName -PasswordNeverExpires $True


– Disable Strong Password Requirement

Set-MsolUser -UserPrincipalName -StrongPasswordRequired $False


– Change an account’s main SMTP address.

Set-Mailbox -EmailAddresses,


– Share user’s mailbox to another user. Note that AutoMapping is disabled here, it is important since there are few glitches on Outlook 2007/2010, it’s better to add it manually.

Full Permission

Add-MailboxPermission -Identity -User -AccessRights FullAccess -InheritanceType All -AutoMapping $False

Read Only Permission (replace FullAccess with Reviewer)


– Share user’s specific folder like the calendar (again you can chose between full or read-only permission)

Set-MailboxFolderPermission -Identity\Calendar -User -AccessRights Reviewer


– Give Send As permission to another user

Add-RecipientPermission -Identity -Trustee -AccessRights SendAs


– Display room calendar parameters

Get-CalendarProcessing -Identity | Format-List


– Enable room’s schedule conflict warning message

Set-CalendarProcessing -Identity -AutomateProcessing AutoAccept


– Change room’s maximum schedule duration (in minutes)

Set-CalendarProcessing -Identity -MaximumDurationInMinutes 60


– Get user’s mailbox usage (capacity and total of items)

Get-MailboxStatistics -Identity | ft DisplayName, TotalItemSize, ItemCount



Remember to change red string in each command lines by your own information. Also, if you want more parameters for a specific command, you can always issue the following : Get-Help command

Spread the love...Share on FacebookShare on Google+Pin on PinterestShare on RedditTweet about this on TwitterEmail this to someone