非常簡單,直接上腳本,上圖
$credential = Get-Credential [email protected]
Install-Module MsOnline ; Import-Module MsOnline
Connect-MsolService -credential $credential
$exchSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $credential -Authentication Basic -AllowRedirection
Import-PSSession $exchSession –DisableNameChecking