First time you may have to set execution policy, enable remote session and allow unencrypted traffic.
Set the Execution Policy:
Set-ExecutionPolicy RemoteSigned
Enable Remote Session:
Enable-PSRemoting
Allow Unencrypted traffic:
set-item -force WSMan:\localhost\Client\AllowUnencrypted $true
To connect to a remote Exchange Server 2010 using different credentials, you need to create credential variable in order to pass it to Exchange Server.
$credetials = get-credential
Create a session:
(Example)
[PS] WSMan:\localhost\Client>$session = New-PSSession -ConfigurationName` microsoft.exchange -ConnectionUri https://mail.contoso.com/powershell`
-Authentication basic -Credential $credetials
Importing the session:
Import-PSSession $SessionFigure
No comments:
Post a Comment