Home › Forums › OS X Server and Client Discussion › Open Directory › Finding userID’s currently in use for LDAP users
- This topic has 8 replies, 2 voices, and was last updated 20 years, 4 months ago by
afp548contributor.
-
AuthorPosts
-
August 31, 2004 at 1:04 am #358953
roobieroo
ParticipantIs 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.
September 3, 2004 at 5:38 am #358983roobieroo
ParticipantSweet. 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.
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!
December 5, 2004 at 7:06 pm #360102Anonymous
GuestI 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.
December 5, 2004 at 9:24 pm #360103Anonymous
GuestUpdated 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.
December 8, 2004 at 7:17 pm #360125Anonymous
GuestSeems 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.
-
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed