- 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. - Run the following command: PowerShellCopy
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
- 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 isIEConfig
,WinHttpConfig
, orAutoDetect
.Then, add the following parameter and value to the end of the $Session = … command:-SessionOption $ProxyOptions
.For more information, see New-PSSessionOption.
- For Office 365 operated by 21Vianet, use the ConnectionUri value:
- Run the following command: PowerShellCopy
Import-PSSession $Session -DisableNameChecking
Pages: 1 2