Question

I have SP 2013 farm. When i want to see user, SP render for me link like this: http://portal/_layouts/15/userdisp.aspx?ID=1. Then i go for this link become redirect to http://portal/my/Person.aspx?accountname=userlogin. I want to obtain user ID from first link. But if i search user via SP search it always give me a link to Person.aspx. I saw a Profile in User Profile Service Application and can't find a property like ID. How can i get this id?

Was it helpful?

Solution

Not sure if it's what you're looking for, but in my case I went into the list settings for the User Information List in SP2013 and created a new view that included several columns, including the ID for each user:

enter image description here

OTHER TIPS

Not exactly elegant but if you view your site collection access group with Id=0 you can find the user then hovering the mouse over that user the ID= for that user will display in the link preview.

  1. Go to: https://portal/_layouts/15/people.aspx?MembershipGroupId=0
  2. Find the user and hover mouse over
  3. Look at bottom of screen for link preview
  4. The ID= is found at the very end of the link preview

Hopefully someone else knows a better way and can post.

You can find the UserID from any place in SharePoint that displays the User Name, such as Modified by in a List or Library. Right-click on the User Name and select Properties from the flyout. It will give you userdisp.aspx?ID=39 for that that user.

I hope that helps.

You can get a list of the userIds via REST:

https://msdn.microsoft.com/en-us/library/office/dn531432.aspx#bk_User

A GET request on http://site_url/_api/web/siteusers gives you a list of all siteusers. For each user there is a field "Id" : 1 (in JSON Format).

Trap: The ID differs per website collection! So if you need IDs for a specific website collection you have to request http://site_url/website_collection/_api/web/siteusers

If you already know the username and just want to obtain the ID you can get it by requesting http://site_url/_api/web/siteusers(@v)?@v='login name' as explained in the MSDN Link.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top