PC Review


Reply
Thread Tools Rate Thread

Authenticating a user to Active Directory

 
 
Paul Steele
Guest
Posts: n/a
 
      26th Feb 2004
I need to check the existence of a username/password in Active Directory,
without the workstation actually being in the domain. I'm using the
following C# code:

DirectoryEntry de = new
DirectoryEntry("ldap://dc.acadiau.ca/dc=ad,dc=acadiau,dc=ca", username,
password, AuthenticationTypes.Secure);

try
{
string name = de.Name;
MessageBox.Show("Username is valid")
}
catch
{
MessageBox.Show("Username is not valid")
}

The de.Name statement always fails. If I don't use the try/catch, I get an
unhandled exception error of type
"System.Runtime.InteropServices.COMException occurred in
system.directoryservices.dll" The additional information field states:
"Unknown error (0x80005000)".

I've seen similar examples indicating this is the way to do it, but I've hit
a road block. Anyone with any ideas?


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Active Directory: Authenticating jp2msft Microsoft C# .NET 6 19th May 2009 03:39 PM
Active Directory: Authenticating jp2msft Microsoft C# .NET 0 18th May 2009 10:59 PM
Authenticating Against Active Directory? Dan Microsoft Access VBA Modules 3 8th Jul 2004 10:36 AM
Authenticating Users with Active Directory in Access? Todjk Microsoft Access Security 5 28th Feb 2004 10:51 PM
Authenticating NT userid and password against Active Directory in dot net Bindu Microsoft Windows 2000 Active Directory 1 18th Feb 2004 06:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:42 PM.