473,397 Members | 1,974 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,397 software developers and data experts.

User impersation in VB.NET, logonuser succeeds but that's about it...

Hi All,

I try to use user-impersonation in VB.NET with a user (let's call him Bill).
I'm using the LogonUser function to create the token and so on. This
works --> calling WindowsIdentity.GetCurrent().Name() afterwards gives me
the username I'm try to impersonate. But this is about all I can do, I don't
have access to the users files on the network, for instance I get an access
denied error when I try to open a file on
\\our-fileserver\home\bill\documents .

What am I missing?

Thnx in advance.
Sven
Nov 21 '05 #1
2 7216
Hi,

http://www.dotnet247.com/247referenc...28/144136.aspx

Ken
--------------
"Sven Eric" <sp********@hotmail.com> wrote in message
news:eV**************@TK2MSFTNGP15.phx.gbl...
Hi All,

I try to use user-impersonation in VB.NET with a user (let's call him
Bill). I'm using the LogonUser function to create the token and so on.
This works --> calling WindowsIdentity.GetCurrent().Name() afterwards
gives me the username I'm try to impersonate. But this is about all I can
do, I don't have access to the users files on the network, for instance I
get an access denied error when I try to open a file on
\\our-fileserver\home\bill\documents .

What am I missing?

Thnx in advance.
Sven

Nov 21 '05 #2
Dear Ken,

Thanks for your speedy reply. I've checked out the article you sent me. The
code is pretty much the same code I've been using. The results are as they
should be: impersonation of the user is successful, however while
impersonating the user I don't have access to his/her files on the file
server...

Thanks again,

Sven

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OO**************@TK2MSFTNGP09.phx.gbl...
Hi,

http://www.dotnet247.com/247referenc...28/144136.aspx

Ken
--------------
"Sven Eric" <sp********@hotmail.com> wrote in message
news:eV**************@TK2MSFTNGP15.phx.gbl...
Hi All,

I try to use user-impersonation in VB.NET with a user (let's call him
Bill). I'm using the LogonUser function to create the token and so on.
This works --> calling WindowsIdentity.GetCurrent().Name() afterwards
gives me the username I'm try to impersonate. But this is about all I can
do, I don't have access to the users files on the network, for instance I
get an access denied error when I try to open a file on
\\our-fileserver\home\bill\documents .

What am I missing?

Thnx in advance.
Sven


Nov 21 '05 #3

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

Similar topics

5
by: Markus Stehle | last post by:
Hi all! I have asp.net web application that uses static impersonation. Is it possible to change the impersonated user during runtime? Within some parts of my application I would like to...
8
by: RTT | last post by:
i'm writing a windows form but codebased a iwant to run the code as a different user. like in a webapplication you can impersonate a user so the website does not run on the standard ASP.NET...
5
by: blue_nirvana | last post by:
I have a wireless windows ce device that is NOT going to be connected to a domain. What I want is an easy and effective way to authenicate the user against the domain inside the web service. Such...
27
by: vipleo | last post by:
I am having some issues, when I try to launch another process using Process.Start(ProcessStartInfo psi) on win xp sp2 box (Other versions of xp have no issue). Here is the detail. Main app...
2
by: schaf | last post by:
Hi NG ! I try to solve a problem with the LogonUser() function, as you can see in the topic:...
2
by: Kleber | last post by:
Could anyone please help? I'm trying to MATCH the user's UserName and Password imput to the user's UserName & Password from the machine current logged on. User's Input: txtUserName="Joe"...
1
by: ranju | last post by:
I am trying to spawn a process (say an exe file) with different user crendentials than that of the current user. 1) Called LogonUserEx() to logon the user and recieve a handle to the token that...
33
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon...
11
by: JCav | last post by:
I need to call a COM object from a remote machine using C#. I also need to pass on a different userID and password to the call. Has anyone done this? I've used Java to do this using JIntegra, but...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.