Ask a questionAsk a question
 

Proposed AnswerSCMDM 2008 SP1 - Device removal procedure?

  • Friday, October 23, 2009 12:13 AMRas11m Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    How do i go about to removing a device from the scmdm console? I managed to run removedevice powershell cmdlet it successfully removes the device from the domain and adds it to block list i then run clean up of blocked devices powershell cmdlet but the device still appears in the all devices section. Is there a way of removing them from the console completely? 

    I read on these forums that we might need to update TEE.db? If so how can that be done ?

    Cheers

    Ras

All Replies

  • Friday, October 23, 2009 3:57 AMWayne Phillips.MVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    You've followed the correct procedure. It can take a while for the devices to disappear. From memory... these entries are cleared by a housekeeping task. Sleep on it... check in the morning.

    Cheers Wayne
    Airloom

  • Friday, October 23, 2009 4:29 AMRas11m Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks for that Wayne ,

    It been more than 24hrs since I executed those commands , They still appear to be in there... Is there a way of enforcing this housekeeping task? so i dont have to wait for them to dissapear from the list...

    Cheers

    Ras
  • Friday, October 23, 2009 4:35 AMWayne Phillips.MVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    When all else fails try the "MDM Device Records Synchronization Tool". You'll find it in the "MDM Server Tools"

    Cheers Wayne
    Airloom
  • Friday, October 23, 2009 4:37 AMRas11m Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    yes it tried that too yesterday it finds 2 devices removes them ( remind you it adds them back in to blocked devices ) then i run claen block devices it cleans that container but yet alone they still appear in my All Devices List....

    Cheers

    Ras
  • Friday, October 23, 2009 4:41 AMWayne Phillips.MVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Make sure the devices have been deleted from AD. Run the "MDM Device Records Synchronization Tool" again. Don't run anything else! Leave it overnight.

    Cheers Wayne
    Airloom
  • Friday, October 23, 2009 4:53 AMRas11m Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I just tried that and it picked up on the devices deleted from AD. I will leave it overnight and see if that resolves the problem ....


    So the correct procedure is to run

    RemoveDevice cmdlet
    CleanBlocked Devices cmdlet
    SyncwithAD cmdlet

    and leave overnight ?

    Would that be the procedure for removing a device from MDM console?

    Cheers

    Ras
  • Friday, October 23, 2009 5:03 AMWayne Phillips.MVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    No. Each script does something specific, you can't just chain them together.

    Remove Device - This removes enrolment requests
    Clean Blocked Devices - This removes blocked device to speed up the gateway processing.
    SyncwithAD - This helps synchronise MDM with AD.

    The correct procedure is to leave them in the blocked list. ;-)

    Cheers Wayne
    Airloom

  • Friday, October 23, 2009 8:52 AMRas11m Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    No. Each script does something specific, you can't just chain them together.

    Remove Device - This removes enrolment requests
    Clean Blocked Devices - This removes blocked device to speed up the gateway processing.
    SyncwithAD - This helps synchronise MDM with AD.

    The correct procedure is to leave them in the blocked list. ;-)

    Cheers Wayne
    Airloom

    Thanks for that Wayne,

    Correct me if I am wrong but I was under the impression remove device cmdlet is used for removing the device from the domain....

    Thanks

    Ras
  • Sunday, October 25, 2009 11:50 PMWayne Phillips.MVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Ras,

    The name and purpose of the Powershell scripts are a little confusing, and my explanation didn't help. It should have read "Removes Successful Device Enrollment"! The RemoreDevice.ps1 script is used for :

    Extract from the Readme :

    Microsoft(r) System Center Mobile Device Manager (MDM) Device Enrollment Cleanup Tool can be used when:

    1) A device has been locally wiped and the entry in Active Directory(r) directory service and the MDM databases still exists, or
    2) A device has not connected to the server for a long time, indicating the account is not being used.
    and it :

    blocks the managed device from connecting after the device has been removed successfully from Active Directory and the MDM databases. You can only remove the device record from the Windows Server Update Services (WSUS) database if you installed the Software Distribution console and Administrator Tools on the same computer.
    In my humble opinion, this represents a virtual "Device Wipe". It removes the device from the domain. No argument there! It also adds the device to the block list, which contradicts the explanation. It can't be removed from the MDM database and be blocked at the same time !
    We still have the "Clean Blocked Devices" script, which should remove the device all together... but "Clean Blocked Devices" doesn't remove the device as expected. It removes the blocked status. Back to square one.

    Cheers Wayne
    Airloom
  • Thursday, October 29, 2009 11:59 AMChrisEdg87 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Did anyone get anywhere with this?

    I'm struggling with the same problem.
  • Sunday, November 01, 2009 10:54 PMRas11m Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi there Chris,

    I am still having the same problem , devices still appear to be on All devices list even though they are not listed on the domain etc ... I hope someone will be able to shed some light on this. I think it might be a bug with SCMDM 2008 SP1 ...

    Cheers

    ras
  • Monday, November 02, 2009 9:20 AMJesper Bagh Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    We use a SQL script that cleans records that have changed from status 3 to status 4. We move these records to a new table in the database, so we have documentation and "logging".

    To change to status 4 you have to use the RemoveDevice.PS1 script from the SystemTools (sp1).

    You can then do the smart thing, to have the SQL script monitor the database for changes. That way you do not have to run the SQL script everytime you run removedevice

    So - We now have a clean up mechanism running :-)

    BTW: The RemoveDevice Cleans the device. Sends a wipe, removes from AD, and revokes the certificate from the CA and changes the status from 3 to 4 in the DB

    Kind regards, Jesper Bagh
    • Proposed As Answer byJesper Bagh Monday, November 02, 2009 9:20 AM
    •  
  • Monday, November 02, 2009 2:33 PMjbuszard Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    hi

    we too are also experiencing problems with this where we've removed devices using the removedevice command and then re-used the device name - but then the console show's two records for devices with the same name.

    we too have also used the syncwithAD command also and left it overnight but still doesn't c;lear the problem.

    regards

    Justin
  • Monday, November 02, 2009 11:10 PMWayne Phillips.MVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Jesper,

    Thanks for the "Heads Up". I'm sure there a lots of people in the community who want to clean up their MDM environments. Is there any chance you could post the script to help them out. You could post it on your blog and attach a link here. I am sure you wouldn't mind a bit of extra traffic to your excellent  blog : http://www.jesperitblog.dk ;-)

     

    Cheers Wayne

    Airloom

  • Thursday, November 05, 2009 11:27 AMRas11m Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    We use a SQL script that cleans records that have changed from status 3 to status 4. We move these records to a new table in the database, so we have documentation and "logging".

    To change to status 4 you have to use the RemoveDevice.PS1 script from the SystemTools (sp1).

    You can then do the smart thing, to have the SQL script monitor the database for changes. That way you do not have to run the SQL script everytime you run removedevice

    So - We now have a clean up mechanism running :-)

    BTW: The RemoveDevice Cleans the device. Sends a wipe, removes from AD, and revokes the certificate from the CA and changes the status from 3 to 4 in the DB

    Kind regards, Jesper Bagh

    Hi there Jasper,

    I would really appreciate it if you could share your script with us.

    Cheers

    Ras
  • Monday, November 09, 2009 3:09 PMChrisEdg87 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer

    The way I got around this eventually was to block the device and then leave it over night. For some reason after blocking the device in the MDM console it isn't removed from the list until the next day... This seems crazy to me but I'm sure there is a good reason for it.

    After it has eventually disappeared from the Managed Devices list you can then run the ".\CleanBlockedDevices.ps1 0" command and the device is then completely removed from MDM.

    Hope that helps.

    Chris

  • Tuesday, November 10, 2009 10:32 PMRas11m Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    The way I got around this eventually was to block the device and then leave it over night. For some reason after blocking the device in the MDM console it isn't removed from the list until the next day... This seems crazy to me but I'm sure there is a good reason for it.

    After it has eventually disappeared from the Managed Devices list you can then run the ".\CleanBlockedDevices.ps1 0" command and the device is then completely removed from MDM.

    Hope that helps.

    Chris


    Hi there Chris,

    So you simply block the device or run removedevice script?  I still have no luck.

    so block the device .
    leave over night and the run clean blocked devices script?

    Cheers

    Ras
  • Wednesday, November 11, 2009 11:06 AMChrisEdg87 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi Ras,

    I think the problem is that if you run the clean blocked devices script before leaving it over night it won't work.

    The process is -

    1. Block the Device

    2. Leave over night until the device no longer appears in the Managed Devices List 

    3. Run the Clean Blocked Device Script so the deivce is removed from the blocked devices list.


    This seems to work for me.