When you open up the Exchange Management Shell (EMS), it should connect to the closest server. Sometimes you want to have it connect to a specific server to run scripts etc.
If you right click on the Exchange Management Shell in the start menu and open it’s file location you should be presented with the below:
Right click now on Exchange Management Shell above and bring up it’s properties and then click on the “Shortcut” tab as shown below:
In the Target address above, it has a long line which you can see fully below:
- C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command “. ‘C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1’; Connect-ExchangeServer -auto -ClientApplication:ManagementShell”
If you notice, I highlighted -auto above and this is the value you can update with your server name that you want the EMS to connect to, it might be as follows:
- C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command “. ‘C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1’; Connect-ExchangeServer Server1 -ClientApplication:ManagementShell “
Once you have updated the Target, Apply the changes.
The next time you launch the Exchange Management Shell, it should connect to Server1 as updated above.
Hope it helps.