Vim Tips Wiki
(Change <tt> to <code>, perhaps also minor tweak.)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
  +
{{ScriptComments|ldap: Active Directory email lookup using Python and LDAP}}
  +
  +
==Overview==
 
ldap.vim searches a ldap-directory for a username. If the user is found, the script returns the full name of the user along with an e-mail address to vim.
 
ldap.vim searches a ldap-directory for a username. If the user is found, the script returns the full name of the user along with an e-mail address to vim.
   
Line 4: Line 7:
   
 
The script uses the following default settings that you might want to change:
 
The script uses the following default settings that you might want to change:
* Scope: subtree
+
*Scope: subtree
* Searchstring: "mailNickname=%s*"
+
*Searchstring: "mailNickname=%s*"
* Field that contains full name: "name"
+
*Field that contains full name: "name"
* Field that contains mail address: "mail"
+
*Field that contains mail address: "mail"
   
 
==Troubleshooting==
 
==Troubleshooting==
 
 
Fieldnames may vary in different LDAP-implementations. Therefore, you might not get the search result you expected. The easiest way to fix this is to manually search your LDAP-directory with a tool, and then configure the script with the correct fieldnames.
 
Fieldnames may vary in different LDAP-implementations. Therefore, you might not get the search result you expected. The easiest way to fix this is to manually search your LDAP-directory with a tool, and then configure the script with the correct fieldnames.
   
 
If you don't have a favorite LDAP-search tool, open python and replicate the open connection and login statements from the script. Then change the search string until you get a correct result. Verify that the fields containing the full name and e-mail address are correct. If not, modify the script with the correct field names.
 
If you don't have a favorite LDAP-search tool, open python and replicate the open connection and login statements from the script. Then change the search string until you get a correct result. Verify that the fields containing the full name and e-mail address are correct. If not, modify the script with the correct field names.
 
==References==
 
   
 
==Comments==
 
==Comments==

Latest revision as of 09:40, 14 July 2012

Use this page to discuss script 1372 ldap: Active Directory email lookup using Python and LDAP

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Overview[]

ldap.vim searches a ldap-directory for a username. If the user is found, the script returns the full name of the user along with an e-mail address to vim.

If no match is found, the script returns the string "NF".

The script uses the following default settings that you might want to change:

  • Scope: subtree
  • Searchstring: "mailNickname=%s*"
  • Field that contains full name: "name"
  • Field that contains mail address: "mail"

Troubleshooting[]

Fieldnames may vary in different LDAP-implementations. Therefore, you might not get the search result you expected. The easiest way to fix this is to manually search your LDAP-directory with a tool, and then configure the script with the correct fieldnames.

If you don't have a favorite LDAP-search tool, open python and replicate the open connection and login statements from the script. Then change the search string until you get a correct result. Verify that the fields containing the full name and e-mail address are correct. If not, modify the script with the correct field names.

Comments[]