-
Apr 13th, 2006, 06:32 AM
#1
Impersonating a user
I have scowered google for ages, and can't find any definitive code for this
I suck at google mind you.
I have a username and password.
username: "Woof"
password: "Growl123"
domain: "WokasDomain"
I need to impersonate this user when I run some code.
Does anyone have a function for this?
Woka
-
Apr 13th, 2006, 06:45 AM
#2
Lively Member
Re: Impersonating a user
I'm really not sure this is what you are after and also its for VB5/6....but maybe you can use some of the code?
http://www.freevbcode.com/ShowCode.asp?ID=4298
VB.Net 2005 Express
.Net Framework 2.0
-
Apr 13th, 2006, 06:57 AM
#3
Re: Impersonating a user
Originally Posted by Wokawidget
I have scowered google for ages, and can't find any definitive code for this
I suck at google mind you.
I have a username and password.
username: "Woof"
password: "Growl123"
domain: "WokasDomain"
I need to impersonate this user when I run some code.
Does anyone have a function for this?
Woka
Hi,
Did you do a look in the MSDN library for that.
wkr,
sparrow1
-
Apr 13th, 2006, 06:58 AM
#4
Re: Impersonating a user
What version of .NET?
In 2.0, if it can be broken out into another exe, then the username, domain, and password are params into Process.Start().
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Apr 13th, 2006, 07:32 AM
#5
Re: Impersonating a user
version 1.1
Yes I looked in MSDN.
This thread is like all otehr threads on the web. Replies, but no code
VB6 will not help me
Woka
-
Apr 13th, 2006, 10:47 AM
#6
Hyperactive Member
Re: Impersonating a user
Woka,
Take a look at this msdn blog
I'm not sure if it is completely what you need but will certainly get you started.
-
Apr 13th, 2006, 10:51 AM
#7
Re: Impersonating a user
Seenj that already.
Where does it show you where to enter username, apssword etc.
What user is it impersonating?
All the code on the web is like that.
Woka
-
Apr 13th, 2006, 11:48 AM
#8
Hyperactive Member
Re: Impersonating a user
This MSDN Code code should do it. Using this code I was able to successfully impersonate a local user and open a folder that only that user has rights to.
-
Apr 13th, 2006, 12:34 PM
#9
Re: Impersonating a user
I found a link (with Google ) that shows how to do this with a modification to the web.config file. Would that do you any good?
-
Apr 13th, 2006, 12:53 PM
#10
Hyperactive Member
Re: Impersonating a user
I'm not sure but I think he was looking for something in winforms. That last MSDN link I posted does have the complete code in VB.NET and C# to impersonate a user including the prompts for username, password and domain. I tried it in 1.1 because that is what Woka needs and it works right as posted.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|