Re: Getting "Access is Denied" when starting a ManagementEventWatc



Hi Carl,

are you connecting from XP to W2K-Server or
from W2K-Server to XP

with the install of SP2 some settings related to the
security were changed. Take a look at:
http://support.microsoft.com/default.aspx?scid=kb;en-us;875605

HTH

Bye
Peter


"Carl K" <CarlK@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag news:19A2F2C1-B4F0-492D-8FAF-F6018F37F4AE@xxxxxxxxxxxxxxxx
> Still getting access is denied. My system is XP SP2 and I have found that if
> I run the app on SP1 or Win2k there is no problem.
>
> I think I did everything with the firewall config described in other technet
> articles to open up the firewall for remote management calls, but apparently
> not.
>
> Can you tell me what specifically I would need to have configured on XP SP2
> to do this?
>
>
> "Peter Falz" wrote:
>
> > Hi Carl,
> >
> > what happens if you use the "Administrator"-account?
> > I don't mean a account with administrative rights but i mean
> > the "Administrator"-user itself.
> >
> > Bye
> > Peter
> >
> > "Carl K" <CarlK@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag news:89CEBEAB-DB0D-4537-B6D0-86597155CAF9@xxxxxxxxxxxxxxxx
> > > I have written an Winforms app to monitor and log all print jobs submitted to
> > > a print server. If I run the application on the print server, it works fine,
> > > but the point of the app was to run it from my client and connect to
> > > root\cimv2 on the remote print server.
> > >
> > > Here is the relevant code:
> > >
> > > '//////////////////////////////////////////
> > > Private Sub CreateWatcher()
> > >
> > > Dim myQuery As New WqlEventQuery
> > > myQuery.EventClassName = "__InstanceCreationEvent"
> > > myQuery.Condition = "TargetInstance ISA 'Win32_PrintJob'"
> > > myQuery.WithinInterval = New TimeSpan(0, 0, 0, 1, 250)
> > >
> > > Watcher = New ManagementEventWatcher(myQuery)
> > > Watcher.Scope = New ManagementScope("\\" & PrintServer &
> > > "\root\cimv2")
> > > Watcher.Scope.Options.Impersonation = ImpersonationLevel.Impersonate
> > > Watcher.Scope.Options.EnablePrivileges = True
> > > Watcher.Scope.Options.Username = "cklouda"
> > > Watcher.Scope.Options.Password = "password"
> > >
> > > Try
> > > Watcher.Scope.Connect()
> > > Console.WriteLine(Watcher.Query.QueryString.Trim)
> > > Catch ex As Exception
> > > Console.WriteLine(ex.Message)
> > > End Try
> > >
> > > AddHandler Watcher.EventArrived, AddressOf Arrived
> > > Try
> > > Watcher.Start()
> > >
> > > Catch accessEx As System.UnauthorizedAccessException
> > > Console.WriteLine(vbCrLf)
> > > Console.WriteLine(accessEx.Source & " - " & accessEx.Message)
> > > Console.WriteLine(accessEx.InnerException)
> > > Console.WriteLine(accessEx.TargetSite)
> > > Console.WriteLine(accessEx.StackTrace)
> > > Catch ex As Exception
> > >
> > > End Try
> > >
> > > End Sub
> > >
> > > '//////////////////////////////////////////////////////////////////
> > >
> > > When Watcher.Start() executes it returns an "Acces is Denied"
> > > from MSCorlib
> > >
> > > Now... the ID and password I use is for an account that is in the
> > > administrators group on the remote print server. I even went to the WMI
> > > config in the MMC on the remote print server and gave "Everyone" the "Remote"
> > > permission on Root\Cimv2
> > >
> > > To top it off, if I run the same code, Watcher.Scope.Connect() does not
> > > return an error, suggesting that the app has no problem connecting to
> > > root\cimv2 on the remote print server. So... I am at a loss as to what is
> > > causing the access is denied error...
> > >
> > > I am running WinXP SP2, the server I am connecting to is Win2000 Server
> > >
> > > Any help would be appreciated...
> >
> >
> >


.



Relevant Pages

  • RE: HTTP Export to Excel from within application
    ... I posted a similar question regarding exporting within Oracle 11i. ... problem occurred after implementing XP SP2. ... > I have a 2003 Web Server which my app resides on, ... > Excel locally and triggers a Web Query that attempts to pull the data into ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: VFP9 SP2 on SP1 runtimes?
    ... no plans for Vista yet. ... Just figuring out if it's safe to play with the SP2 on my dev machine and ... runtimes the same time as the app. ... I'm considering installing the SP2. ...
    (microsoft.public.fox.programmer.exchange)
  • VB6 XP SP2 DBGRID32.OCX
    ... Does anyone know of any issues with dbgrid32.ocx and XP SP2? ... I've inherited support of a VB6 app that uses this data grid. ... Since the new machines came in with SP2, I thought it may be something else ...
    (microsoft.public.vb.general.discussion)
  • Managed Direct3D - DLL hell / Pre-SP2 issues
    ... we are having strange issues that seem to be related to SP2. ... The app initializes fine, but once it tries to create the Direct3D ... DirectX SDK October 2004 update as well. ...
    (microsoft.public.win32.programmer.directx.managed)
  • XP SP2 - Network print delays
    ... If you manage a small network of XP systems that share printers over the ... SP2 on just one machine, ... A handful of new WinXP boxes that have been printing to that print server ... The XP SP2 box now sees about a minute delay every time it brings up ...
    (microsoft.public.windowsxp.print_fax)