Open PowerShell as Administrator
Run CommandConnect-ExchangeOnline
![](https://kbtechpro.com/wp-content/uploads/2022/07/image-14.png)
Login with an account that has Administrative access to your Office365 tenant.
![](https://kbtechpro.com/wp-content/uploads/2022/07/image-15.png)
Once connected, you may need to press then type the following command to confirm that you are connected to exchange online. Get-PSSession
![](https://kbtechpro.com/wp-content/uploads/2022/07/image-18.png)
Run a command to test it out something like the command below
#This command will get a list of all mailboxes in the tenantGet-Mailbox
![](https://kbtechpro.com/wp-content/uploads/2022/07/image-19-1024x248.png)
Once you are done, you can disconnect from the Session
Run CommandDisconnect-ExchangeOnline -Confirm:$false
![](https://kbtechpro.com/wp-content/uploads/2022/07/image-21.png)