Home Forums OS X Server and Client Discussion Open Directory Finding userID’s currently in use for LDAP users

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #358953
    roobieroo
    Participant

    Is it possible to use dscl or another command to list out not only users on an LDAPv3 server but to provide the userid’s as well? I know I can run dscl /LDAPv3/127.0.0.1 -list /Users to get all the current users but I’d like to know what ID’s are in use by them as well. I’d also like to get a similar report for group ID’s. I know this is possible with netinfo data with nireport but I’d love to know how to get this from LDAP as well.

    #358983
    roobieroo
    Participant

    Sweet. Thank you so much. I was trying to figure out exactly how this works so I looked a the xargs man page and the following passage makes my head want to explode. This make sense to people?

    -I replstr
    Execute utility for each input line, replacing one or more
    occurences of replstr in up to replacements (or 5 if no -R flag
    is specified) arguments to utility with the entire line of input. Eek!

    I take it they assume you know what the hell replstr means since it’s not really explained at all in the man page and I also don’t quite understand the “in up to replacements” line either. Oh well, it works.

    I actually had to change your command just a bit. Here’s what worked in case anyone else is interested.

    dscl /LDAPv3/127.0.0.1 -list /Users | xargs -I % dscl /LDAPv3/127.0.0.1 -read /Users/% RealName UniqueID

    Thanks again!

    #360102
    Anonymous
    Guest

    I ran into that problem as well and I didn’t want to update my old scripts using nireport. So I wrote a pretty simple shell script, dsreport.bash that reports on the odm’s. It follows the same syntax as nireport, however the ouput looks different (because dscl’s output is different). If it will save any of you time, go ahead and use it.

    http://homepage.mac.com/terencekent

    #360103
    Anonymous
    Guest

    Updated the script, in case anybody is using it. The output will now be in the same format as nireport. Only difference is the properties you search for are not the same as in a netinfo database. Simply because the properties have different names. If you change your property names then dsreport.bash should allow you to use your existing nireport scripts with directory services.

    Terry.

    #360125
    Anonymous
    Guest

    Seems to be ok using safari and IE on OS X. I noticed some systems like to associate .bash files with office for some reason, the file itself comes down fine (and works ok as well) if you vi it or use an editor to view it, you’ll notice it is ok. Maybe that is what you ran into?

    Just in case I gzipped the file so hopefully that won’t be an issue.

    Terry.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Comments are closed