CFLDAP and searching members of a group

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Re: CFLDAP and searching members of a group

    First, change the delimiter in your query that polls the group members by
    adding separator=?|?:

    Example:
    <cfldap action="QUERY" name="GETGROUPMEMBER" attributes="member"
    start="#GETDOMAININFO.STARTVARIABLE#" scope="SUBTREE" startrow="1"
    maxrows="100000" filter="dn=<insert distinguished name>" separator=?|?
    server="#GETDOMAININFO.DOMAINSERVER#" port="389" timeout="20"
    username="#GETDOMAININFO.DOMAINADMINISTRATOR#"
    password="#GETDOMAININFO.DOMAINPASSWORD#">


    Second, use CFLDAP to get the "dn" or distinguished name (The CN name you
    refer to) by using filter="samAccountName=<enter samaccount name here>".

    Example:
    <cfldap action="QUERY" name="GETVALUE" attributes="dn"
    start="#GETDOMAININFO.STARTVARIABLE#" scope="SUBTREE" startrow="1"
    maxrows="100000" filter="samAccountName=<insert samaccount name>"
    server="#GETDOMAININFO.DOMAINSERVER#" port="389" timeout="20"
    username="#GETDOMAININFO.DOMAINADMINISTRATOR#"
    password="#GETDOMAININFO.DOMAINPASSWORD#">

    Lastly, check to see if the "dn" is in the "member" attribute of your group.
    Use LISTFINDNOCASE(GETGROUPMEMBER.MEMBER, GETVALUE.DN, "|") to search the
    member attribute for the matching dn you got from the query above.

    JC


    J.C. Guest

  2. Similar Questions and Discussions

    1. AD and adding group members via CFLDAP
      I posted this over in Advanced techniques with only one brave, yet unfortunately uninformed taker... Anyone here have a clue as to why I'd get the...
    2. May 29 Sydney Developers Group study group
      On Monday 29th May, we'll be studying Actionscript 3. Please read the articles prior to the meeting (see <a target=_blank...
    3. CFLDAP
      Hi, I've never used this tag before and its causing me some problems. (see attached code) Regarding the start attribute what does 'cn' and 'c'...
    4. CFLDAP to ASP
      Does anyone know how to convert the following CFLDAP code to ASP? I have had no luck. <cfldap action="query" name="testldap"...
    5. group 2 members into one
      Hi, is it possible to group 2 castmembers into one? i want to group a vector member with field member to one complete member. is this...
  3. #2

    Default Re: CFLDAP and searching members of a group

    actually what I did was...

    <cfldap
    action="QUERY"
    name="finduser"
    attributes="memberof"
    start="DC=mydomain"
    scope="subtree"
    filter="samaccountname=#session.userid#"
    server="127.0.0.1"
    username="joeblow"
    password="*******"
    separator=";">



    <cfset Users = #ValueList(finduser.memberof, ";")#>
    <!--- this shows the number position of the group in the list, returns 0 if
    not in the list--->
    <cfset showSUAuser = #ListContainsNoCase(Users,"CN=blahblah",";")#>

    Then i just check to see if showsuauser is not 0 and away we go. Simple and it
    works. Nice thing is I can search for multiple groups this way.

    JoeyTMann Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139