Manually Removing an MSX Target Server

4

October 4, 2012 by Mike Hillwig

Part of my server decomission process is to defect that server from its MSX server. Either that step got skipped or I didn’t put it in my instructions. Either is entirely possible. By the time I noticed, the server had already been shut down and the VM dropped. And I had an alert firing that was telling me that this server wasn’t polling. And this makes perfect sense.

Let me say that I hate hacking at system tables. It’s verboten with the master database in my environment unless it goes through a review process. And today, I had a alert firing off with immediate escalation because a server was down.

We learned two lessons here. First, make sure you fully defect your target from its MSX server before shutting it down and dropping the VM. Second, we now know how to do this manually in case it happens again. Target servers live in msdb.dbo.systargetservers. And a simple delete statement made it go away forever.

delete from msdb.dbo.systargetservers where server_id = 22

I fear there will probably be some remnants of that server in downstream tables because there were no constraints nor foreign keys on that table. I’ll have to clean those up next.

  • why not use the ‘sp_delete_targetserver’ stored procedure?

    sp_delete_targetserver [ @server_name = ] ‘server’
    [ , [ @clear_downloadlist = ] clear_downloadlist ]
    [ , [ @post_defection = ] post_defection ]

  • Joel Miller

    I was having the same issue as you about a server that was shut down before defecting. None of the GUI options were working. I read your note and was about to try it but tried the sp_delete_targetserver first. That worked great. If this happens again, I would try that. Thanks for the tip Mike. I was not finding that mentioned anywhere.

  • Mike

    Our MSX started complaining about a missing TSX server that had recently crashed and was rebuilt. I didn’t know or even think that there would be icky remnants of the TSX left on the MSX. Jobs started failing and alerts were going off because the TSX couldn’t be reached. This post helped remedy the issue! (actually, the comment pointing to the stored proc ‘sp_delete_targetserver’ did the trick, but I was close to the point where I was going to delete the record from the system tables myself).

  • Md Rahmat ullah

    Great i was tried for trying to remove target server from MSX, manually but i wasn’t able to ,,,thanks for ur easy step’s …lucky to have u as my manger….all the best