tags:

views:

204

answers:

2

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?

A: 

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?

Ryan
I'm calling the GetUserInfo to get the details (UserId and Display name) of the user, and use that to populate a People And Groups field, If I try and populate this type of field with just the NT Login (Domain\Username) It doesn't seem to work. Is there a way of programatically adding users to the user list using their NT login?
Sean Taylor
A: 

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

Sean Taylor