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 :

powershell

 


– 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 https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
  • Import-PSSession $Session
  • Connect-MsolService

 


– Disable Force Password Change

Set-MsoluserPassword -UserPrincipalName user@domain.com -ForceChangePassword $False

 


– Disable Password Expiration

Set-MsolUser -UserPrincipalName user@domain.com -PasswordNeverExpires $True

 

– Disable Strong Password Requirement

Set-MsolUser -UserPrincipalName user@domain.com -StrongPasswordRequired $False

 


– Change an account’s main SMTP address.

Set-Mailbox current_smtp_address@domain.com -EmailAddresses SMTP:new_smtp_address@domain.com,current_smtp_address@domain.com

 


– 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_to_share_from@domain.com -User user_to_share_to@domain.com -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 user_to_share_from@domain.com:\Calendar -User user_to_share_to@domain.com -AccessRights Reviewer

 


– Give Send As permission to another user

Add-RecipientPermission -Identity user_to_share_from@domain.com -Trustee user_to_grant_to@domain.com -AccessRights SendAs

 


– Display room calendar parameters

Get-CalendarProcessing -Identity room_name@domain.com | Format-List

 


– Enable room’s schedule conflict warning message

Set-CalendarProcessing -Identity room_name@domain.com -AutomateProcessing AutoAccept

 


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

Set-CalendarProcessing -Identity room_name@domain.com -MaximumDurationInMinutes 60

 


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

Get-MailboxStatistics -Identity user@domain.com | 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