How to remove old retired or orphaned agents from DPM 2010


DId you remove/reinstall a Server which had a DPM Agent installed, without removing it from DPM before?

In DPM 2007 you could easily go on uninstall, the uninstall would fail, but it will ask you afterwards if you want

to remove the agent from the database.  In DPM 2010 this behavior changed, the uninstall fails, and no option to remove the the orphaned agents.

This is what you may need to do if you get the following error.

 

o    C:Program FilesMicrosoft DPMDPMbinRemove-ProductionServer.ps1 : DPM was unable to remove the protected computer DPM02 from one of the following groups:

1. Distributed COM users
2. DPMRADmTrustedMachines
3. MSDPMTrustedMachines
At line:1 char:30
+ .Remove-ProductionServer.ps1 <<<<
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Remove-ProductionServer.ps1

Now remove all SIDs from the above groups, since the server was no longer in there by name due to domain removal.  When you reran the command with the FQDN, you may receive the following error:

There is failure while removing production server
C:Program FilesMicrosoft DPMDPMbinRemove-ProductionServer.ps1 : DPM was unable to remove the protected computer DPM02.mydomain.com.
At line:1 char:30
+ .Remove-ProductionServer.ps1 <<<<
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Remove-ProductionServer.ps1

However, after refreshing the console, the agent is now removed.

 

Comments (13)

  1. Anonymous says:

    What about a workgroup added computer that fails. The script above throws an error that the server can not be found in AD.  Well DUH it is not in AD it is in a workgroup. MS documentation has really been coming up short in the past few years. Especially when forcing users to use scripting and power shell to do mundane tasks that should be no-brainers.

  2. Anonymous says:

    There is another way. Probably simpler too.

    1. Create a 'bogus'  entry for the orphaned agent on the DPM server's hosts file. Point it to something not reachable like 1.1.1.1. Flush your DNS cache and ping the host name to ensure it works.

    2. On the DPM console, uninstall the agent  as you normally would and wait for the process to timeout.

    3. On the pop-up message with ID 290 'Remove the agent from the DPM databases?', click on YES.

    4. After a while the console will refresh and the orphaned agent will be removed.

    5. Remove the static hosts file entry and flush your DNS cache again.

    6. Repeat for each orphaned agent in the console.

    By the way, this works even if the server still present on the network but the agent was manually uninstalled or, like my case, I was rebuilding a server from scratch after a complete failure.

    Hope it helps somebody,

    Fred Larracuente

  3. Gaz says:

    again, this is completely ridiculous.

    why cant you just add an option in the GUI!

  4. Chad says:

    Yeah i have to agree on this one .. its a very simple addition to the GUI why can't it just be done right.

  5. Parrotlover77 says:

    It seems ever since everything MS makes is powershell based, the GUI just takes a back seat.  Now, I love the scriptability of PowerShell and the fact that a lot of features can be rolled in quickly, but as the others have said: this sort of crap is ridiculous!!  Also ridiculous: In DPM 2010, I can bulk-dismiss warnings/alerts, but I can't bulk create recovery point.  Why not?  I have to click on each individual failure (which can be numerous if a server was offline).  I've written a script to take care of it, but there's no reason it shouldn't be in the GUI.

  6. Linn says:

    @Fred,

    Thanks. It worked perfectly.

  7. Steve says:

    Nice solution Fred, that works beautifully…

  8. @Fred, says:

    Worked Perfectly, thanks!

  9. Pop says:

    no pop to remove it anyway. Bugger 🙁

  10. Sarbjit says:

    Fred's advice does not work it the agent was from a workgroup or from none trusted domain. The uninstall option does not exist.

  11. alex says:

    Thank you FRED!

  12. TC says:

    have to say – stop whining about having to use the management shell – its only one command and it works spot on – even if the target is a non domain or workgroup machine

  13. arnold says:

    To me it simply seems an DNS issue.
    Delete the old DNS entry.
    Then On the DPM console, uninstall the agent as you normally would and wait for the process to timeout
    On the pop-up message with ID 290 ‘Remove the agent from the DPM databases?’, click on YES.