I'm trying to make a bash script to read LDAP (from MS active directory with ldapsearch), extract the fields 'mail', 'division', 'memberOf', 'userAccountControl', 'uidNumber', 'name', 'sAMAccountName' and save in a mysql database.
I have extracted the fields with ldapsearch but I am not clear how to parse user by user and enter it in the database.
But when i tried to use this ldapsearch and parser i have the last user in the result, example:
Result:
Hi guys,
I very appreciate for answering to my previous query.
I have encountered another problem.I have a perl script to display required networking information like DNS,gateway,etc. to be changed in a remote computer which is to be added to a computing cluster.
I need a script which... (0 Replies)
We have an application that uses Active directory to authenticate the users. the admins of the app. were complaining because the windows domain controller they are going against is not very stable. I wrote a shell script using ldapsearch to look up a user against the domain controller their app... (2 Replies)
I have a script that iterates through all the users that have logged in to the system for the past day and pulls out their role(s), adding them to a file.
The iteration part is working just fine, but the issue I have is with the result. When I do the LDAP query, the results I get are:
... (2 Replies)
Hello all
I would like to know if it's possible to extract users from Active Directory and parse the output to obtain a XML file with specific format.
So the AD is a windows machine, and I would like to extract from a red hat linux serveur. I try ldapsearch command and ok I'm abble to extract... (5 Replies)
Hi,
Is there way to count the number of results in the ldapsearch, looking at the manpages i dont see an option,
Using the following ldapsearch command to list attribute (User-Id=100) under my ObjectClass=my-Process, returns the entries matching the User-Id=100, and the problem i face here is... (0 Replies)
Hi all,
I've been searching for ldapsearch function these few days. Still I couldn't found the solution.
I would like to translate this query
ldapsearch -x -LLL -h new_IP -p new_Port -D "cn=jw" -w "dummy" -b
"id=2311,o=WC,c=jp" -s sub
to ldap_search_ext_s() function in C program.
... (0 Replies)
Never knew of this command ldapsearch, but I would like to use it to lookup a single user and return where their office is.
Is this possible?
I'm totally starting from scratch. I already saw some of the gurus say read the man page, which is pretty greek when you don't know the details of... (1 Reply)
Hi
I'm not familiar with ldap and I hope someone to help me.
I need to get some attribute value from ldap DB.
When i run the following command is OK:
ldapsearch -h localhost -p 16611 -x -D cn=user -w passwd -b msisdn=359502479649,dc=MSISDN,DC=C-NTDB "(objectClass=SUBINNSS)" refinmocNAME
the... (0 Replies)
All,
New to this forum and unix here so please forgive any silly questions. I am on a Solaris 10 machine and need a script to query our Windows Domain controller to determine if a user is active or not. Man files were helpful enough and it worked.
The Challenge is the program doesn't exit... (1 Reply)
When I execute the code below with cn set to the $adgroup variable, I get the following error:
Invalid DN syntax (34)
Additional information: 0000208F: NameErr: DSID-031001F7, problem 2006 (BAD_NAME), data 8349, best match of:
,ou=Resource,ou=groups,dc=abc,dc=somecompany,dc=com'
If I set cn... (6 Replies)
Discussion started by: who10
6 Replies
LEARN ABOUT CENTOS
fixup-memberof.pl
FIXUP-MEMBEROF.PL(8) System Manager's Manual FIXUP-MEMBEROF.PL(8)NAME
fixup-memberof.pl - Directory Server perl script for memberOf attributes.
SYNOPSIS
fixup-memberof.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } -b baseDN [-f filter] [-P protocol] [-v] [-h]
DESCRIPTION
Regenerates and updates memberOf on user entries to coordinate changes in group membership.
OPTIONS
A summary of options is included below:
-Z Server Identifier
The server ID of the Directory Server instance. If there is only one instance on the system, this option can be skipped.
-D Root DN
The Directory Manager DN, or root DN. If not specified, the script will search the server instance configuration for the value.
-w password
The rootdn password.
-w -
Prompt for the rootdn password.
-j password filename
The name of the file that contains the root DN password.
-b baseDN
The DN of the subtree containing the entries to update.
-f filter
An LDAP query filter to use to select the entries within the subtree to update. If there is no filter set, then the memberOf
attribute is regenerated for every entry in the subtree that has the objectclass inetuser/inetadmin.
-P protocol
The connection protocol to connect to the Directory Server. Protocols are STARTTLS, LDAPS, LDAPI, and LDAP. If this option is
skipped, the most secure protocol that is available is used. For LDAPI, AUTOBIND is also available for the root user.
-v
Display verbose ouput
-h
Display usage
EXAMPLE
fixup-memberof.pl -Z instance1 -D 'cn=directory manager' -w password -b 'dc=example,dc=com' -P STARTTLS
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available
protocol automatically.
fixup-memberof.pl -w password -b 'dc=example,dc=com' -f 'uid=*'
DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a non-zero exit status and a diagnostic message being written to standard error.
AUTHOR
fixup-memberof.pl was written by the 389 Project.
REPORTING BUGS
Report bugs to http://bugzilla.redhat.com.
COPYRIGHT
Copyright (C) 2013 Red Hat, Inc.
Mar 5, 2013 FIXUP-MEMBEROF.PL(8)