1. On your local computer, open Windows PowerShell and run the following command.PowerShellCopy$UserCredential = Get-Credential In the Windows PowerShell Credential Request dialog box, type your work or school account and password, and then click OK.
  2. Run the following command:PowerShellCopy$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Notes:
    • For Office 365 operated by 21Vianet, use the ConnectionUri value: https://partner.outlook.cn/PowerShell
    • For Office 365 Germany, use the ConnectionUri value: https://outlook.office.de/powershell-liveid/
    • For Microsoft 365 Government Community Cloud High (GCC High), use the ConnectionUri value: https://outlook.office365.us/powershell-liveid/
    • For Microsoft 365 DoD, use the ConnectionUri value: https://webmail.apps.mil/powershell-liveid
    • If you’re behind a proxy server, run this command first: $ProxyOptions = New-PSSessionOption -ProxyAccessType <Value>, where the ProxyAccessType value is IEConfigWinHttpConfig, or AutoDetect.Then, add the following parameter and value to the end of the $Session = … command: -SessionOption $ProxyOptions.For more information, see New-PSSessionOption.
  3. Run the following command:PowerShellCopyImport-PSSession $Session -DisableNameChecking

By Chuck