Recently, Microsoft updated the container image they use for the Azure PowerShell Cloud Shell to include the ability to manage Office 365. In this quick guide, I am going to show you how to connect to Office 365 from the Azure Cloud Shell and show you a How to confirm you are connected. So lets get to it.
The Cloud Shell
Open the Azure Cloud Shell by either clicking the button in the Azure Portal or going to https://shell.azure.com/powershell and select your subscription directory. If you are going from the Portal make sure you are in the PowerShell shell.
Now, you might think you can just start using commands like get-mailbox, but you cant. You will need to connect up to office 365 first. To do this type the following
1 |
Connect-EXOPSSession |
After some time, it needs to download some files you will then be connected. You can ignore the warning.
Lets test!
So we can get a list of mailboxes by typing:
1 |
Get-Mailbox * |
Awesome we are connected.
So now you can use all of the Exchange Online PowerShell commands via the Azure Cloud Shell. You can find all of the commands at https://docs.microsoft.com/en-us/powershell/module/exchange/?view=exchange-ps
One thing to note, is that you are unable to use the MSOnline commands. Hopefully this will come soon.
I hope you found this quick how to helpful. If you have any questions please reach out.
0 Comments