Solved

WMI query that worked in SCCM 2007 doesnt work in SCCM 2012

Posted on 2015-01-19
3
762 Views
Last Modified: 2015-02-13
Hi,

 We use a lot of task sequences in order to install complex applications through our sccm environment.
 We are right now in the process to migrate from SCCM 2007 to SCCM 2012 and have discovered an issue with certain wmi-queries that worked fine in SCCM 2007 but now generate an error in SCCM 2012.
 Task sequences has been migrated with the migration tool in SCCM 2012 and we have doublechecked that the wmi-queries are identical between 2007 and 2012.

 Troubleshooting further running wbemtest to run the WMI-Queries, gives an error when running on a  CM 2012 client (W7 Ent x64 SP1) but works as expected on a CM 2007 client (W7 Ent x64 SP1).

 Have run the Query with local-admin rights on both clients.
 The wmi-query looks like this:

Select * From SMS_InstalledSoftware Where ProductCode = '{AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE}'

Namespace: root\cimv2\sms

 Running wbemtest on cm2012 client returns an error :
Number: 0x80041017
 Facility: WMI
 Description: Invalid query

The query is used to choose an alternative installation behaviour if some certain application is found to be installed.
 We know that there are optional wmi-queries to use that will work in CM 2012, but in this case we would prefer to leave all migrated task sequences untouched if possible.

 Could there be some central configuration missing, access rights etc that could explain why the wmi-query doesnt run on a CM 2012 client?

 Would be grateful for any advice where to look next to find a smooth solution.
0
Comment
Question by:cowiekspert
3 Comments
 
LVL 82

Accepted Solution

by:
oBdA earned 500 total points
Comment Utility
According to the official Microsoft documentation (see links below), the ProductCode property should be there both in SCCM 2007 and 2012.
In reality, it seems like this property went AWOL in SCCM 2012; might be intentional (and forgotten in the documentation), or one of the many bugs in SCCM.
I can confirm for SCCM 2012 (don't have 2007 at hand) that this property is missing, so I'm afraid you'll have to change your query:
PS C:\> Get-WmiObject -Namespace "root\cimv2\sms" -Class "SMS_InstalledSoftware" | Get-Member


   TypeName: System.Management.ManagementObject#root\cimv2\sms\SMS_InstalledSoftware

Name                       MemberType    Definition
----                       ----------    ----------
PSComputerName             AliasProperty PSComputerName = __SERVER
ARPDisplayName             Property      string ARPDisplayName {get;set;}
ChannelCode                Property      string ChannelCode {get;set;}
ChannelID                  Property      string ChannelID {get;set;}
CM_DSLID                   Property      string CM_DSLID {get;set;}
EvidenceSource             Property      string EvidenceSource {get;set;}
InstallDate                Property      string InstallDate {get;set;}
InstallDirectoryValidation Property      uint32 InstallDirectoryValidation {get;set;}
InstalledLocation          Property      string InstalledLocation {get;set;}
InstallSource              Property      string InstallSource {get;set;}
InstallType                Property      uint32 InstallType {get;set;}
Language                   Property      uint32 Language {get;set;}
LocalPackage               Property      string LocalPackage {get;set;}
MPC                        Property      string MPC {get;set;}
OsComponent                Property      uint32 OsComponent {get;set;}
PackageCode                Property      string PackageCode {get;set;}
ProductID                  Property      string ProductID {get;set;}
ProductName                Property      string ProductName {get;set;}
ProductVersion             Property      string ProductVersion {get;set;}
Publisher                  Property      string Publisher {get;set;}
RegisteredUser             Property      string RegisteredUser {get;set;}
ServicePack                Property      string ServicePack {get;set;}
SoftwareCode               Property      string SoftwareCode {get;set;}
SoftwarePropertiesHash     Property      string SoftwarePropertiesHash {get;set;}
SoftwarePropertiesHashEx   Property      string SoftwarePropertiesHashEx {get;set;}
UninstallString            Property      string UninstallString {get;set;}
UpgradeCode                Property      string UpgradeCode {get;set;}
VersionMajor               Property      uint32 VersionMajor {get;set;}
VersionMinor               Property      uint32 VersionMinor {get;set;}
__CLASS                    Property      string __CLASS {get;set;}
__DERIVATION               Property      string[] __DERIVATION {get;set;}
__DYNASTY                  Property      string __DYNASTY {get;set;}
__GENUS                    Property      int __GENUS {get;set;}
__NAMESPACE                Property      string __NAMESPACE {get;set;}
__PATH                     Property      string __PATH {get;set;}
__PROPERTY_COUNT           Property      int __PROPERTY_COUNT {get;set;}
__RELPATH                  Property      string __RELPATH {get;set;}
__SERVER                   Property      string __SERVER {get;set;}
__SUPERCLASS               Property      string __SUPERCLASS {get;set;}
ConvertFromDateTime        ScriptMethod  System.Object ConvertFromDateTime();
ConvertToDateTime          ScriptMethod  System.Object ConvertToDateTime();

Open in new window


SMS_InstalledSoftware Client WMI Class
Applies To: System Center Configuration Manager 2007, System Center Configuration Manager 2007 R2, System Center Configuration Manager 2007 R3, System Center Configuration Manager 2007 SP1, System Center Configuration Manager 2007 SP2
http://msdn.microsoft.com/en-us/library/cc144824.aspx

SMS_InstalledSoftware Client WMI Class
Applies To: System Center 2012 Configuration Manager, System Center 2012 Configuration Manager SP1, System Center 2012 R2 Configuration Manager
http://msdn.microsoft.com/en-us/library/jj874298.aspx
0
 
LVL 23

Expert Comment

by:Nagendra Pratap Singh
Comment Utility
It appears that using SoftwareCode  may work. I have not  tried it but I found a link which says so.

Select * From SMS_InstalledSoftware Where SoftwareCode  = '{XXXXXXXXXXXXXXXXXXXXXXXXXX}'

http://www.windows-noob.com/forums/index.php?/topic/7573-software-task-sequence-wmi-query-for-installed-software/
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I have put this article together as i needed to get all the information that might be available already into one general document that could be referenced once without searching the Internet for the different pieces. I have had a few issues where…
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now