ldap-query

How can I enable or disable an AD user account with an LDAP request?

巧了我就是萌 提交于 2019-12-10 15:26:13
问题 So far I was able to find users in LDAP but I don't know how can I enable or disable them. As a second question, if my account has Domain Admin rights, I will be able to enable or disable account from LDAP or not? Note: This is about a Microsoft Active Directory running on Windows 2003. I know that I can check active uses with: (!(useraccountcontrol:1.2.840.113556.1.4.803:=2)) Disabled useds: (useraccountcontrol:1.2.840.113556.1.4.803:=2) The question is how do I set the attribute in such way

Bad search filter on LDAP when trying to get user data

蹲街弑〆低调 提交于 2019-12-10 13:00:46
问题 I am fresh out of the box here with LDAP, so let me know if I am doing this in the completely wrong fashion. I am working with Symfony 1.4 using the bhLDAPAuthPlugin plugin I am verifying user login with LDAP. However, there is more data in the LDAP table that I would like to query using the username. So I am writing this search function to filter results according to the username: function user_values($username) { if (!$username) { die ("Username is not there man!"); } if (!$this->_conn) {

Why does Spring LDAP's LdapTemplate not return title, department & company attributes?

梦想与她 提交于 2019-12-10 12:59:47
问题 I'm using spring-ldap-core-2.3.1.RELEASE.jar over JDK 1.8 & Tomcat 8.0 to access AD information through LdapTemplate . The attributes such as title , department & company are not being returned by the ldapTemplate.search(..,.,..) method. I'm using the following lines of code to search :- LdapQuery ldapQuery = LdapQueryBuilder.query() .where("objectclass").is("user") .and("objectcategory").is("person") .and("cn").like(strWildcardText+"*"); ldapTemplate.search(ldapQuery, new

ldap filter for distinguishedName

倖福魔咒の 提交于 2019-12-10 04:17:00
问题 I am successfully querying our Active Directory for a user with the following code: $filter = (&(objectCategory=person)(samaccountname=someusername)); $fields = array("samaccountname","mail","manager","department","displayname","objectGUID"); $user = ldap_search($ldapconnection, $baseDn, $filter, $fields); The resulting array gives this value for the manager attribute: CN=McBossy\, Boss,OU=Users,OU=CentralOffice,DC=ds,DC=example,DC=com This looks like a distinguishedName to me. But when I try

Using DN in Search Filter

狂风中的少年 提交于 2019-12-09 04:25:06
问题 In my LDAP Client program sometimes I have to include the DN value within the search filter. But this DN is changing frequently and every I have to change this filter in my code. When I googled it for that I got something like this Suppose you want to pull all users of ObjectType = Person from the R&D and HR ous, but not any users from Marketing and PM. The filter would be: (&(objectClass=person)(|(ou:dn:=ResearchAndDevelopment)(ou:dn:=HumanResources))) Can anybody explain this more in detail

LDAP Filter - Find all users of specific OU

只愿长相守 提交于 2019-12-07 12:29:24
问题 I am having trouble with an LDAP Search Filter . What I am needing to retrieve is all the users of a specific LDAP group that is OU=Staff,OU=Users,OU=Accounts,DC=test,DC=local My search is: (&(objectCategory=user)(OU=Staff,OU=Users,OU=Accounts,DC=test,DC=local)) Currently it is returning no results. What am I missing? 回答1: You must do two things Set the base of the search OU=Staff,OU=Users,OU=Accounts,DC=test,DC=local Search for the objects with the objectClass . Using PHP, the search would

Error 2147463168 when trying to bind to an AD User Object

走远了吗. 提交于 2019-12-06 06:05:53
I'm working on a Windows 2012 (NOT R2 and can't upgrade) AD environment. When I run the following piece of code from vbscript with an admin (not administrator) account, it runs perfectly. However when I run it with a normal user, I get a -2147463168 which seems to be a binding error. On error Resume next UsuariosLDAP = "LDAP://" & objSysInfo.UserNameSet ObjUser = GetObject(UsuariosLDAP) If err.number <> 0 then strTipoError = "Error buscando objeto en LDAP " & CStr(Err.Number) & " Usuario:" & objSysInfo.UserName shell.logevent 1, strTipoError Wscript.Quit end if As it runs correctly with an

LDAP group membership (including Domain Users)

亡梦爱人 提交于 2019-12-06 06:02:26
问题 How can I get a list of users within an LDAP group, even if that group happens to be the primary group for some users? For example, suppose "Domain Users" is "Domain Leute" in German. I want all members of "CN=Domain Leute,DC=mycompany,DC=com". How would I know that is the well-known "Domain Users" group? Or what if some users' primary group was changed to "CN=rebels,DC=mycompany,DC=com", and I wanted to get members of THAT group? Users don't have a memberOf property for their primary group,

How can I make a LDAP query that returns only groups having OU=Groups from all levels?

两盒软妹~` 提交于 2019-12-05 05:40:37
问题 If I am looking for all Groups , I get too much garbage. If I try to narrow down the base, I get too few. Here is an example: CN=A Team,OU=Groups,OU=Americas,DC=example,DC=com CN=B TEAM,OU=Groups,OU=EMEA,DC=example,DC=com CN=C Team,OU=Legacy Groups,DC=example,DC=com CN=D Team,OU=Groups,OU=Bangalore,OU=APAC,DC=example,DC=com CN=E Team,OU=Common Groups,DC=example,DC=com I am looking for a LDAP filter that returns A B D E (without C) - mainly the logic would be get me all groups that do have

how to get DN in LDAP with user ID using UnboundID LDAP SDK

戏子无情 提交于 2019-12-05 04:54:19
问题 I'm trying to get a DN ( could be more than one ) of a user when the only parameter i have is the user-id also i'm using UnboundID LDap SDK as you can see: public String getCustomerAdminDN(String uid) { String result =null; String filter = "uid=" +uid; try { SearchResult searchResult = this.ldapConnection.search("",SearchScope.SUB,filter); result = searchResult.getMatchedDN(); } catch (LDAPSearchException e) { throw new RuntimeException("Error in the searching query :" + e.getMessage()); }