With the WMI CMI Studio you can create your SQL String, to get all Event Descriptions from one Application for example.
Because I used the WMI Automation Server only in a Delphi Applications I cannot give you some Navision examples. But I think you must create some Automation Variables of the Type Microsoft WMI Scripting V1.2 Library and the needed Subtypes Locator, Services and Object Set.
Maybe this Code Snippet could be helpful. I queries all events of the given Service.
VAR
aLoc : ISWbemLocator;
aSrv : ISWbemServices;
aObjSet : ISWbemObjectSet;
pEnum : IEnumvarIANT;
aLoc := CoSWbemLocator.Create;
aSrv := aLoc.ConnectServer(cConfig.sWMI_Host,'',
cConfig.sWMI_User,cConfig.GetWMIPassword(),'','',0, nil);
aSrv.Security_.ImpersonationLevel := wbemImpersonationLevelImpersonate;
aObjSet := aSrv.ExecQuery('SELECT EventType, Message,
TimeGenerated, InsertionStrings
FROM Win32_NTLogEvent WHERE
Logfile="Application" AND
SourceName="<Service Name>",
'WQL', wbemFlagReturnImmediately +
wbemFlagForwardOnly, nil);
pEnum := aObjSet.Get__NewEnum as IEnumvarIANT;
The enumeration contains the Response, but I don't know how to handle this in Navision? Be careful that for WMI Querys on localhost any User and Password should be given if you have administrative rights.
Comments
With the WMI CMI Studio you can create your SQL String, to get all Event Descriptions from one Application for example.
Because I used the WMI Automation Server only in a Delphi Applications I cannot give you some Navision examples. But I think you must create some Automation Variables of the Type Microsoft WMI Scripting V1.2 Library and the needed Subtypes Locator, Services and Object Set.
Maybe this Code Snippet could be helpful. I queries all events of the given Service.
The enumeration contains the Response, but I don't know how to handle this in Navision? Be careful that for WMI Querys on localhost any User and Password should be given if you have administrative rights.