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. [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => JoeyTMann [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => 1 [isfirstshown] => [attachments] => [allattachments] => ) --> CFLDAP and searching members of a group - Coldfusion - Advanced Techniques

CFLDAP and searching members of a group - Coldfusion - Advanced Techniques

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 ...

  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. #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="joe"
    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

Similar Threads

  1. AD and adding group members via CFLDAP
    By dnagel in forum Coldfusion Database Access
    Replies: 1
    Last Post: June 23rd, 08:37 PM
  2. May 29 Sydney Developers Group study group
    By 105 in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: May 25th, 02:56 PM
  3. CFLDAP
    By Mattastic in forum Coldfusion - Getting Started
    Replies: 17
    Last Post: August 4th, 06:26 PM
  4. group 2 members into one
    By clera webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 1
    Last Post: October 23rd, 07:29 PM

Bookmarks

Posting Permissions

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