Removing duplicate VDA entries in Citrix Director

We run a Citrix Virtual Apps and Desktops 7 stack at work and have had an interesting one where Citrix Director has shown one of our multi-session OS machines has been duplicated. Studio shows just one entry of the machine but Director shows two; one legitimate one and another with the IP showing as n/a

Some research later1 and it seems the only way to resolve this is to do some database digging to remove the duplicate entry. Citrix do have an article2 saying removing the offending machine from the catalog and re-adding it works but it didn’t for me.

Ensure you have backed up/snapped an image of wherever your database is hosted before continuing!

Run the following SQL query to find the duplicate (replace MonitorDB with your monitoring database name and machinename with the machine name of the duplicate)

> Select * From [MonitorDB].[MonitorData].[Machine] WHERE Name Like ‘%machinename%’

This should return both the genuine machine and the duplicate – it should be obvious which is which, in our case the duplicate had an IP address of NULL. Copy the machine ID and use the following query to delete (again, replace MonitorDB and machine ID with yours)

> DELETE FROM [MonitorDB].[MonitorData].[Machine] WHERE ID = ‘Old Machine Id’

I then restarted the Citrix Monitoring service, not sure if this step is absolutely necessary as I didn’t check Director before and after the service restart.