SCCM Client 2007 does not report hardware inventory data

In my case desktop machine was based on HP Compaq pro 6300, Windows 8 x64 as client OS with latest patches and SCCM client 2007 sp2 with latest hotfix http://support.microsoft.com/kb/2750782 for Windows 8 support. SCCM client was not reporting the data from hardware inventory agent. Hardware inventory agent was not able to query data from CCM_SystemDevices, here is a part from inventory agent log:

<![LOG[Collection: Namespace = \\.\root\cimv2\sms; Query = SELECT __CLASS, __PATH, __RELPATH, CompatibleIDs, DeviceID, HardwareIDs, IsPnP, Name FROM CCM_SystemDevices; Timeout = 600 secs.]LOG]!><time="15:47:12.788+-60" date="01-17-2013" component="InventoryAgent" context="" type="1" thread="4232" file="collectiontask.cpp:347">
<![LOG[Failed to add an instance of class CCM_SystemDevices to historical store: 8004100A]LOG]!><time="15:47:12.851+-60" date="01-17-2013" component="InventoryAgent" context="" type="3" thread="4232" file="collectiontask.cpp:452">
<![LOG[Failed to AddReport() for CCM_SystemDevices class to historical store: 8004100A]LOG]!><time="15:47:12.851+-60" date="01-17-2013" component="InventoryAgent" context="" type="3" thread="4232" file="collectiontask.cpp:458">
<![LOG[Collection: (80040900) Failed to update Data Store]LOG]!><time="15:47:12.851+-60" date="01-17-2013" component="InventoryAgent" context="" type="3" thread="4232" file="invcommon.cpp:190">
<![LOG[Raising event:
[SMS_CodePage(437), SMS_LocaleID(1033)]
instance of CLIMSG_HINV_WARNING_QUERYFAILURE
{
 ClientID = "GUID:9A76A26F-6A41-48D8-A094-41B897D61069";
 Data1 = "SELECT __CLASS, __PATH, __RELPATH, CompatibleIDs, DeviceID, HardwareIDs, IsPnP, Name FROM CCM_SystemDevices";
 Data2 = "";
 Data3 = "";
 DateTime = "20130117144712.851000+000";
 InventoryActionID = "{00000000-0000-0000-0000-000000000001}";
 MachineName = "machinename";
 ProcessID = 4876;
 SiteCode = "sitecode";
 ThreadID = 4232;
};
]LOG]!><time="15:47:12.851+-60" date="01-17-2013" component="InventoryAgent" context="" type="1" thread="4232" file="event.cpp:525">
<![LOG[Failed to process instances of CCM_SystemDevices: 80040900]LOG]!><time="15:47:12.851+-60" date="01-17-2013" component="InventoryAgent" context="" type="3" thread="4232" file="collectiontask.cpp:361">
<![LOG[Collection: Cycle failed: 80040900]LOG]!><time="15:47:12.851+-60" date="01-17-2013" component="InventoryAgent" context="" type="3" thread="4232" file="collectiontask.cpp:271">

In order to find out why the query does not successfully finish, I have started wbemtest and connected to \\.\root\cimv2\sms and enumerate classes recursively:


 
 

Find the CCM_SystemDevices from top level classes (double click):
 
 
 
Show Instances:
 
 
 
There was empty row with <no key> which was causing SCCM client Inventory Agent to fail:
 
 
Double click to see the properties, since everything is blank click on Show MOF:
 
 
 

MOF will show unprintable character \n "new line" in the name:

 
From the properties of the USB3.0 extensible Host Controller from device manager there was nothing suspicious:
 
 
I tried to update the driver, but there were no new versions to download. I have also checked Intel to download driver for USB 3.0 eXtensible Host Controller, but there were no new drivers for Windows 8, but there was a version of this driver for Windows 7. So, I have applied the not recommended way and applied Windows 7 drivers. Check http://plugable.com/2012/12/01/windows-8-and-intel-usb-3-0-host-controllers/ .
 
New version of the driver from Windows 7 looks like:
 

 

After installing Windows 7 version of the driver, SCCM 2007 Inventory Agent has successfully finished and reported to SCCM server.
 

How to sign powershell scripts

In order to sign powershell scripts, code signing certificate is needed. Finding code signing certificates from user personal certificate store and storing it to a variable called $signcert can be done using following powershell command:

$signcert = (dir cert:currentuser\my\ -CodeSigningCert)
 
After storing the certificate for signing into $signcert, we can use Set-AuthenticodeSignature to sign the script. I'm running the Set-AuthenticodeSignature with TimeStampServer parameter, that will provide signed script to run even though the signing certificate gets expired. In most cases this scenario will be OK.
There are a lot of TimeStampServer providers, in my example I'll use server from Comodo. So, the signing script cmdlet will look like this :

Set-AuthenticodeSignature .\scripttobesigned.ps1 $signcert -TimestampServer http://timestamp.comodoca.com/authenticode

There is great two part tutorial about signing scripts on:
http://blogs.technet.com/b/heyscriptingguy/archive/2010/06/16/hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-1-of-2.aspx

http://blogs.technet.com/b/heyscriptingguy/archive/2010/06/17/hey-scripting-guy-how-can-i-sign-windows-powershell-scripts-with-an-enterprise-windows-pki-part-2-of-2.aspx

 

Inernal Server Error for SCCM 2007 reports

I was experiencing Internal Server Error HTTP 500 (The website is under maintenance, The website has a programming error) when trying to run Computers with specific product report from SCCM 2007. The reason for this behavior is default IIS buffer for ASP responses limited to 4 MB. To check asp buffer limit use the following command:
cscript.exe adsutil.vbs GET w3svc/aspbufferinglimit

The output from the command looks like this (with default IIS settings):

 
To increase asp buffer size to 12 MB:
cscript.exe adsutil.vbs SET w3svc/aspbufferinglimit 12582912
 
 
 
After modifying IIS asp buffer setting I was able to display the report in my browser.
 
 




How to find COM+ application from process id

In my case Windows Server 2003 R2 SP2 was hosting a lot of in-house made COM+ applications. One of the COM+ applications was utilizing a lot of CPU power and Task Manager will not be of great help since it will show dllhost as process name. But, using Process Explorer will help to find the process id and service (for example I'll show how to find COM+ System Application, but the procedure can be used for any in-house made COM+ applications) :

 

The process id is : {02D4B3F1-FD88-11D1-960D-00805FC79235}. Using PowerShell we can find which COM+ application is running behind this process id :

$coma = New-Object -ComObject COMAdmin.COMAdminCatalog
$comapps = $coma.GetCollection("Applications")
$comapps.Populate()

Now $comapss has all com+ applications, and the output looks like this:

 
 
If your server is hosting a lot of COM+ like it was in my case, searching for particular process id can be done using (for example):
 
$comapps | ? { $_.key -like "*02D4B3F1-FD88-11D1-960D-00805FC79235*"}
 
I hope this procedure will help some else who is desperate to find out which COM+ application is not behaving as should.

Lync 2010 client setup failed

In my case I wanted to reinstall the Lync client 2010 from Windows 7 x86 workstation. After successfully uninstalling the Lync 2010 client from Programs and Feature, I've tried to run LyncSetup.exe again to install the client, but setup was failing with following message:
Files in Use Check Failed.
 
Rebooting the workstation didn't help the setup to continue, but running the lyncsetup.exe /uninstall first and starting the setup LyncSetup.exe again, enable to install the Lync 2010 client successfully.

How to check EMBG (Unique Master Citizen Number) using regex

In this post, I will share my implementation of how to check if some number looks like EMBG or Unique Master Citizen Number. For those of yo...