FOAK: LDAP searching with (!)

Discussion in 'UK Motorcycles' started by HooDooWitch, Oct 1, 2004.

  1. HooDooWitch

    HooDooWitch Guest

    I'm trying to get some data out of an LDAP Db.

    # This lists all users who have a role of xxxx
    ldapsearch
    -h my.ldap.db
    -p 389
    -b "o=x,o=y"
    -D "cn=Dir Man"
    -w <password>
    -s sub "role=xxxx" uid:

    # I want to list anyone who *doesn't* have that role.
    # This doesn't work
    -s sub "!role=xxxx" uid:
    # Nor did
    -s sub "!(role=xxxx)" uid:
    # Neither did
    -s sub "(!(role=xxxx))" uid:
    #I haven't tried
    -s sub "(!role=xxxx)" uid:
    #yet 'cos I reckon that's a no brainer...
    #and googling was *not* my friend.
     
    HooDooWitch, Oct 1, 2004
    #1
    1. Advertisements

  2. HooDooWitch

    Mo Guest

    Off the top of my head I don't know the answer, but maybe a
    change of tack might help.
    Have you tried the M/Soft DSQUERY command line (and it's
    relations)? As I'm not at work I can't experiment -
    http://tinyurl.com/3w85c
     
    Mo, Oct 1, 2004
    #2
    1. Advertisements

  3. HooDooWitch

    dwb Guest

    Stupid suggestion ... um.. != or maybe <> ?
     
    dwb, Oct 1, 2004
    #3
  4. HooDooWitch

    HooDooWitch Guest

    I like your thinking, but it may not work as it's an LDAP on a UNIX
    box. I'll see if I can configure something ... but don't hold your
    your breath....
     
    HooDooWitch, Oct 5, 2004
    #4
  5. HooDooWitch

    HooDooWitch Guest

    Aye, I tried them too. I'm currently extracting ALL, extracting the
    role I don't want, and running a diff.

    Messy, but it's working. Cheers anyup.
     
    HooDooWitch, Oct 5, 2004
    #5
  6. HooDooWitch

    flash@work Guest

    Headcount?
     
    flash@work, Oct 5, 2004
    #6
  7. HooDooWitch

    flash@work Guest

    A 100 percent increase in slapheads then?

    Congratulations!
     
    flash@work, Oct 5, 2004
    #7
  8. HooDooWitch

    HooDooWitch Guest

    2 and 5/5ths
     
    HooDooWitch, Oct 5, 2004
    #8
  9. HooDooWitch

    HooDooWitch Guest

    Whoooah, back up there buddy! ...

    #1 - Even with one of these all over (administered Sunday), I'm still
    technically partially hirsute.
    2 - 4 It's already got more hair than me, verified via ultrasound, so
    the slaphead count will remain at 1.
    5/5ths = "locked & loaded" no more. Waters remain unparted.
    8th It's due Friday.
     
    HooDooWitch, Oct 5, 2004
    #9
  10. HooDooWitch

    flash@work Guest

    Oh. For some reason I was equating 5/5ths =1. Ho hum. Have you seen your
    wind story this week?
     
    flash@work, Oct 5, 2004
    #10
  11. HooDooWitch

    HooDooWitch Guest

    Not in Midwife maths.
    Excellent stuff! This comedy writing's a piece of piss.
     
    HooDooWitch, Oct 5, 2004
    #11
  12. HooDooWitch

    HooDooWitch Guest

    Latest update, for those of you who are biting your nails off with
    excitement, ...

    Single quotes is the key...
    -s sub '(!(role=xxxx))' uid:
    works
    -s sub "(!(role=xxxx))" uid:
    does not.

    .... fucking pedantic, inconsitent syntax.
     
    HooDooWitch, Oct 5, 2004
    #12
  13. HooDooWitch

    Mo Guest

    Ah - sorry I'm soaked in M/Soft and as you know it makes your
    brain go all mushy.
     
    Mo, Oct 5, 2004
    #13
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.