HighTechTalks DotNet Forums  

Accessing Active Directory on Win 2000 Server via NTLM Authentication in C#

Dotnet Security microsoft.public.dotnet.security


Discuss Accessing Active Directory on Win 2000 Server via NTLM Authentication in C# in the Dotnet Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Proteus
 
Posts: n/a

Default Accessing Active Directory on Win 2000 Server via NTLM Authentication in C# - 03-20-2007 , 07:18 AM






HI
I have a problem:
There is running AD on Win2000 Server.
I am writting a C# program to connect and find some entries on the
AD.
It is a web application and corporate clients are loggend on computer
connected to AD. These clients are accessing this application. In the
Application I get User.Identity.AuthenticationType of the NTLM. not
"Negotiate"
Then I am creating a searcher: DirectorySearcher oDS = new
DirectorySearcher("LDAP//"+domainName);
and Filter and try to find a result:


oDS.Filter =
"(samAccountName="+user.Login.Substring(0,user.Log in.IndexOf("@"))
+")";
oDS.SearchScope = SearchScope.Subtree;


SearchResult deUser = oDS.FindOne();


on the FindOne() itr fails that a domain with such name can not be
found


Stacktrace: at
System.DirectoryServices.DirectoryEntry.Bind(Boole an
throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObj ect()
at System.DirectoryServices.PropertyValueCollection.P opulateList()
at
System.DirectoryServices.PropertyValueCollection.. ctor(DirectoryEntry
entry, String propertyName)
at System.DirectoryServices.PropertyCollection.get_It em(String
propertyName)
at System.DirectoryServices.DirectorySearcher.get_Sea rchRoot()
at System.DirectoryServices.DirectorySearcher.FindAll (Boolean
findMoreThanOne)
at System.DirectoryServices.DirectorySearcher.FindOne ()
at ReportBuilder.BusinessLayer.Role.ManageUserRoles(U ser user,
IPrincipal principal)
at ReportBuilder.WebInterface._default.Page_Load(Obje ct sender,
EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain()


IS it even possible to access the AD, when there is the NTLM, if I
get
on XP clients connecting to WIn 2003 Negotiate type then it works
fine


Does anybody know where is the problem?


Thanks a lot


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.