Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharepoint Webservices - GetUserInfo

Tags:

sharepoint

I am trying to call GetUserInfo on a sharepoint list (using the sharepoint web services), which seems to work ok, but only If the user I am trying to get details for has already added an item to the list using the actual sharepoint site.

I would like to be able to call GetUserInfo for people that havent already added an item to the list.

The List itself is open to any NT AUTHORITY\authenticated users to post items, when They add a list item, it seems to add them as a site member, but doesnt seem to add them to a specific group or role (as far as I can see!)

Has anyone else come up against the same problem? Is there a workaround available?

like image 507
Sean Taylor Avatar asked May 07 '26 22:05

Sean Taylor


2 Answers

After some digging around I managed to find out a way round this one.

The People webservice (people.asmx) has a method, ResolvePrincipals, which accepts a users NT login(s) (or email address) and resolves it to their associated sharepoint account for the site - (Including the Unique ID of the user - this is what I was after)

The method has a boolean parameter (addToUserInfoList) when set to true, it will automaticaly add the user to the site (if they don't already exist)

MSDN Documentation can be found here -

http://msdn.microsoft.com/en-us/library/people.people.resolveprincipals(v=office.12).aspx

like image 141
Sean Taylor Avatar answered May 11 '26 14:05

Sean Taylor


Users don't actually get added into the SharePoint user list until they have visited a site.

Are you just after the NT Login ID or something else?

like image 43
Ryan Avatar answered May 11 '26 14:05

Ryan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!