Wednesday, August 9, 2017

Connect Remote Exchange Server Function

You can use below function to make connection to remote PS in Exchange 2016.
You will need to change following string $server ="" to make it work for you environment.

# Connect Remote PS Exchange 2016 Server, Specify Server to connect.

# Change the server FQDN with server name you desire.
Function Connect_E16 {
        [Parameter( Mandatory=$false)]
        [string]$server =""
        $session = New-PSSession -ConfigurationName Microsoft.Exchange `
        -ConnectionUri http://$srv/PowerShell/ `
        -Authentication Kerberos
         Import-PSSession $session -AllowClobber

write-host $null
Write-host "_Connecting Exchange 2016 Servers"

Oz Casey, Dedeal
Systems Engineer (Blog) (Blog) (Twitter)


Damian Garbus said...

Sometimes is good to use import-pssession with -prefix paramiter. For example when you want to connect to exchange onpremise and exchange online ��

Abdur Rahim said...

Great, Thank you for sharing with us. Very nice article & have great information.

Microsoft Server 2016
Microsoft Server 2016 Support

Abdur Rahim said...

Wow, I really like your post because the information which you given in this blog is really extra ordinary.

Microsoft Server 2016 Migration
Microsoft Server 2016 Support

Host One said...

This Article is Very HelpFul For me You Can Also Visit my Website HostOne is a Pakistan based web hosting company, We Offered You 30% Off Web Hosting in Pakistan providing both providing reliable hosting services since 2011
Best Web Hosting in Pakistan