Exchange Online PowerShell

Installing MSOnline is pretty Simple.

Open PowerShell in Elevated Mode and run the command,

Set-ExecutionPolicy -ExecutionPolicy unrestricted 
Install-Modue  -Name MSOnline 
21V

By default, When you run the command

Connect-MsolService  

You will get connected to Global Tenant ( Public Cloud)

What if you have 21Vianet operated Office 365 Azure Active Directory using PowerShell. You can use the below command to connect AzureChinaCloud

Connect-MsolService -AzureEnvironment AzureChinaCloud 

Enter Username(UPN),

21V

Once you have entered the password and the credentials are validated, you will get MSOnline Module loaded.

21V

Once Connected to 21Vianet Azure AD, You can validate by running the command

Get-MsolDomain  
21V

What is AzureEnvironment?

Microsoft Hosts Office 365 Cloud for Global(for Public), US Government, German and China. hence connecting the PowerShell also needs to be done for respective Azure Cloud.

If you want to connect other Azure Cloud Environments, Still you will be able to connect using Single MSOnline PowerShell Module using your respective Cloud Environment. Replace the AzureEnvironment based on your respective Azure Cloud to connect,

AzureChinaCloud

AzureGermanCloud

AzureGlobalCloud

AzureUSGovernment

#AzureAD #MSOnline #Office365

Leave a comment

Your email address will not be published. Required fields are marked *