Click here to Skip to main content
15,893,588 members
Everything / LDAP

LDAP

LDAP

Great Reads

by Mike DiRenzo
Single C# class file that can be dropped into any project and used right away
by pckola
Accessing userProxy, userProxyFull From AD Light Weight Directory Services
by Alejandro Ferreira Guido
This article is about explaining the process of building an authentication servlet filter from scratch, including configuration initialization, url path filtering for login page and the process to get a user dynamically authenticated on a separate LDAP Windows Active Domain.
by Robert E Campbell
A quick run through of how to quickly query LDAP and how to use the resutls of that query.

Latest Articles

by DiponRoy
How to run FTP, SFTP, SMTP, Cache, LDAP, SSO and other servers in Docker
by DiponRoy
Username and password validation process from LDAP server in ASP.NET and ASP.NET Core
by Mike DiRenzo
Single C# class file that can be dropped into any project and used right away
by Alejandro Ferreira Guido
This article is about explaining the process of building an authentication servlet filter from scratch, including configuration initialization, url path filtering for login page and the process to get a user dynamically authenticated on a separate LDAP Windows Active Domain.

All Articles

Sort by Score

LDAP 

24 Oct 2017 by Mike DiRenzo
Single C# class file that can be dropped into any project and used right away
15 Feb 2013 by Espen Harlinn
It's not unknown, 0x80005000 means that "The specified directory service attribute or value does not exist". It will sometimes occur under a heavy load, when the global catalog server may fail to authenticate a client by using Kerberos.Best regardsEspen Harlinn
4 Mar 2014 by pckola
Accessing userProxy, userProxyFull From AD Light Weight Directory Services
20 May 2016 by ZurdoDev
Second google result has an example from Microsoft. Creating Users with Active Directory Lightweight Directory Services (Windows)[^]For future reference, this is the type of question that is easily answered by asking google. You'll learn a lot more by doing research yourself first and...
4 Jun 2012 by Zoltán Zörgő
You can access it wia http://msdn.microsoft.com/en-us/library/system.directoryservices.directoryentry.properties[^] property collection....foreach(SearchResult resEnt in mySearcher.FindAll()){ DirectoryEntry ent = resEnt.GetDirectoryEntry(); Console.WriteLine("{0} created on {0}",...
4 Aug 2012 by Christian Graus
I would do this entirely inside my site. I'd have classes that worked out the permissions, but could do that from any source and then use attributes or method calls in a base class I used for all pages, to allow or deny access based on the logged in user.
21 Oct 2012 by mayankkarki
I am working on a website. And in some situation I want to detect that my website is open in kiosk mode. Is there any way to detect this?
15 Feb 2013 by Mike Meinz
I found a bunch of occurrences of 0x80005000 Google Search. Here's one of them: 0x80005000 using LDAP in VBScript - caused by forward slash ("/") in a group name.
11 Mar 2013 by Yvan Rodrigues
Before you waste your time with code, confirm that the LDAP server to which you are trying to connect is available.Normally one connects to an LDAP server on port tcp/389, or LDAPs on tcp/636. Poprt 445 is not required for LDAP queries. It may be required for some native Active Directory...
23 Aug 2013 by Prasad Khandekar
Hello,This limit is generally set on the LDAP server itself and not in the library. On Novell e-Directory server you can alter this by issuing following command. ldapconfig [-t tree_name | -p host_name[:port]] [-w password] [-a admin_FDN] -s "LDAP TCP...
31 Dec 2013 by ZurdoDev
Don't use DllImports. .Net has built-in methods for doing this.See http://msdn.microsoft.com/en-us/library/system.directoryservices(v=vs.110).aspx[^]Also, for an example see,...
23 Apr 2014 by Abinash_Sahoo
What's the error are you getting? I can see one problem with the following If statement. When I changed it to Results.Count = 0, it worked fine for me.Changed If Results Is Nothing OrElse Results.Count 0 Then to If Results Is Nothing OrElse Results.Count = 0 Then, and it worked perfectly...
22 Dec 2014 by Kornfeld Eliyahu Peter
PHP has a lot of built in methods to handle LDAP (since version 4)...ldap_connect[^] - to connect to LDAP serverldap_list[^] - to list entries in single levelldap_search[^] - to search in LDAP treeldap_get_entries[^] - to get actiul entry valuesFor the whole package read here: LDAP[^]
9 Oct 2015 by galanderavi
My code for authentication with clear text is as below. How do i authenticate user with hash password? PrincipalContext adContext = new PrincipalContext(ContextType.Domain); UserPrincipal user = UserPrincipal.FindByIdentity(adContext,...
15 Apr 2016 by Adeem Zanoub
Hello,I am not very good in English but I will try to explain my problem in simple as I can,I try to build web method in web service which create user in active directory,when I invoke this method locally from browser in server it work fine but when I invoke this method from browser in another...
28 Sep 2017 by Alejandro Ferreira Guido
This article is about explaining the process of building an authentication servlet filter from scratch, including configuration initialization, url path filtering for login page and the process to get a user dynamically authenticated on a separate LDAP Windows Active Domain.
21 Sep 2018 by Richard Deeming
Try PasswordLastSet instead of PwdLastSet. As far as I can see, there isn't a PwdAge property; you'll need to calculate it from the PasswordLastSet property. Something like this should work: Search-ADAccount -AccountInactive -TimeSpan 90 -UsersOnly -SearchBase "OU=User...
5 May 2020 by Richard Deeming
The problem is that you haven't set anything to indicate that the user is signed in. You validate the credentials and redirect to the returnUrl, but that redirected request will be anonymous. The Authorize filter will see an anonymous request...
26 May 2020 by Garth J Lancaster
why 'nothing helpful so far' - that article said "To use LDAP with Oracle you have to set up a separate database with Oracle Internet Identity Management repository. " - did you do this, what was the result or why is it not helpful ? Please...
9 Jan 2012 by rhino11301
I have an application that is attempt to validate an LDAP SSL account. When I execute the code to authenticate the LDAP SSL connection directly through the application, it works. However, when the ValidateLDAP connection method is in the business rules and executed through the webservice - it...
10 Jan 2012 by rhino11301
Found the solution after additional searching. It was a permissions problem but not something that could be resolved through a UI tool.http://support.microsoft.com/kb/901183Installing the certificate in the Local store is the key.Thanks!
10 Feb 2012 by Amir Sacic
Hello !I just want to ask you a quick question.How to change userpasswords in Active Directory ...Every time i'll try to change, i get a COM-Exception Unkown errorpublic void ResetPassword(string userDn, string newpassword){ DirectoryEntry user = new...
10 Feb 2012 by S@53K^S
Hi Amir,I case of changing the password of a user in the AD you should make sure that you have sufficient rights to perform the operation.In a complex AD deployment as in a corporate environment the right to change password resides with the domain administrator,so you have to be either a...
27 Feb 2012 by Ayubstation
Hello!I want to vb create code to connect to an LDAP and retrieve an specific user/password or specific user validation.Im new, so any explained code example(s) would be very useful! Thanks!
27 Feb 2012 by Ganesan Senthilvel
You can use the below function to fetch LDAP info:using System.Security.Principal;private void GetUserName() { WindowsIdentity ident = WindowsIdentity.GetCurrent(); WindowsPrincipal user = new WindowsPrincipal(ident); string username =...
4 Mar 2012 by nigam.anant
I create a i-frame widget of the Outlook Web Access.Now I want is That-When the User Write the URL of the Web page on Which a Outlook widget is placed then it shows log in page in the Widget.now i want that When Widget i-frame loaded it automatically authenticated the Active Directory's...
20 Apr 2012 by xiaolixx
Hi im trying to write a web interface to access Active directory shares through LDAP / Active Directory Application Mode. I cant even find out if the shares are stored in Active directory or on the server in windows itself, any help would be greatly appreciated. If the shares are stored in...
21 May 2012 by prthpatel412
PrincipalContext ctx = new PrincipalContext(ContextType.ApplicationDirectory, "domain.com", "ou=*Garden City Users, o=microsoft,c=us", ContextOptions.SecureSocketLayer | ContextOptions.SimpleBind, "CN=ppatel, OU=*Garden City Users, O=Microsoft, C=US ", "password"); UserPrincipal up...
22 May 2012 by prthpatel412
I am getting some weird error, my code run perfectly under development server but when i am trying to publish it on my local server i am getting this error.System.DirectoryServices.DirectoryServicesCOMException: Logon failure: unknown user name or bad...
22 May 2012 by fjdiewornncalwe
Your web application is likely not running under the user's context, but under it's own context. The account that your web application is running under does not exist in LDAP and therefore cannot login to query LDAP. You may need to update your app pool to run under an account that LDAP knows...
31 May 2012 by Abhi KA
i am using PrinicipalContext to get User details From Active Directoryi want to update user details like address ,mobile number etc.. tell me how to i am searching but didn,t get is it possible update with PrinicipalContext ?
4 Jun 2012 by a.4j4vv1
I need get a list of Whencreate object and user in ldap with C#,in this code i cat list, all of user in ldap but i need get Whencreate option all of user and object.Code://ActiveDirectorySearch1//Displays all computer names in an Active Directoryusing System;using...
9 Jun 2012 by Sandeep Mewara
1. Your question is not clear.2. It does not work like this here.Here is what is expected of enquirers:1. TRY first what you want to do! You may find that it's not that hard.2. Formulate what was done by you that looks like an issue/not working. Try them and tell if you face...
19 Jun 2012 by aLcoHolicDevil
HiI am creating an application which will get all the users from active directory. Right now i am done with normal users from group. But i am not able to fetch subgroups of a group.How do i query that??A little help will be usefullThank You Kunal Shah
19 Jun 2012 by Tim Corey
Here is a question I asked on Stack Overflow. The answer seems to be what you are looking for:http://stackoverflow.com/questions/6252819/find-recursive-group-membership-active-directory-using-c-sharp[^]
25 Jun 2012 by @BangIndia
Hi,i get the account expire date from the AD.but its not in the local time format.Its in 100-nanosecond intervals since January 1, 1601 (UTC) format.how to convert that into local time format using c++ or c.
25 Jun 2012 by Mukesh_Chauhan
{# days since ANSI 0} = {AD timestamp} / {# 100ns/day}{# days since SQL 0} = {# days since ANSI 0} - {# days from ANSI 0 to SQL 0}
26 Jun 2012 by @BangIndia
I use the struct time function i solved
8 Aug 2012 by Oleksandr Kulchytskyi
I have resolved this issue by myself.See method below:public bool checkLdapServer(string server, string domain, int port) { try { using (DirectoryEntry dirEnt = new DirectoryEntry("LDAP://" + server.Trim() + "." + domain.Trim() + ":" +...
23 Feb 2016 by v8nguyenvan
Hi everybody, I'm working on a project and connect to LDAP Server to verify user.When setting LDAP Server I have a problem:I used ldp.exe to test connection:I can connect to LDAP over SSL (port 636) when I run ldp.exe on server (on window server, ldp.exe and LDAP Server are in the same...
16 Oct 2012 by mayankkarki
I am working on a website to change ldap user password. But after changing user password both old and new password worked. I don't know how its happening but I want to prevent this.
16 Oct 2012 by Michel [mjbohn]
This is an Active Directory flawHow to change the lifetime period of an old password[^]
21 Oct 2012 by krishnaspmoorthy
Hi,I need the list of users who are logged(online) in a particular domain.I'm using LDAP Authentication.Thanks in advanceRegards,Krishnamoorthy S
21 Oct 2012 by mayankkarki
Hi,I am working on a website which interact with active directory and perform certain user operations. I want to handle the timeout situation in case of server is offline.I am coding like this LdapConnection connection = new LdapConnection(new LdapDirectoryIdentifier(this._domain,...
22 Oct 2012 by nuno_god
Is it possible to get the Windows logged-in user information (such as emails,telephones) from the Active Directory from a Java Web Application without having to log in?I have managed to do the following:1-Get the current logged-in windows user (with impersonate) (but cannot get the user...
22 Oct 2012 by Kuthuparakkal
Follow:http://www.deepakgaikwad.net/index.php/2009/09/24/retrieve-basic-user-attributes-from-active-directory-using-ldap-in-java.html[^]
4 Nov 2012 by mayankkarki
Hi,I am working on a website. I have to find the value of user can't change password property of a user. I get this linkhttp://msdn.microsoft.com/en-us/library/aa746448(v=vs.85).aspx[^] according to which I have to find "ntSecurityDescriptor" value of that user. They are using...
4 Nov 2012 by DevilsJester
Dont know if im answering your question or not, but if your working on a website, Use the VB at the End of your Link posted above, VB can query the information you need and can be encased within an ASP webpage. The VB code can also Manipulate the returned data to what ever format you...
5 Nov 2012 by mayankkarki
Hi,My problem is that I am using LDAPconnection class and connecting over ssl. I manage to get nTSecurityDescriptor value but now getting error."Unable to cast object of System.Byte[] to ActiveDs.IADsSecurityDescriptor"I am using code like this.SearchResponse response =...
14 Nov 2012 by Robert E Campbell
A quick run through of how to quickly query LDAP and how to use the resutls of that query.
18 Nov 2012 by mayankkarki
Hi,I am working on a website to manage active directory. I want to check that whether user has permission to change password or not. So I have to find "ntSecurityDescriptor" property value after that I have to cast it into IADsSecurityDescriptor. Now if I use DirectorySearcher class then...
19 Nov 2012 by mayankkarki
Hi,I am working on active directory. I fetched value of "ntSecurityDescriptor" in DirectoryAttribute class object. But it is in byte array and I am unable to cast it into IADsSecurityDescriptor.Any help.
23 Nov 2012 by mayankkarki
At last I find the answer of my question. This class convert the byte[] to valid security descriptor com object.ActiveDs.ADsSecurityUtility secUtility = new ActiveDs.ADsSecurityUtility();ActiveDs.IADsSecurityDescriptor sd =...
23 Nov 2012 by mayankkarki
At last I find the answer of my question. This class convert the byte[] to valid security descriptor com object.ActiveDs.ADsSecurityUtility secUtility = new ActiveDs.ADsSecurityUtility();ActiveDs.IADsSecurityDescriptor sd =...
23 Nov 2012 by mayankkarki
At last I find the answer of my question. This class convert the byte[] to valid security decriptor comobject.ActiveDs.ADsSecurityUtility secUtility = new ActiveDs.ADsSecurityUtility();ActiveDs.IADsSecurityDescriptor sd =...
23 Nov 2012 by mayankkarki
This is the solution that I find. SearchResponse response = (SearchResponse)connection.SendRequest(request); DirectoryAttribute attribute = response.Entries[0].Attributes["ntSecurityDescriptor"]; if (attribute != null) { ...
23 Nov 2012 by mayankkarki
Solution of my problem. SearchResponse response = (SearchResponse)connection.SendRequest(request); DirectoryAttribute attribute = response.Entries[0].Attributes["ntSecurityDescriptor"]; if (attribute != null) { const...
18 Dec 2012 by mayankkarki
Hi,I am working on a website to manage ldap. I am stuck in a situation, when I am trying to authenticate user with account locked or disabled it fails. What I want to do is first authenticate user after that show message that account locked or disabled.I am coding like...
18 Dec 2012 by Zoltán Zörgő
This won't work. Binding to LDAP server implies a user that can establish connection to the server. A disabled or locked user by definition can't. You will need to use a service account to get into ldap and do the query.
12 Jan 2013 by David_Wimbley
So it seems like all you are looking to do is authenticate a user against active directory correct? If so then this snippet will workMethod For AD Authusing System.DirectoryServices;public static bool IsAuthenticated(string ldap, string usr, string pwd){ bool authenticated =...
12 Jan 2013 by David_Wimbley
This code is untested but should point you in the right direction.Youll need to provide credentials of a user in AD that has admin privileges to reset passwords. Will take username passed in from textbox to reset that users password.string username = txtUsername.Text;string adminUser...
4 Feb 2013 by Member 8959491
public string GetGroups() { DirectorySearcher search = new DirectorySearcher(_path); //search.Filter = "(&(objectclass=group))";//(cn=%s*) search.Filter = "(CN=" + _filterAttribute + ")"; // search.Filter = "(samaccountname=" +...
4 Feb 2013 by Kiran Susarla
Here you go with the method that returns all the group names from AD.All the best. string serverName = string.Empty; GlobalCatalog gcServer = null; DomainController dc = null; try { dc =...
7 Feb 2013 by Taresh Uppal
Hi All, I have a requirement where I need to authenticate a user using his LDAP username and password and once the user is authenticated I want to add the credentials of the user to a XML tag so that next time the log in can be more unique considering the performance. I have search several...
23 Feb 2013 by ananthanunni
Hi.I am developing a library for active directory operations like authentication, create user, delete user, enable/disable user and change password.My library works fair except a few bugs.Issue #1. When I call...UserPrincipal.SetPassword(somePassword); ...the password is simply set...
23 Feb 2013 by Asim Mahmood
May this help you.http://www.c-sharpcorner.com/uploadfile/f9935e/password-policystrength-asp-net-validator-web-control/[^][]
24 Feb 2013 by Member 9723733
Hello, I am able to authenticate the users using the following code through LDAP. Can anyone please suggest me how to retieve the User Id for the corresponding Username. I wanted to kow how can we query LDAP to retrieve the UserID for the coresponding Username.try{ ...
24 Feb 2013 by MalwareTrojan
SELECT userid, username from TableName
7 Mar 2013 by Biswajit Sarkar SIPL
I want to use CollabNetSubversionEdge subversion in windows 7. Local Users can access the subversion using "Local authentication against an htpasswd file along with other providers" but when ever I am choosing "LDAP authentication against an LDAP server:" under "Authentication" tab at the...
4 Apr 2013 by Canafunk
I am looking to implement Automatic Active Directory Logon to one of our intranet Applications. Groups and information needs to extracted from Active Directory The app was coded in CodeCharge Studio 4.3 so I am unable to open of export the project to Visual Studio (Witch in itself is a...
4 Apr 2013 by José Amílcar Casimiro
Hi,This code:strUser = Page.User.Identity.NameReturns the domain and username of current user.When you make a ldap search like this:adsSearch.Filter = "sAMAccountName=" & strUserYou need to remove the domain name from strUser, because you are already querying the domain.Hope...
14 May 2013 by sarvankarthik
I'm writing a web-app that is required to present users with a login screen.Users can enter username/password and select a domain from a dropdown list.how to enumerate all available domains in the server's AD forest even before user login after basic authentication? I came to know that...
4 Jul 2013 by sarvankarthik
Sorry, i just saw you replied. Thanks first of all. Will try and get back to you.
23 Aug 2013 by Radzhab
I connect to ldap server with this lib, but i dont know how get more then 1000 data.
29 Aug 2013 by Ramesh Sreeram
Hi,I need to read content from a text file which contains comma seperated values and insert/store these values in a ldap server.can anyone please help !this is the code that i'm currently having: using (StreamReader sr = new StreamReader("test.txt")) ...
4 Nov 2013 by thatraja
Check thisHow to use the System.DirectoryServices namespace in ASP.NET[^]
1 Dec 2013 by DUNGNV100509
Hello buddyI am creating a Web application (MVC4). I intend to use windows logon information for LDAP authentication. Imaging that: User logon windows with username and password, after that click a link to access web application. Web application needs to be authenticated with LDAP to check...
1 Dec 2013 by Madhu Nair
Yes it is possible. Refer this Link for more details
2 Dec 2013 by DUNGNV100509
Thanks Madhu Nair!But my concern is not authentication method on LDAP. What i want is how to get UserName (Window Logon) and DomainName (Machine where the http Request send from) using C# (MVC). I have searched and used method like: Environment.UserDomainName, or string...
14 Dec 2013 by anyavacy
can someone tell me please how to connect to an LDAP server in java. I have the ip address and the port number of the server
15 Dec 2013 by Darren_vms
I would recommend you look at using one of the API available in java to connect to the LDAP server, I have no experience but people seem to like unboundid[^]or Spring[^]Once you have an API in mind it should be easier to find examples with google./Darren
16 Dec 2013 by s#@!k
Hi,I need to implement authentication using remote service like"http://url.asmx" in my asp.net site.I think this is going to hit active directory/exchange server.I have added the url as webreference but didn't get exactly the authenticate method.. need help with some suggestions.
17 Dec 2013 by ravikhoda
first of all your method should be public in the web service. you can access that method by web reference like this : webreference obj = new webreference ();Result objResut = obj.validateuser(username ,password);objresult can be anything based on the return value of your method....
18 Dec 2013 by s#@!k
Hi,I have url like https://some.world.com/xyz/state.asmxI am new to LDAP authentication Please help me to figure out the LDAP path.or using exchange url how can i authenticate user.What are all we need to authenticate.Please help..
18 Dec 2013 by CHill60
Please try searching for yourself or use Google.I found this in seconds Simple Active Directory Authentication Using LDAP and ASP.NET[^]
23 Dec 2013 by s#@!k
using Microsoft.Exchange.WebServices.Data;public static bool ValidateUser(string userName, string password){ bool _ExchangeConnected = false; try { String domain = "xy"; String exchangeURL = "url"; String email = "aaaa.abc@mail.com"; userName =...
29 Dec 2013 by bluesathish
Hi,I've problem with LDAP authentication of my asp.net application since it was a intranet application my job is to get authenticated using active directory (LDAP). For this i've using the below class.Public Class LDAP Public Const SECURITY_IMPERSONATION_LEVEL_SecurityAnonymous As...
1 Jan 2014 by anuradha.sardesai
In my vb.net code, I'm using LDAP server for authentication, and I want to update attribute values for user only if the user has write permission on that attribute. I would like to know how to do this. I did search some existing articles and questions, but could not find any solution. Any help...
2 Jan 2014 by anuradha.sardesai
I've written VB.Net code to get attribute information from LDAP server. I would like to show user friendly name / description of the attribute. Is there any way of doing this in .Net? Dim originalObj As System.DirectoryServices.DirectoryEntry originalObj =...
3 Jan 2014 by ZurdoDev
As per my comment:System.DirectoryServices is the namespace you'll want to use to work with LDAP. http://msdn.microsoft.com/en-us/library/system.directoryservices%28v=vs.110%29.aspx[^]When you use this if you connect to the user using the user account it will only allow you to update if...
8 Jan 2014 by X.Q.Wang
Background:I have a software with previous code in vs2003. Now I have to add LDAP authendicating. I tried with OpenLdap(download from ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/[^]). But a lot of errors when compelling. as below.I wonder if the mising match with header...
18 Jan 2014 by Member 10532796
Hello everybody I have a big Question to you. I have been searching over hours and I can't find the answer to my Question. I got the folwoing LDIF script from my school and I can't understand why I don't need the Objectclass Top at the organisationunit litec as you can see here:...
23 Apr 2014 by Member 10736689
I have the following code below that should retuurn the fullname of the user logged on. It worked in my other application but for this next application it keeps returning 0. I have added reference to activeds libraby and imported it. Please help.I call the function like this : Dim...
17 May 2014 by leutenent
Hi, everyone. I want to write my own ldap_bind_s() function for my own ldap client library.May you give me your suggestions, please? I don't know if I am supposed to use Winsock or somenthing else inside it.Thank you very much.
16 Jul 2014 by wonder-FOOL
Hello dear CPians,I want to delete a active directory group by using PrincipalContext instead of using DirectoryEntry. Is this possible?I have found how to delete a group by using DirectoryEntry here[^]. Thanks in advance.
22 Jul 2014 by Radzhab
I connect to ldap server with c#. I want search by propertie- (telephoneNumber=*). But if i insert it to code program show me error. This code work perfect. DirectoryEntry searchRoot = null; searchRoot = new DirectoryEntry("LDAP://OU=OrgUnit,DC=dgp,DC=hexl,DC=ru"); ...
22 Jul 2014 by _Amy
Try Application Login through Active Directory (LDAP)[^] and read "Listing the Details of a User"..
6 Aug 2014 by Member 10997710
I am new to C# programming. I have a Ldap login code written with VS2013. I have to reuse this code in a new project written VS2010. But i am trying to rebuild the Ldap login code with VS2010 its throwing error:'Microsoft.AspNet.Identity.UserManagerExtensions.CreateIdentity()' is not...
21 Dec 2014 by raghunath sahoo
We have a requirement for fetching all the mail id of the person in the active directory.It has to use LDAp, PHP and using mac system.If I use a wild card entry then we would get a list of people but is there any API to fecth a particlar like "mail" from list of searches.Thanks.
22 Dec 2014 by Maciej Los
In addition to Solution1 by Kornfeld Eliyahu Peter[^]Refer this: How to Create Custom Active Directory LDAP Searches[^]