Find a user exists in Windows Active Directory or LDAP using a shell script
I'm trying to see what command / script can I use to find out a user "c123456" or "e123456" or "u123344" exists in Windows Active Directory or LDAP from a Linux machine.
I know ldapsearch command will be used but not recalling what all options I can use to test this.
The script will echo if user exists or not.
Lets say my LDAP url is:
Need help. Thanks.
Something like this ? (be aware of non tested script...)
Getting this error:
# search result
result: 1 Operations error
text: 00000000: LdapErr: DSID-0C090627, comment: In order to perform this ope
ration a successful bind must be completed on the connection., data 0, vece
(when running with sh -x option):
+ grep numEntries
+ '[' 1 -eq 0 ']'
Changed the command in the script to:
you can use:
For ex: after -LLL in the command, if you those fields as per the command below, for ex:
Just wondering how to run this command with -w <password> thing.
|All times are GMT -5. The time now is 07:13 PM.|