You actually shouldn't have to use Interop or PInvoke like that to authenticate to AD using VB.Net. I do it all the time in WinForms using the DirectoryEntry class, which allows you to pass creds to your AD connection. You just need to front those creds with a simple form and away you go. Just check out the VS docs on DirectoryEntry. Also, if you plan to do a lot of .Net programming against AD, I would highly suggest this book: http://www.amazon.com/Developers-Directory-Programming-Microsoft-Development/dp/0321350170/sr=8-1/qid=1159285094/ref=pd_bbs_1/102-7103604-3390566?ie=UTF8&s=books
 
Darren


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven Wood
Sent: Tuesday, September 26, 2006 7:40 AM
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Struggling to find AD authentication code

Thanks for that. Great blog by the way.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Desmond
Sent: 26 September 2006 15:13
To: ActiveDir@mail.activedir.org
Subject: RE: [ActiveDir] Struggling to find AD authentication code

 

Look at the example for calling the LogonUser() API on my website – scroll down a bit www.briandesmond.com.

 

Thanks,

Brian Desmond

[EMAIL PROTECTED]smond.com

 

c - 312.731.3132

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven Wood
Sent: Tuesday, September 26, 2006 5:39 AM
To: ActiveDir@mail.activedir.org
Subject: [ActiveDir] Struggling to find AD authentication code

 

Hi,

 

Can anyone point me in the direction of some VB.Net examples of authenticating users against AD using a Windows form and not asp.net? All the examples I can find are forms based authentication for asp.net. I’ve loaded the template ‘Login Form’ included with VB 2005 unfortunately there appears to be no sample code of AD authentication that I can see.

 

Any help very much appreciated.

 

Regards

 

Steven

 

 

 

 

 

-------------------------------------------------------------------
This email is from Oldham Sixth Form College, but expresses the views
of the sender and not necessarily the views of the college. The email
and any files transmitted with it are confidential to the intended
recipient at the e-mail address to which it has been addressed. It may
not be disclosed or used by any other than that addressee, nor may it
be copied in any way. If received in error, please notify
[EMAIL PROTECTED] quoting the name of the sender.

This message has been scanned for viruses by F-Secure Anti-Virus.

Please note that we cannot accept any responsibility for any
transmitted viruses. It is, therefore, your responsibility to scan
attachments (if any).

Reply via email to