This topic is locked

Active Directory Attributes

5/22/2018 4:30:07 PM
ASPRunner.NET General questions
I
i.NoLim author

Hello,
I would like to auto populate a few fields using AD attributes. After successfully logging in, I normally use something like this: XSession.Session["UserName"] or XSession.Session["UserID"]. The fields I'm looking to auto populate are 'Department' and 'Title.' I've tried substituting "UserName" with "department," "title," and "personalTitle" to no success.
Am I missing something? Do I have to create these variables before referencing them? If so, what's the correct way to do it?
Thank you.

P
pinoyoutdoor 5/22/2018

We are exactly on the same page, I'm also troubleshooting this...needed those department, title, email and phone attributes...
Hope someone have experience on this....
Phprunner user...

Pete K 5/23/2018

As far as I know, there is no way to do this within the ASPR framework, but you can use DotNet libraries to query AD and write custom code, although I've never done it that way. What we have done is we build a SQL database nightly using a Powershell script that queries AD. I add this database to my ASPRunner.Net apps, then I add code after the login event to pull in the additional data.

jadachDevClub member 5/23/2018



As far as I know, there is no way to do this within the ASPR framework, but you can use DotNet libraries to query AD and write custom code, although I've never done it that way. What we have done is we build a SQL database nightly using a Powershell script that queries AD. I add this database to my ASPRunner.Net apps, then I add code after the login event to pull in the additional data.


I think you are right Pete. We do the same thing. We use PowerShell for AD plus we have access to the HR database which helps a lot.

admin 5/23/2018

We do not have a built-in functionality for this. We'll add something in the future.

I
i.NoLim author 5/23/2018

Thank you for all your responses. I will look into this and post any updates and/or questions.

Pete K 5/24/2018



We do not have a built-in functionality for this. We'll add something in the future.


That would be very helpful.

admin 5/24/2018

Btw, check AfterSuccessfulLogin event and data array. In case of AD login it might contain some attributes from AD there. Share your results, it depends on many things.

H
heilmanmd 6/25/2018

Just for info if anyone is interested....
I get numerous AD attributes by doing a shell out to command line on the server side
which runs a powershell ( ps1 ) file that pulls the groups / members / attributes into a csv file
and then runs a command line DB command to import the info into DB table
All in all works fairly fast ( depending on how heavy a load is on your AD server )
If you wish more details, let me know and can provide.
p.s.

Please note our sites are behind double firewalls with no external internet access
so, as Sergey pointed out to me when I did this, it may not be for everyone...
Best

Mark,

Big Timber, Montana