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

Authenticating a user to Active Directory

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?
Jul 21 '05 #1
0 1127

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

Similar topics

0
by: shalinmangar | last post by:
I want to authenticate users (defined in an Active Directory Service running on a Windows 2000 Server machine) from PHP Code running under Linux (Fedora Core 3 with Kerberos 5 installed). I just...
3
by: Zeno Lee | last post by:
I'm trying to authenticate a user against a windows network. I want it to work across any kind of windows network from NT 4.0 up to Windows 2003 ADS. So far I've been using DirectoryEntry and...
3
by: mrwoopey | last post by:
Hi, I am using the example "Authenticate against the Active Directory by Using Forms Authentication and Visual Basic .NET": http://support.microsoft.com/default.aspx?scid=KB;EN-US;326340 ...
3
by: jm | last post by:
Right now, I have a MySQL database that has groups defined (not AD groups) and based upon which group a user is in they are allowed certain pages, controls, etc. I want to make my systems more...
1
by: Larry Rekow | last post by:
I created a web application in classic ASP 6 months ago that had a login page which would only allow certain users to add, update or delete files from 6 different departments. (Windows 2000 server,...
0
by: Paul Steele | last post by:
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...
1
by: mirlisa | last post by:
We have an odd problem. Sometime this morning our classic asp web application stopped authenticating against active directory. This is our only "classic" asp app that authenticates against ad....
0
by: Nandagopal | last post by:
Hi, I am using the example "Authenticate against the Active Directory by Using Forms Authentication and C#": But I am having a problem figuring out the LDAP:// The LDAP:// that I pass looks...
0
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i have a simple asp.net app that using window authentication integration and disallowing anonymous users. well, when a user tries to browse to this page she gets a "The page cannot be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.