The blog will explain the steps on how to connect to office 365 or Exchange online protection for the management using powershell of your desktop client computer.
Connecting Steps:
-
Open powershell with Run as Administrator on your computer
-
Connect to the Office365 environment
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri “https://ps.outlook.com/powershell/” -Credential $cred -Authentication Basic -AllowRedirection
This will popup authentication windows. Type your login id which is the User principal name and password.
-
You are now authenticated into Office 365. The last step is to connect up to Office 365 by using the following Powershell command:
Import-PSSession $session
- Now your powershell is ready to use and run any command here.
As an example I ran the below command
Get-Mailbox