Query SQL database via web portal

General discussion of using Adaxes for Active Directory management and administration
Post Reply
Posts: 1
Joined: Sat Jan 19, 2019 2:34 am

Query SQL database via web portal

Tue Feb 12, 2019 9:52 pm

I have filled CustomAttributeText1 with a comma delimited list of numbers for a user. These numbers are unique identifiers for locations stored in out MS SQL database table.
I want to be able to get this list when I select the user from a drop down and use it to query a MS SQL database table to match it with the location names. I then want to display these location names on the web portal so that web portal users can see the locations that the user is tied to.
Is there a way for me to do this kind of customization to the web portal? Can you direct me towards tutorials for this sort of thing?


User avatar
Site Admin
Posts: 2334
Joined: Thu Apr 23, 2009 2:28 am

Re: Query SQL database via web portal

Wed Feb 13, 2019 11:03 am

Hello Angela,

What version of Adaxes are you currently using? To check that:
  1. Launch Adaxes Administration Console.
  2. In the Console Tree, right-click your service.
  3. In the context menu, click Properties.
    Service.properties.png (8.05 KiB) Viewed 41 times
  4. Adaxes version will be displayed on the General tab.
    Service.version.png (8.16 KiB) Viewed 41 times
Do we understand correctly that you want to select a user from a drop-down list to display the locations tied to the selected user? If we do, we recommend the following approach:
  1. A Scheduled Task will execute a PowerShell script for all users that have the CustomAttributeText1 not empty, query your MS SQL Database for locations and save them to a custom multi-value attribute (e.g. CustomAttributeTextMultiValue1) according to the IDs.
  2. To see the locations, you will simply add the custom attribute to the View User form or create a separate action that will display only the locations.
For an example of the script, have a look at the following script in our repository: https://www.adaxes.com/script-repositor ... e-s249.htm. If you have issues updating the script for the solution, we will help you.

If you do not want to store the locations in user properties and just want to display them on demand, you can use the above script to query your database for locations and then display them in the Execution log.

For your information, we recommend using custom multi-value attributes (e.g. CustomAttributeTextMultiValue1) instead of text ones (e.g. CustomAttributeText1) for convenient management of properties which contain the values.
Active Directory Identity Management

Follow Adaxes in social networks
Image Image Image Image

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests