Announcement

Collapse
No announcement yet.

LDAP Group query

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • LDAP Group query

    Hi,

    I'm trying to do an LDAP query from AD which will give me the members of a group but who are not members of a few other groups

    ie if I had 100 members in one group but 90 of these were in other groups, then I need to be able to pull out the 10 members who are in that group ONLY??

    Pls help!!!

  • #2
    Re: LDAP Group query

    Don't think so; unless you're using an LDAP-aware query writer to access AD. Personally I would do one query for members of one group, and another query for members of the other group.

    I would then use a text editor or spreadsheet to compare the two and produce an output file with only the non-matching records.


    Tom
    For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

    Anything you say will be misquoted and used against you

    Comment


    • #3
      Re: LDAP Group query

      Find User accounts that are
      member of: cn=GroupA,ou=Company Groups,dc=domain,dc=local
      not member of: cn=GroupB,ou=Company Groups,dc=domain,dc=local
      not member of: cn=GroupC,ou=Company Groups,dc=domain,dc=local

      Try this,
      Code:
      (&(objectCategory=person)(ObjectClass=user)(|(memberOf=cn=GroupA,ou=Company Groups,dc=domain,dc=local))(!(|(memberOf=cn=GroupB,ou=Company Groups,dc=domain,dc=local)(memberOf=cn=GroupC,ou=Company Groups,dc=domain,dc=local))))
      \Rems

      This posting is provided "AS IS" with no warranties, and confers no rights.

      __________________

      ** Remember to give credit where credit's due **
      and leave Reputation Points for meaningful posts

      Comment


      • #4
        Re: LDAP Group query

        OK, I am rubbish, you are good. LOL.

        Nice one REMS


        Tom
        For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

        Anything you say will be misquoted and used against you

        Comment


        • #5
          Re: LDAP Group query

          Originally posted by Rems View Post
          Try this,
          Code:
          (&(objectCategory=person)(ObjectClass=user)(|(memberOf=cn=GroupA,ou=Company Groups,dc=domain,dc=local))(!(|(memberOf=cn=GroupB,ou=Company Groups,dc=domain,dc=local)(memberOf=cn=GroupC,ou=Company Groups,dc=domain,dc=local))))
          \Rems
          That'll work ok, but I think all the groups in the organisation need to be included in the query though. Which makes it a huge task.
          But I suppose such is the nature of the request.
          Caesar's cipher - 3

          ZKHQ BRX HYHQWXDOOB GHFLSKHU WKLV BRX ZLOO UHDOLVH LW ZDV D ZDVWH RI WLPH!

          SFX JNRS FC U6 MNGR

          Comment

          Working...
          X