473,394 Members | 1,738 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,394 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 2632
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.