TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Amar Bisht
NA
159
8.2k
How to authenticate AD user in window server 2008
Nov 10 2014 5:01 AM
hi guys,
When I use Ldap for Authenticate user by IP address in winow server 2012. Its working fine ,
but when when i use same code in window server 2008 ,its not working.please tell some solution . My code as below.
Errmsg = "";
string domainAndUsername = "192.168.0.68"+ @"\" + "amar";
DirectoryEntry entry = new DirectoryEntry(
192.168.0.68
", domainAndUsername, "ABCD");
try
{
// Bind to the native AdsObject to force authentication.
// entry.AuthenticationType = AuthenticationTypes.SecureSocketsLayer;
Object obj = entry.NativeObject;
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(SAMAccountName=" + username + ")";
search.PropertiesToLoad.Add("cn");
SearchResult result = search.FindOne();
if (null == result)
{
return false;
}
// Update the new path to the user in the directory
LdapPath = result.Path;
string _filterAttribute = (String)result.Properties["cn"][0];
}
catch (Exception ex)
{
Errmsg = ex.Message;
return false;
throw new Exception("Error authenticating user." + ex.Message);
}
return true;
need your help.
Thanks and regards
Amar
Reply
Answers (
0
)
Is it possible authenicate AD login from workgroup machine
Syntax error in INSERT INTO statement