Run Windows PowerShell and check your Execution policy settings:
Get-ExecutionPolicyIf the execution policy is set to Restricted please change it to RemoteSigned or Unrestricted:
Set-ExecutionPolicy RemoteSignedProvide the target server administrator credentials:
$LiveCred = Get-CredentialConfigure the connection:
In the case of connecting to Exchange Server 2010, 2013:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://<target-server-address>/powershell/ -Credential $LiveCredIn the case of connecting to Exchange Online (Office 365):
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirectionStart the connection:
Import-PSSession $SessionTo disconnect type in:
Remove-PSSession $Session
No comments:
Post a Comment