DeleteComputer function when SMBIOSGUID is all Zeros

Dec 10, 2010 at 6:24 PM

We have a bunch of machines that have an SMBIOSGUID/UUID that is all zeros. 

When we execute the DeleteComputer function in order to make the machine "Unknown" again so that the imaging task sequence targeted to Unknown Computers will show up (ie. we're removing the object so that we can treat the machine as a brand-new object and baremetal it), it ends up blowing away all of the machines that have a UUID of all zeros.  Although the function calls for the MAC address and UUID, it appears to be an OR situation when it queries the database and removes the records that are returned based on both of those parameters.

In our situation, I thought it might be more applicable to have it remove an existing object based on MAC address or machine name since we often reuse a given machine name.  Is there any way that we can adjust that function accordingly?

Thanks much,

Dan

Mar 2, 2011 at 12:49 PM
Edited Mar 2, 2011 at 1:04 PM

Using the source code for Johan's web service, I made the following change and it addressed the DeleteComputer problem we've been encountering with the systems that have a UUID of all zeros:

 String strSQL = "SELECT * FROM SMS_R_System WHERE MacAddresses = '" + macAddress + "'";

 

  if ((smbiosGuid != "") && (smbiosGuid != "00000000-0000-0000-0000-000000000000"))

 

  strSQL += " or SMBIOSGUID = '" + smbiosGuid + "'";

I'd like to use the web service on this site because it provides more functionality than Johan's (believe Johan has partnered up and contributed to this web service), but I would need the same logic added to the DeleteComputer function.  Is the full source code available for download so that I could make the adjustment or is that something that could be changed by the creator?

I would also need the same logic in the IsComputerKnown function.

Thanks again,

Dan

 

Coordinator
Mar 11, 2011 at 3:21 PM

well, the quickest solution is probably not suplying the UUID if the computers can be identified by MAC. If no UUID is supplied, it will search for MAC only.

Regards

Maik