SCCM – Duplicate Hardware Identifiers

8 Jan

Once upon a time, all computers came with an Ethernet port and the MAC address of that was effectively an identifier for the computer. If you configured SCCM to only deliver a boot image to unknown hardware then everything worked – a new machine would install but trying to PXE once it was installed got you nowhere.

Times change and it’s now extremely common for laptops to come without wired Ethernet (and even without Wi-Fi if you use HP but that’s another story …) To install them we can use USB Ethernet adapters or docking stations but we need a way to tell SCCM to allow reuse of a MAC address. In versions of SCCM prior to 1610 this was done by adding MAC addresses to a REG_MULTI_SZ value under the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Components \SMS_DISCOVERY_DATA_MANAGER . This worked but wasn’t easy to do – you had to make sure you got the format exactly right and you had to be able to edit the registry of a site server.

Since SCCM 1610, this has changed. You can now add MAC addresses through the console (Administration > Overview > Site Configuration > Sites > <Site> > Hierarchy Settings > Client Approval and Conflicting Records.

We want to make it easy for the deskside support engineers to see the list of MAC addresses. In the older version I just ran a script at regular intervals to dump the list from the registry to a web page that they could read. I wanted to do the same with the new system so had to find out where the MAC addresses are stored – the console doesn’t just give an easier interface to the registry key.

I guessed it would be in the SQL database but finding the right table proved difficult. A bit of Googling found https://stackoverflow.com/questions/420741/getting-list-of-tables-and-fields-in-each-in-a-database which told me how to get a list of all the fields in every table in a database. A small edit gave me this query:

SELECT T.name AS Table_Name ,
 C.name AS Column_Name ,
 P.name AS Data_Type ,
 P.max_length AS Size ,
 CAST(P.precision AS VARCHAR) + '/' + CAST(P.scale AS VARCHAR) AS Precision_Scale
FROM sys.objects AS T
 JOIN sys.columns AS C ON T.object_id = C.object_id
 JOIN sys.types AS P ON C.system_type_id = P.system_type_id
WHERE T.type_desc = 'USER_TABLE' and c.name like 'mac%' and c.name<>'machineid'

 

with just 49 rows in the result set it was pretty easy to find the table called “CommonMACAddresses” and a quick check of its contents showed me I’d found the right table.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: