How Do I Use Exchange Powershell in Office 365

Written by Allen White on. Posted in Microsoft, Office 365

If like me you are used to doing the majority of your Exchange Administration through powershell then you may find that during your first foray into Office 365 that by default the standard Exchange powerhshell command lets will not work.

This is because the standard powershell is not connected to the Azure / Office 365 backend. We also need to install a different version of powershell. Below I go through the steps to connect to the Office 365 Exchange Powershell.

First download and install the Azure AD Powershell, download the correct version for your OS.

Once downloaded and installed we run the following commands.

Set-ExecutionPolicy Unrestricted
Import-Module MSOnline
$O365Cred = Get-Credential
$O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection
Import-PSSession $O365Session
Connect-MsolService –Credential $O365Cred

You will then be prompted for authentication, use a Global Administrator for 365. Once done you will find that you can then run standard Exchange Powershell commands in Office 365 such as get-mailbox etc.

 
Allen White
Allen is a Consultant for ITPS in the North East of England and holds the following accreditations. MCSA, MCSE, MCTS, MCITP, CCA, CCSP, VCP 4,5 and HP ASE, AIS - Network Infrastructure.

ITPS provides strategic IT consultancy, implementation, data centre provision and unified communications, as well as support services and workspace and disaster recovery. If you require a consultation then please contact me via the contacts section or direct on 07931222991, add me on linkedin. https://uk.linkedin.com/in/allenwhiteconsultant0001

Tags: ,

Leave a comment

Categories

(c) Techieshelp.com. Please be aware, all information is provided freely, any information used is done so at your risk and Techieshelp will not be held responsible for any issue that may occur.
!-- BuySellAds On-Site Shopping Cart -->