Retrieve information from Active Directory using web service

g h 716 Reputation points
2020-08-20T06:09:28.693+00:00

I have a new requirement from client to insert AD details from the users into a Web Part within a site. I have read that the GetUserProfileByName web service is used for this purpose but when I made the request using jquery - ajax I got 401 Unauthorized.

I can't post code, seems the forum can't support this action.

Is this the correct approach to accomplish the requirement by coding method ? Is there a better way to achieve this by Client side code ? if anyone can give a hint on this would be appreciated.

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,608 questions
{count} votes

Accepted answer
  1. Jerryzy 10,571 Reputation points
    2020-08-21T05:47:51.177+00:00

    Hi @g h ,

    SharePoint User Profile properties is syning with Active Dictory property, you can get AD information from User Profile directly.

    The attachment is a code demo to get user profile property using SharePoint JSOM.

    19289-code.txt


    If the response is helpful, please click "Accept Answer" and upvote it.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.