Bug in ManagementScope.Connect?

  • Thread starter Thread starter toupeira23
  • Start date Start date
T

toupeira23

Hello

I'm trying to connect to another server via WMI, and it works just
fine. But everytime it first tries to connect with the current user
credentials, which naturally don't exist on the remote server,
resulting in Failure Audit entries in the EventLog. After some googling
I discovered that this is a known problem, but nobody has a workaround.
So I thought I'd try again ;-)

Here's some sample code to demonstrate the behaviour:

using System;
using System.Management;

public class test
{
public static void Main()
{
ConnectionOptions opts = new ConnectionOptions();
opts.Username = "XXXXXXXX";
opts.Password = "XXXXXXXX";

ManagementScope scope = new ManagementScope(@"\\XXX\root\cimv2",
opts);
scope.Connect();
}
}

After running this code, the remote server has 2 entries each for event
ID 529 & 680.

I've tried all settings for ImpersonationLevel and Authentication, and
also setting Authority to "NTLMDOMAIN:<name of remote server>". And
using Kerberos authentication wouldn't help, as the servers are not in
a domain (which is the reason I need to use ConnectionOptions in the
first place).
The .NET version is 1.1.4322, and I've tested it on Windows 2003, 2000
and XP, and it's the same everywhere.


greetings,
markus
 
Hello

I'm trying to connect to another server via WMI, and it works just
fine. But everytime it first tries to connect with the current user
credentials, which naturally don't exist on the remote server,
resulting in Failure Audit entries in the EventLog. After some googling
I discovered that this is a known problem, but nobody has a workaround.
So I thought I'd try again ;-)

Here's some sample code to demonstrate the behaviour:

using System;
using System.Management;

public class test
{
public static void Main()
{
ConnectionOptions opts = new ConnectionOptions();
opts.Username = "XXXXXXXX";
opts.Password = "XXXXXXXX";

ManagementScope scope = new ManagementScope(@"\\XXX\root\cimv2",
opts);
scope.Connect();
}
}

After running this code, the remote server has 2 entries each for event
ID 529 & 680.

I've tried all settings for ImpersonationLevel and Authentication, and
also setting Authority to "NTLMDOMAIN:<name of remote server>". And
using Kerberos authentication wouldn't help, as the servers are not in
a domain (which is the reason I need to use ConnectionOptions in the
first place).
The .NET version is 1.1.4322, and I've tested it on Windows 2003, 2000
and XP, and it's the same everywhere.


greetings,
markus

Looks like Scope.Connect performs an additional authentication handshake
using the current process identity, the resulting logon session is not used
at all though, sure looks like a "bug".

Willy.
 
Willy said:
Looks like Scope.Connect performs an additional authentication handshake
using the current process identity, the resulting logon session is not used
at all though, sure looks like a "bug".

So, does Microsoft have something like a bug submitting system where I
can report this?


thanks and greetings,
Markus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top