473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

VB .NET and WMI impersonation

CJ
Hi anyone.

Does anyone know of issues regarding impersonation in VB .NET with regards
to accessing remote WMI information?

I have a wrapper class which encapsulates various WMI calls, this appeared
fine under .net 1.1, but since sp1 it appears to not work. I have switched
on the debug level to 2 (for WMI) on the machines i am querying, and they are
showing access denied due to the ASPNET user of the local machine making the
query. The web server has been set to require authentication, i have set
impersonation=true in the web.config, and then i am using the following code
(from MSDN i think) to impersonate the logged on user to run the WMI queries:

Dim impersonationContext As
System.Security.Principal.WindowsImpersonationCont ext
Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity

currentWindowsIdentity = CType(User.Identity,
System.Security.Principal.WindowsIdentity)
impersonationContext = currentWindowsIdentity.Impersonate()

anyone having anything like this? i am hitting a dead end......

cheers
Jul 21 '05 #1
1 2630
1. Why impersonating in code while you have impersonate=true in your
web.config file?
2. ASPNET can never be used to access remote resources, its a local account
which is unknown at the server.
3. Impersonating a base clients (the autheticated browser client) cannot be
used either unless you have configured everything correctly for kerberos
authentication (which i doubt).

I guess something else has changed in the config.file or at the server.

Willy.

"CJ" <CJ@discussions.microsoft.com> wrote in message
news:9E**********************************@microsof t.com...
Hi anyone.

Does anyone know of issues regarding impersonation in VB .NET with regards
to accessing remote WMI information?

I have a wrapper class which encapsulates various WMI calls, this appeared
fine under .net 1.1, but since sp1 it appears to not work. I have
switched
on the debug level to 2 (for WMI) on the machines i am querying, and they
are
showing access denied due to the ASPNET user of the local machine making
the
query. The web server has been set to require authentication, i have set
impersonation=true in the web.config, and then i am using the following
code
(from MSDN i think) to impersonate the logged on user to run the WMI
queries:

Dim impersonationContext As
System.Security.Principal.WindowsImpersonationCont ext
Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity

currentWindowsIdentity = CType(User.Identity,
System.Security.Principal.WindowsIdentity)
impersonationContext = currentWindowsIdentity.Impersonate()

anyone having anything like this? i am hitting a dead end......

cheers

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ripa Horatiu | last post by:
Does anyone knows how can I impersonate to another user (basically Administrator) for a piece of my code? I've tried the samples provided by MS but they didn't worked. -- Horatiu Ripa
12
by: Anil Krishnamurthy | last post by:
We have an ASP.NET application that uses COM objects through Interop. The web application requires access to network and database resources and hence, needs to impersonate a domain account. The...
1
by: techfuzz | last post by:
I'm posting my problem experience and solution I found here for other ASP.NET developers. I have a web application that uses Forms Authentication with Active Directory to control access. In...
12
by: Anil Krishnamurthy | last post by:
We have an ASP.NET application that uses COM objects through Interop. The web application requires access to network and database resources and hence, needs to impersonate a domain account. The...
5
by: =?Utf-8?B?S2l0dHlIYXdr?= | last post by:
I am in the process of migrating an II6 environment from a single server to a network load balanced system. Thus, I am using a virtual directory on a UNC share to house the dynamic data that the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.