Jump to content


  • 0
glen8

HELP! Machine deleted from all systems collection but still in database

Question

Hi all,

 

ARGH! SCCM 'could' be so good if it wasn't for the little niggles.

 

There is a machine on our network which won't PXE boot. We had the TS assigned to two collections. 'Unknown computers' and 'Windows XP Deployment'. So long as I can get the machine to PXE boot I'm not bothered. The machine was in the all systems collection so I have deleted it.

 

Then I tried booting the machine up thinking it would be detected as an unknown computer.....nope

 

Then I tried putting the machine name and MAC into a txt file and loading this into the Windows XP Deployment collection.....nope.

 

The reason is that although I have deleted it from the all systems collection it is still being picked up when I go to the queries > all systems. I've just rebooted the server in the hope that syncs everything with the database but after the reboot it's still the same.

 

How to I delete this machine? Grrrrrrr!

 

Thanks!

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Not sure if this is the best way around this problem but I created a SQL task to run this command

 

delete from v_R_System where ResourceID = EnterIDHere

 

Set the time for 1 minute in the future and hey presto the machine has actually gone. Must just be an issue with our server as to why it takes a long time for the database to sync with configmgr

Share this post


Link to post
Share on other sites

  • 0

I would strongly recommend against doing what you did -- modifying the ConfigMgr database directly can have unexpected results.

 

The proper way to delete a resource would be to remove it through the SCCM WMI provider: Here's a PowerShell script that should delete it for you:

 

$SccmResource = @(Get-WmiObject -Class SMS_R_System -Namespace root\sms\site_lab -Filter "Name = 'SCCMCLIENT01'")[0]

$SccmResource.Delete()

 

Replace "lab" with your three-digit site code, and replace "SCCMCLIENT01" with the target client name.

 

Hope this helps.

 

Cheers,

Trevor Sullivan

http://trevorsullivan.net

http://twitter.com/pcgeek86

  • Like 1

Share this post


Link to post
Share on other sites

  • 0

I couldn't say for sure, but I would guess that maybe it's a console bug? Try the PowerShell code next time and see if it disappears.

 

That code I posted only deleted the first resource returned with that name, so if there are multiple resources, you may need to run it repeatedly.

 

Alternatively, try this:

 

Get-WmiObject -Class SMS_R_System -Namespace root\sms\site_lab -Filter "Name = 'SCCMCLIENT01'" | % { $_.Delete() }

 

Hope this helps.

 

Cheers,

Trevor Sullivan

http://trevorsullivan.net

http://twitter.com/pcgeek86

  • Like 1

Share this post


Link to post
Share on other sites

  • 0

I'm looking to do the inverse of the above. I removed a collection and inadvertently removed the devices from the DB. How do I rebuild the DB so said devices repopulate in my "All Systems" collection?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.