Tagged: Obsolete

PXE Filter and Obsolete Machines

There is a small problem with the PXE filter and obsolete machines.

Today the PXE-Filter scans the SCCM-database for the machine and doesn’t bother if the machine is obsolete or not… and that might result in problems (The filter adds the obsolete machine to your collection).

Since the PXE-Filter is a VBScript… you can create a small hack…

Around row 150 you will find:

bFound = False
Set oClients = oSMS.ExecQuery(sQuery)
For each oClient in oClients
	bFound = true
	iResourceID = oClient.ResourceID
	PXE.LogTrace "Found existing machine " & oClient.NetbiosName & " with ResourceID = " & iResourceID
	sNetBiosName = oClient.NetbiosName
	Exit For
Next

Change that piece of code to:

bFound = False
Set oClients = oSMS.ExecQuery(sQuery)
For each oClient in oClients
	If oClient.Obsolete = 1 Then
		PXE.LogTrace "Found obsolete machine " & oClient.NetbiosName & ", skipping"
	Else
		bFound = True
		iResourceID = oClient.ResourceID
		PXE.LogTrace "Found existing machine " & oClient.NetbiosName & " with ResourceID = " & iResourceID
		sNetBiosName = oClient.NetbiosName
		Exit For
	End If
Next

That will result In a WDSServer.log (If you turn on tracing)

[4332] 09:49:22: [WDSPXE] [Microsoft.BDD.PXEFilter] Request from 10.26.64.240:67 Len:548
[4332] 09:49:22: [WDSPXE] [Microsoft.BDD.PXEFilter] About to run script
[4332] 09:49:22: [WDSPXE] [Microsoft.BDD.PXEFilter] Processing request from MAC address = 00:1E:0B:34:0F:E7, IP address = 0.0.0.0, UUID = E11832C1-58C0-DC11-BBDA-0B340FE7001E
[4332] 09:49:22: [WDSPXE] [Microsoft.BDD.PXEFilter] Found obsolete machine RIRO003, skipping
[4332] 09:49:22: [WDSPXE] [Microsoft.BDD.PXEFilter] Found existing machine RIRO003 with ResourceID = 112
[4332] 09:49:22: [WDSPXE] [Microsoft.BDD.PXEFilter] Added new membership rule to collection B0100012