Share this page

# LDAP protocol example script

All LDAP functions come in pairs—one for global sessions and one where you can indicate a specific session. To apply the action to all sessions, use the version without the ex suffix. To apply the action to a specific session, use the version with the session identifier with the ex suffix. For example, mldap_logon logs on to the LDAP server globally, while mldap_logon_ex logs on to the LDAP server for a specific session.

In the following example, the user logs on to an LDAP server, ldap1. It adds an entry and then renames the OU attribute from Sales to Marketing.

    Action()
    {
    // Logon to the LDAP servermldap_logon("Login",
                    "URL=ldap://johnsmith:tiger@ldap1:80",                LAST);// Add an entry for Sally R. Jonesmldap_add("LDAP Add",          "DN=cn=Sally R. Jones,OU=Sales, DC=com",          "Name=givenName", "Value=Sally", ENDITEM,          "Name=initials", "Value=R", ENDITEM,          "Name=sn", "Value=Jones", ENDITEM,          "Name=objectClass", "Value=contact", ENDITEM,          LAST);// Rename Sally's OU to Marketingmldap_rename("LDAP Rename",             "DN=CN=Sally R. Jones,OU=Sales,DC=com",             "NewDN=OU=Marketing",             LAST);// Logout from the LDAP servermldap_logoff();
        return 0;
    }

Back to top
https://admhelp.microfocus.com VuGen,Professional Performance Engineering,Performance Engineering for Developers 8942
Tips to improve your search results... OpenText™ Virtual User Generator Help Center OpenText™ VuGen Help 26.1 All View Local Help Center View Online Help Center Version: