Re: WMI & Events on Computers

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Dirk (dirk_at_nospam_to_remove_ofcourse.woodstone.nu)
Date: 02/19/04


Date: Thu, 19 Feb 2004 10:32:27 +0100

If what you want to do is exactly on www.eventlog.com why don't you (your
company) buy some licenses of it?

dirk.

"Leo" <kbumbaz@yahoo.fr> wrote in message
news:40345827$0$22396$626a14ce@news.free.fr...
> MMMM ok tanks a lot !
>
> I don't know if you understand what I would like to do !
>
> ok I explain :)
>
> I am network administrator, I have, sometime, to go to the computer to see
> the evenements !
> My topic is to make a little apps to see the events of a cumputer B when I
> am on my Administrator Computer (Computer A) , in order to analyse what
> happened on the computer B !
>
> I think the code you show me juste return an event to the Computer A when
> the event arrive on the Computer B ? isn't it ?
>
> see http://www.eventlog.com/ it is exatly what I would like to do !
>
> A list of computer ... (My Apps Alread make a list of computer in my
active
> directory)
> for each computer, I can see the event log for Apps, Security & System
>
> .... do you understant .. excuse my poor english I am french :):):)
>
> Good Day :)
>
> "Jiachuan Wang [MSFT]" <jiawang@online.microsoft.com> a écrit dans le
> message de news:%23hl3YUn9DHA.2416@TK2MSFTNGP10.phx.gbl...
> > besides the sample code I posted, you can read more about WMI .NET from
> > MSDN. There's a section "Managing Applications Using WMI" under that it
> > discusses remoting and consuming events using managed code
> >
> >
>
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconmanagingapplicationsusingwmi.asp
> >
> >
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> > "Jiachuan Wang [MSFT]" <jiawang@online.microsoft.com> wrote in message
> > news:Ogi5YIn9DHA.1672@TK2MSFTNGP12.phx.gbl...
> > > The following code should get you going (get a new event from NT event
> > log)
> > > ...
> > >
> > >
> > > public class EventDrv
> > > {
> > > public EventDrv(){}
> > > public void Exec()
> > > {
> > > try
> > > {
> > > String remoteMachine = "machine";
> > > String username = @"domain\user";
> > > String password = @"password";
> > > string strQuery = "SELECT * FROM __InstanceCreationEvent where
> > > TargetInstance isa \"Win32_NTLogEvent\"";
> > > ConnectionOptions co = new ConnectionOptions();
> > > co.EnablePrivileges = true;
> > > co.Impersonation = ImpersonationLevel.Impersonate;
> > > co.Username = username;
> > > co.Password = password;
> > > System.Management.ManagementScope ms = new
> > > System.Management.ManagementScope("\\\\" + remoteMachine +
> > > "\\root\\cimv2", co);
> > > eventclass ev = new eventclass();
> > >
> > > EventQuery eq = new EventQuery(strQuery );
> > > ManagementEventWatcher ew = new ManagementEventWatcher(ms,eq);
> > > ew.EventArrived +=new
EventArrivedEventHandler(ev.ew_EventArrived);
> > > ew.Start();
> > > }
> > > catch(Exception e1)
> > > {
> > > Console.WriteLine(e1.Message );
> > > }
> > > }
> > > }
> > > public class eventclass
> > > {
> > > public void ew_EventArrived(object sender, EventArrivedEventArgs e)
> > > {
> > > Console.WriteLine("Event arrived !");
> > > }
> > > }
> > >
> > > --
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > >
> > >
> > > "Leo" <kbumbaz@yahoo.fr> wrote in message
> > > news:4033c362$0$28110$626a14ce@news.free.fr...
> > > > where I can find more info ... my directive is to whrite something
in
> C#
> > !
> > > > Ok for C# but I don't know WMI !
> > > >
> > > > tanks a lot !
> > > > "Sarika Sharma[MSFT]" <sarikas@online.microsoft.com> a écrit dans le
> > > message
> > > > de news:uxHLr6k9DHA.3880@TK2MSFTNGP11.phx.gbl...
> > > > > Yes if the user trying to remote with has sufficient privileges
you
> > can
> > > > > make use of wmi class win32_ntlogevent in root\cimv2 namespace
> > > > >
> > > > > --
> > > > > Sarika Sharma [MSFT]
> > > > > WMI Test Engineer
> > > > > This posting is provided "As Is" with no warranties, and confers
no
> > > > rights.
> > > > > Use of included script samples are subject to the terms specified
at
> > > > > http://www.microsoft.com/info/cpyright.htm
> > > > > Please do not send e-mail directly to this alias. This alias is
for
> > > > > newsgroup purposes only.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > "Leo" <kbumbaz@yahoo.fr> wrote in message
> > > > > news:40328461$0$28615$626a14ce@news.free.fr...
> > > > > > I would like to know if wmi can return me the list of the events
> on
> > a
> > > > > remote
> > > > > > computer ?
> > > > > >
> > > > > > tanks !
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: setting rights for apps to run on TS
    ... Give your users rights only to the files and registry keys needed to run your apps. ... Give your users more rights in general by, for example, switching your server to Relaxed Security mode. ... without letting the TS users be administrators of the box. ... After running process monitor for one of the apps, it showed me 147 "access denied" files/registry keys. ...
    (microsoft.public.windows.terminal_services)
  • Re: Cant read event logs on Win2003 server
    ... You do not have problems reading the event log, etc, when you log on to ... You have problems when you are on a remote machine and try to "manage" it. ... This posting is provided "AS IS" with no warranties, and confers no rights. ... > "Arch Willingham" wrote in message ...
    (microsoft.public.windows.server.security)
  • Re: Problem running .NET CF 1.0 apps on CE 4.2 Core
    ... ..NET CF, as well as the .NET CF itself, in order to run managed code apps. ... MS does *not* support headless devices for .NET CF, either, so that might be ... > only have Core licence. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: VB6, VB2005, or Something Else?
    ... Microsoft is at least claiming to be moving to managed code, ... the other Toyota owners seem unconcerned, ... envisions the future to be subscription apps... ... subscription app resulting datafiles such as documents. ...
    (microsoft.public.vb.general.discussion)
  • Re: How to keep a program running while in Standby mode
    ... The PPC closes apps only on low-memory conditions. ... the today screen after a period of non-use, but the apps continue to run. ... Chris Tacke ... Managed Code in the Embedded World ...
    (microsoft.public.dotnet.framework.compactframework)