Thanks
Alain,
Following is the mof code compiled to get a mail on
software installation.
#pragma namespace ("\\\\.\\root\\subscription")
// for Windows 2000 use #pragma namespace ("\\\\.\\root\\cimv2")
// for Windows 2000 use #pragma namespace ("\\\\.\\root\\cimv2")
instance of __EventFilter as
$FILTER
{
Name = "SoftwareInstallationFilter";
// Windows Server 2003 and Windows XP only
EventNamespace = "\\\\.\\root\\cimv2";
{
Name = "SoftwareInstallationFilter";
// Windows Server 2003 and Windows XP only
EventNamespace = "\\\\.\\root\\cimv2";
Query = "Select *
>From __InstanceCreationEvent Within 10
"
"WHERE TargetInstance ISA \"Win32_Product\" ";
QueryLanguage = "WQL";
};
"WHERE TargetInstance ISA \"Win32_Product\" ";
QueryLanguage = "WQL";
};
instance of SMTPEventConsumer as $CONSUMER
{
Name = "Software Installation";
ToLine = "someone@domain.com";
SMTPServer = "mailserver";
Subject = "New Software Installation";
Message = "WARNING: New Software %TargetInstance.Caption% is"
" Installed on the machine from where the mail has been sent.";
};
instance of
__FilterToConsumerBinding
{
Consumer = $CONSUMER ;
Filter = $FILTER ;
};
{
Consumer = $CONSUMER ;
Filter = $FILTER ;
};
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alain Lissoir
Sent: Friday, October 07, 2005 8:05 PM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Monitor software installation using WMIIf the application is installed as an MSI package, you can track it. If not, WMI will not help as WMI only surfaces MSI installed applicationsLeverage the Win32_Product WMI class in a WQL query such as:Select * From __InstanceCreationEvent Within 10 Where TargetInstance ISA 'Win32_Product'You can use Sample 6.17 - GenericEventAsyncConsumer.wsf from volume 1 at http://www.lissware.netThe Sample 3.15 to 3.17 - WMIMSI (JScript).wsf, volume 2 at http://www.lissware.net shows how to use that class as well.HTH./Alain
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Pavan Hotha
Sent: Friday, October 07, 2005 7:09 AM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] Monitor software installation using WMIHi,I am trying to write a script to monitor the new software installation on windows XP Prof system. The objective is to receive a email notification from the system once a new software is installed on the system. Is it possible to do this ?Pavan Hotha
This message is confidential and may also be legally privileged. If you are not the intended recipient, please notify [EMAIL PROTECTED] immediately. You should not copy it or use it for any purpose, nor disclose its contents to any other person. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of ADP.
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.