Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Software list that lists what is in Add/Remove programs? 4

Status
Not open for further replies.

merreckB

MIS
Feb 9, 2001
15
0
0
US
How can I create a query that will list the software installed on a server? I know there is the software inventory created by SMS but I want a list which would be like looking at the add/remove programs list. Is there any way to get something like that?
Thanks in advance.
 
Don't know of any way to do this in SMS.

You'll probably need to write a program (VB, Kix, WinBatch) that reads the DisplayName and DisplayVersion values from all the registry entries under:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall

Tom Thaden
thadents@usano.ksc.nasa.gov

 
You can gather the information about what's in the Add/Remove Programs List by using the following in a MOF. Hope this helps!:


#pragma namespace("\\\\.\\root\\cimv2")

instance of __Win32Provider as $InstProv
{
Name = "RegProv" ;
ClsId = "{fe9af5c0-d3b6-11ce-a5b6-00aa00680c3f}" ;
};

instance of __InstanceProviderRegistration
{
Provider = $InstProv;
SupportsPut = TRUE;
SupportsGet = TRUE;
SupportsDelete = FALSE;
SupportsEnumeration = TRUE;
};

instance of __Win32Provider as $PropProv
{
Name = "RegPropProv";
Clsid = "{72967901-68EC-11d0-B729-00AA0062CBB7}";
};

instance of __PropertyProviderRegistration
{
Provider = $PropProv;
SupportsPut = TRUE;
SupportsGet = TRUE;
};
#pragma namespace("\\\\.\\root\\CIMV2")

[dynamic, provider("RegProv"),

ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall")
]

class Quick_Software_Inventory
{
[key]
string SoftwareTitle;


[PropertyContext("DisplayName")] string Name;
[PropertyContext("DisplayVersion")] string Version;
};

#pragma namespace("\\\\.\\root\\cimv2\\sms")
[SMS_Report(TRUE),
SMS_Group_Name("Quick Software Inventory"),
ResID(5900),ResDLL("SMS_RXPL.dll"),
SMS_Class_ID("MICROSOFT|Quick_Software_Inventory|1.0")]
class Quick_Software_Inventory : SMS_Class_Template
{
[SMS_Report(TRUE),key]
string SoftwareTitle;

[SMS_Report(TRUE)]
string Name;

[SMS_Report(TRUE)]
string Version;
};


 
This may sound like a stupid question, but I am very new to SMS, the MOF file Farns mentioned. Is that the SMS_DEF.MOF?
 
The MOF text that Farns mentioned above would be appended to your SMS_Def.MOF to get the inventory.

So...the short answer is yes. There are many pitfalls in appending this to your SMS_Def.MOF, however.

For instance, if you place this text in the wrong place (i.e. middle) of you SMS_Def.MOF, it will not compile correctly on your clients. Be sure to place this text (starting at the pragma statement and ending at the final semicolon) at the END of your SMS_Def.MOF.

After you update the file, here's the overall flow of this MOF file's rollout:

1. Copy this file to the Site Server
2. The Site Server will update the CAPS
3. When the client runs it's CCIM cycle (every 23 hours), it will recognize the new MOF and install it on the local client
4. When the client runs it's next scheduled Hardware Inventory (depends on how you set up your SMS Site), then the client recompiles the new MOF (check the hinv32.log to "watch" this happen). **see below
5. After the client finishes recompiling the new MOF, it runs inventory and sticks it in the "outbox"
6. When connectivity with the SMS server is available (if this is a desktop machine, it should be right away), the inventory is copied to the CAP and eventually the SMS Site Server.

** This is where your new MOF would break if the syntax were incorrect. For testing, you can simulate this event by running this from the cmd line and watching for errors on the output:
MOFCOMP.EXE <Your mof file name>

MOFCOMP.EXE is present on all SMS client machines (duh...that's how the client compiles it!) And optionally, instead of placing this MOF file on your SMS CAP Server, you could manually compile this MOF on each of your clients...haha...DON't DO THIS, it's way too time consuming. Just let the SMS System do the work for you.


As additional information, MOFCOMP.EXE is part of the OS, not SMS. This compiler is what is used to install LOTS of MOFs on your client machines. Check the hard drive of client machines for MOF files, then open them in Notepad. This will give you MANY examples of MOF.

-Joel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top