none
How to get domain name of current logged in User Sharepoint using Object model RRS feed

  • Question

  • Hi,

    I have 2 requirement

    1.Get domain name of current logged in user in sharepoint using object model

    2.Based on domain get list of users who is having having access to particular sharepoint group.

    Please help me with some samples.

    Regards,

    Poovi

    Tuesday, February 14, 2017 7:41 AM

All replies

  • Hi,

    I presume that you need to get these info in a SharePoint page, if yes and if you follow a client side approach, in the first case you can grab the domain using the sharepoint page context "_spPageContextInfo.webAbsoluteUrl" you can try in your browser console or if you need to get the user info and the relatives groups, in this last case you can use the REST API like this sample below:

    https://social.technet.microsoft.com/wiki/contents/articles/36658.using-sharepoint-2013-get-current-user-group-collection-through-rest-api.aspx

    Kind regards,


    Giuliano De Luca - MCSD SharePoint, MCSD Web Applications, MCPS, MS. www.delucagiuliano.com Twitter: @giuleon Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

    Tuesday, February 14, 2017 9:14 AM
  • Hi,

    Could you provide feedback for your issue, you could mark the replies as answers if the replies helped you, so it may help others who has similar issue.

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, March 7, 2017 10:39 AM