I recently was troubleshooting a performance issue for a customer where their LiveConnection was slow when connecting to an On-Premise SSAS Tabular server via the On-Premise Data Gateway.

One of the things that I had to do was to remove an existing On-Premise Data Gateway from a cluster, so that I can then move the Gateway onto another server.

NOTE: Even if you uninstall the On-Premise Data Gateway from a server it will still exist in the Cluster Configuration, so I had to ensure that I had it completely removed.

Whilst I was going through the steps I found that it was a bit of a challenge to complete the steps, so this inspired me to complete this blog post below. I do hope that in the future this could be part of the On-Premise Data Gateway.

I completed all the steps below using PowerShell, and whilst PowerShell might appear to be difficult, if you follow the steps below it should be straight forward (Hopefully my blog instructions are easy enough to follow!)

Running PowerShell Scripts

The first thing that I did was to run the PowerShell scripts where I have already installed the On-Premise Data Gateway. This is because the PowerShell scripts are part of the installation.

I opened PowerShell ISE and run it as Administrator

Importing the module

In PowerShell I then use the code below to navigate to the Data Gateway’s Folder

I then imported the module as shown below.

Logging into the Power BI Service

The next step I had to complete is to log into the Power BI Service, because this then enabled me to get the details which are part of my tenant.

Getting all the Gateway Clusters

Next, I wanted to get a list of all the Gateway Clusters which are within my tenant.

NOTE: In a large organization there might be a lot of Gateway Clusters, so it might be better to export the data into a file if this is the case.

I then ran the following PowerShell script below to show me all the Gateway Clusters.

And this was the output

Getting the Member Gateways inside a Specific Cluster

What I now recommend doing is to first find all the members of a specific Gateway cluster.

This ensures that not only do I have the current Gateway Cluster ID, but also ensures that I am only getting the members of the gateway where I want to remove a member.

As with my example above I put in the following into PowerShell

The output was a list of the members that were part of my gateway as shown below.

I could then see above that I had 2 members in my Gateway Cluster.

The one thing that I did note is that the Primary Instance in the Gateway Cluster has the isAchorGateway = True

I wanted to remove the second member in the Gateway, so I made a note of the gatewayObjectId

Removing Member from Gateway Cluster

I then ran the following code in PowerShell below to remove the member from the Gateway Cluster

Once the above was completed it came back to the PowerShell prompt.

Confirmation that I had removed the member from the Gateway Cluster

The final step I did was to confirm that I had removed the member from the Gateway Cluster.

I re-ran the PowerShell script which shows the members of the Gateway Cluster

And now I got the output where only the Primary member in the instance remained

Conclusion

In the steps above I have shown how to remove a member from an instance of an On-Premise Data Gateway Cluster.

What I did then do with my customer was to move the Gateway Cluster over to a new dedicated Virtual machine, and I did this by installing the On-Premise Data Gateway software on a new server, and then migrated the On-Premise Data Gateway to the new dedicated virtual machine.

I always enjoy getting comments and suggestions from my blog posts, so please feel free to comment to suggest something.