4 Replies Latest reply on Feb 10, 2011 7:58 AM by eobiont

    Programmatically remove machines from EPO

    eobiont

      I am writing a decommisioning script for my environment.  When a machine is decommisioned, I need to remove the machine's account in several location.  AD, Configuration Manager, EPO and some others.

       

      I have figured out ways to send AD and Configuration Manager a delete notification, but deleting a machine from EPO is proving more difficult.  I would like to be able to send a command from a VB Script (or other method) that I can send EPO a message to delete a node.  Is this possible?

       

      Another reason I would like to have this ability is because when a machine is wiped and reloaded to give to a new user, I would like for the machine to get a new record in EPO rather than have the newly installed OS take the same node (and policies) of the previous installation.  I do not always want this behaviour - so I don't want to start making new duplicate named account.  I would rather, when appropriate, dump the old node before the EPO agent is installed in the fresh OS.

       

      If I have a laptop that is encrypted with Endpoint Encryption - for instance, and I format the drive and install a new OS on the machine, when that machine gets the EPO agent installed, it is going to join up to EPO in the same spot as the former installation and will get Encryption installed and the drive starts encrypting within a few minutes.  There are situations where this is advbantageous, but I wolud like to assert a little more control over whether the machine joins to the existing EPO node or makes a new node and deletes the old one.

       

       

      Is there a supported or unsupported way to remove a machine from EPO outside of the console?  My database is SQL 2005 Enterprise.  I imagine there is some behind the scenes stored proceedure responsible for deleting machines that is called from the GUI.

       

      If I drop the node's row from the EPOLeafNode table, is there some cleanup that happens automatically to remove the data bits from the other tables that related to that ParentID?

       

       

      Message was edited by: eobiont on 2/9/11 10:36:00 AM GMT-06:00
        • 1. Re: Programmatically remove machines from EPO
          JoeBidgood

          At the moment there's no neat way of doing this, but it's introduced in ePO 4.6 which is currently in beta. You can automate this kind of stuff via a scripting interface in 4.6 - sounds like exactly what you're after

           

          Regards -

           

          Joe

          1 of 1 people found this helpful
          • 2. Re: Programmatically remove machines from EPO
            cba1547

            Write a vbs script where you update one of the custom field (1-4) e.g. COSTUM1 in the epo database (ADODB.Connection) with a value you like  e.g. "DELETE THIS SYSTEM" or something like that, them go into queries and make a query that select all systems with CUSTOM1 equal "DELETE THIS SYSTEM", then goto Server task and make a new task with actions "run query" and select the query you just make, and sub actions as "DELETE SYSTEM", schedule that to once every day, one a week or whatever you like, and you system will be delete in EPO. If you like a have an example update the customs field in visual basic script.

             

            /CBA

            • 3. Re: Programmatically remove machines from EPO

              If you have ePO synchronising with AD then you can tick the option to remove it if deleted from AD. See the ePO Product Guide for configuration.

               

              For an SQL query to delete you need to get the AutoID of the Node and then do the following. This will remove it from ePO but I can't guarantee this is a clean way of doing it, its just a way I have used before in the past.

               

               

               

              DELETE FROM [dbo].[EPOLeafNode]

               

              WHERE ([AutoID] = @AutoID);

               

              Regards,

               

              Ian

              • 4. Re: Programmatically remove machines from EPO
                eobiont

                Thanks for the good idea.  My only problem here is that I need the machine to disappear right away, not in an hour or two.  When I am reinstalling the OS on a machine in a "hand me down" situation, I need to have the machine delete itself from the database right away so that when the new OS is applied 10 minutes later, the machine will be joined to EPO as if it is new.  And that should only happen sometimes. 

                 

                 

                So really I need to have a way to delete the machine right away.  EPO 4.6's scripting function sounds interesting.