Managing your Azure Hybrid Connection with PowerShell
When you have a Azure Hybrid Connection setup the wrong way, you can delete the connection trough the UI but then the Hybrid Connection Manager still knows the connection.
If you for example are moving things around and you would like to keep the connection within the UI you will have to use PowerShell to alter the connections.
All connection strings needed can be found within the Azure Portal
Adding a Connection to the Hybrid Connection Manager
Add-HybridConnection -ConnectionString [ConnectionString]
Get all configured connections
Get-HybridConnection
or with specific properties
Get-HybridConnection | select -Property Uri
Get a specific connection
Get-HybridConnection -Uri [URI]
or
Get-HybridConnection -ConnectionString [ConnectionString]
Remove a specific connection
Remove-HybridConnection -Uri [URI]
or
Remove-HybridConnection -ConnectionString [ConnectionString]
Update connection string
Update-HybridConnection -ConnectionString [ConnectionString]
Hey can you point me to the PowerShell commands for creating the Azure part (as opposed HCM which lives on-premises) of the hybrid connections?
Thanks!
Junaid.
Hi Junaid,
Information on the new service (Azure Relay) can be found here: https://docs.microsoft.com/en-us/azure/service-bus-relay/relay-faq
which PS module do you need to install to manage the on-prem hybrid connection manager
Not sure why the OP didn’t explain this, but it’s in the application folder for the Hybrid Connection Manager UI:
Import-Module “C:\Program Files\Microsoft\HybridConnectionManager X.X\Microsoft.HybridConnectionManager.Commands.dll”
X.X denoting the version number.