473,322 Members | 1,714 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,322 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 7213
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.