SCOM 2012 Agent Deployment error 80004005

This past summer, I was helping a client get a SCOM deployment going from the ground up. Naturally they wanted to test the agent deployment process on a select set of test machines. Many of which were Windows 2003 machines that had been used by developers, (not that there is anything wrong with that, just saying.)

The agent deployment went smoothly accept on two machines. One of the errors it threw out was:

The MOM Server could not execute WMI Query "Select * from Win32_Environment where NAME=’PROCESSOR_ARCHITECTURE’" on computer server.domain.com

Noticed remediation step one was about the path. Path too long on a developer machine, how could that happen? I did use wbemtest and was unable to get wmi query to work properly so it’s time to look at the path statement.

I copied and pasted the path statement into the PowerShell ISE to get a character count, and it was over 1000 characters long. Pretty sure that is too long. It looked like this box, now a VM, had installed and upgraded every version of SQL from 2000 to 2012, as well as every version of Visual Studio, as well as the tools for each version of SQL, never once cleaning up the path statement. While cleaning this insane path statement from hell, i noticed SCOM 2007 path, and sure enough there was an old SCOM 2007 agent install on this box as well. After cleaning the path statement, I uninstalled SCOM 2007 Agent, and a few minutes later the agent deployment worked with out an issue.