473,569 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=t rue 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 impersonationCo ntext As
System.Security .Principal.Wind owsImpersonatio nContext
Dim currentWindowsI dentity As System.Security .Principal.Wind owsIdentity

currentWindowsI dentity = CType(User.Iden tity,
System.Security .Principal.Wind owsIdentity)
impersonationCo ntext = currentWindowsI dentity.Imperso nate()

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

cheers
Jul 21 '05 #1
1 2643
1. Why impersonating in code while you have impersonate=tru e 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******** *************** ***********@mic rosoft.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=t rue 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 impersonationCo ntext As
System.Security .Principal.Wind owsImpersonatio nContext
Dim currentWindowsI dentity As System.Security .Principal.Wind owsIdentity

currentWindowsI dentity = CType(User.Iden tity,
System.Security .Principal.Wind owsIdentity)
impersonationCo ntext = currentWindowsI dentity.Imperso nate()

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
9997
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
2550
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 problem is that even when it is configured to run under a certain identity through Web.config, the impersonation is not carried through to COM library....
1
3950
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 this web application, I have search page that utilizes the Windows Indexing Service (MSIDXS provider). For reasons I'm not aware of at this time,...
12
2013
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 problem is that even when it is configured to run under a certain identity through Web.config, the impersonation is not carried through to COM library....
5
2658
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 web farm will access. Since ASP.NET runs as a local account on the IIS servers, I have to use impersonation to perform any operations on the data...
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7678
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7982
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.