Connect to Exchange servers using remote PowerShell

2
166
views

Connect to Exchange servers using remote PowerShell

If you do not have local access to your Exchange server, you can use Exchange remote PowerShell to connect to your Exchange Servers.

To get started open PowerShell on your local computer.

  1. Type the following
 $UserCredential = Get-Credential
A screenshot of a cell phone
Description automatically generated
  1. The create the new PSSession (Change the FQDN to that of your Exchange Server)
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://EX01.ThatLazyAdmin.local/PowerShell/ -Authentication Kerberos -Credential $UserCredential
A screenshot of a cell phone
Description automatically generated
  1. Lastly the new PS Session needs to be imported as follows.
Import-PSSession $Session -DisableNameChecking
A close up of a logo
Description automatically generated
A screenshot of a cell phone
Description automatically generated

How to verify if it worked?

You can run the following cmdlet to get a list of mailboxes.

Get-Mailbox
A picture containing electronics, battery
Description automatically generated

Sharing is caring!

Previous articleHow to use Office 365 Audit Log Search
Next articleHow to create a migration endpoint Exchange Online
About Me ? I Guess i would start by saying i am a family guys and full time SysAdmin and Tech Junky. This Blog is my first attempt to share information about daily issues i come across as a SysAdmin as well as some new deployments i am part of. Topics that i will cover will mostly be about Office 365,Windows,Exchange as well as Active Directory. I hope some of my Blog posts helps someone #LiveLongAndBeLazy #Exchange #Office 365 #ActiveDirectory #Hyper-V
SHARE

2 COMMENTS

  1. I am encountering the error: ” New-PSSession : A positional parameter cannot be found that accepts argument ‘Powershell/’.” At line:1 char:12
    + $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (:) [New-PSSession], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.NewPSSessionCommand

    Granted PS is not my strongest skill. What could it mean?

LEAVE A REPLY

Please enter your comment!
Please enter your name here