Posted August 7, 200816 yr Hi all, I posted this in the WMI newsgroup, but there's not much action there! Perhaps I can find some help here... I have a simple little Windows service that retrieves events from a remote computer through WMI and a ManagementEventWatcher. It all works just fine... as long as the user I specify in my ConnectionOptions (see below) is an administrator of the remote computer. My problem is that (for security reasons) I cannot use an administrator account. I have created a clean account, currently with no permissions on the remote computer. Now I want to add just the permissions needed for my service to work, but I can't find anywhere what permissions that is! Please enlighten me! / Mikael This is the essentials of the service: ConnectionOptions connection = new ConnectionOptions() connection.Impersonation = ImpersonationLevel.Impersonate connection.Username = "NotAnAdminUser" connection.Password = "LetMeIn" ManagementScope scope = new ManagementScope(@"\\remotecomputer\root \cimv2", connection) scope.Connect() string query = "SELECT TargetInstance FROM __InstanceCreationEvent WHERE TargetInstance ISA 'Win32_NTLogEvent'" ManagementEventWatcher watcher = new ManagementEventWatcher(scope, new EventQuery(query)) watcher.EventArrived += new EventArrivedEventHandler(watcher_EventArrived) watcher.Start() (currently I get to scope.Connect() where I run into an UnauthorizedAccessException)
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.