Highlighted
Honored Contributor.
Honored Contributor.
667 views

Where is LDAP Directory Base info stored?

Jump to solution

I have a working script that I can add a new AD user into ALM, add them to a specified project, and assign a specific role.

Currently I'm hard coding my AD lookup path in my script when I search for the user to add and I'd prefer to be able to pull that 'LDAP://DC=ads,DC=HP,DC=com' from ALM.  I added it to the Directory base when I setup ALM but I can't figure out where to read that info from the backend to use in my script.

 

This is my AD query I use to find the user to add which is currently using the hard coded LDAP info.

SELECT sAMAccountName, cn, title, department, manager, distinguishedName, mail FROM 'LDAP://DC=ads,DC=hp,DC=com'
WHERE objectCategory='user' AND (sAMAccountName='" & NewUsrSearch & "' or cn='*" & NewUsrSearch & "*')
And userAccountControl=512 order by sAMAccountName
Tags (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Honored Contributor.
Honored Contributor.

FOUND IT!

edit:  This is for 12.01 that I origionally needed it for.

Select PARAM_VALUE From qcsiteadmin_db.td.PARAMS Where PARAM_NAME = 'LDAP_DIRECTORY_BASE'

 

12.55 that I just upgraded to, ldap has it's own table in the site admin schema.  note:  you may need to use .td. instead of .dbo.

Select * From qcsiteadmin_db.dbo.LDAP_SERVERS

 

Fresh eyes really help!

View solution in original post

0 Likes
3 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

You need the US_DOM_AUTH column from the USERS table in the Site Admin DB.

I suggest you use the Site Admin API GetUser method to get the information.

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

The Users table only stores info on individual users.  It doesn't have the Directory Base in there.  I suppose I could just grab the first record where US_DOM_AUTH <> "" and then just grab the DC= sections out of the string... but I was hoping for where ever the Admin page stores the Directory Base it uses when manually searching for an AD user to add.

 

As for GetUser that's a pretty nasty function as if the User is not found the function doesn't return a nice False, or 0, it errors out and I don't like to trap error.  I ended up using GetAllUsers to return a full xml string of everyone in the system.  I then do a InStr to see if the new users DN exists in the XML since they are always unique.  If the DN is not found, I add them, then add to the project/role.  If user was found, I just add them to the Project/Role selected.

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

FOUND IT!

edit:  This is for 12.01 that I origionally needed it for.

Select PARAM_VALUE From qcsiteadmin_db.td.PARAMS Where PARAM_NAME = 'LDAP_DIRECTORY_BASE'

 

12.55 that I just upgraded to, ldap has it's own table in the site admin schema.  note:  you may need to use .td. instead of .dbo.

Select * From qcsiteadmin_db.dbo.LDAP_SERVERS

 

Fresh eyes really help!

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.