Need to access properties/details of Active directory user programmatically in confluence

Hi All,

I need to access properties/details of Active directory user programmatically in confluence.
Active directory with LDAP is configured in the server.
For example : address is a field present in active directory for a user. I want to access it programatically and store it in database in confluence using active objects.
Please advice.

Thanks in advance.