Azure Automation DSC: how to unregister old/misconfigured DSC Nodes from the pull server

azuredsc

Every now and then I am facing a situation where some old DSC Node remains on the registration list in the Azure Automation DSC pull server.

The nodes appear for a brief moment (1-2 seconds) after clicking on the DSC Nodes menu item (or tile) and disappear. I cannot access them otherwise. The number of DSC Nodes also includes those registrations.

enter image description here

enter image description here

The virtual machine on the screenshots does not exist anymore, adding a new one with the same name and in the same Resource Group creates a new registration entry.

How can I remove the old registrations (other than deleting and recreating the Automation Account)?

Best Answer

In PowerShell, locate the DSC Node registration with:

PS C:\> Get-AzureRmAutomationDscNode `
            -ResourceGroupName $resourceGroupName `
            -AutomationAccountName $automationAccountName

Get the Id parameter (GUID) and unregister with:

PS C:\> Unregister-AzureRmAutomationDscNode `
            -ResourceGroupName $resourceGroupName `
            -AutomationAccountName $automationAccountName `
            -Id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Related Topic