Powershell to Office 365

$URL = "https://ps.outlook.com/powershell"
$Credentials = Get-Credential -Message "Enter your Office 365 admin credentials"
$EXOSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $URL -Credential $Credentials -Authentication Basic -AllowRedirection -Name "Exchange Online"
Import-PSSession $EXOSession

If got the error, "cannot be loaded because the execution of scripts is disabled on this system"
Set-ExecutionPolicy RemoteSigned

Comments

No comments yet. Why don’t you start the discussion?

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

*