We have a custom attribute in Active directory for all users, say 'HCODE' and I have to access 'HCODE' based on logged in user and to pass that value to the SSRS reports.

So far I have done this with custom C# code (dll). But is this the way to go? Does sharepoint user profile reflects the custom attribute by default?

Please suggest your ideas. Appreciate your help.

2 Answers 2


I think you have two options,

First Option - directly to query AD and get the required field.

Second Option:

  • Create new Property Mapping in the user profile

  • Then run Full sync, it will populate the property in UPA. Now you can retrieve it from UPA.

  • Your link helped me. I got a doubt here(sorry I am a newbee in sharepoint). I want to create it as a common component for all the web parts that is going to require UPA access. So here can I use custom common dll without registring it in GAC?
    – Maddy
    Mar 25, 2015 at 17:07

You can add this as a property in User Profile Service Application, then get it synced as part of AD Synchronization.

Now instead of querying AD you can query the User Profile Property and use that value.


  • That is really quick. Thank you so much. I donno if this is silly question. We have custom web parts which needs this custom attribute value. So developing COMMON js library for this would work?
    – Maddy
    Mar 25, 2015 at 14:22
  • Yes you can create this library and drop it into the layouts folder. Then you can add references wherever required. Mar 25, 2015 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.