Monthly Archives: June 2018

Connect to Exchange powershell remotely

Connect to Exchange powershell remotely using the following commands


$exchSession=New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $exchUri -Authentication Kerberos -Credential $exchCred
Import-PSSession $exchSession

$exchCred is the credentials used to connect

$exchUri is the Uri of the Exchange server powershell virtual directory.  EG:


To remove the session at the end, use Remove-PSSession $exchSession


See the powershell script here




TFS fails to install with “Remove elasticsearch-service-x64”

Attempting to do a TFS upgrade, the install was failing with an error: “The following Windows service is installed on your computer: elasticsearch-service-x64. Remove elasticsearch-service-x64 to continue”

I was required to:

Go to the TFS Search directory and remove the search folder.

Stop the elastic search service, and navigate to the program files folder for elastic search (C:\Program Files\Microsoft Team Foundation Server 15.0\Search\ES\elasticsearch-2.4.1\bin)

Run the command service.bat remove to uninstall the Elastic Search service.