This project has moved and is read-only. For the latest updates, please go here.

GetUserprofileByName function just for users who have permissions on site collection?

Jul 18, 2013 at 10:19 AM
Edited Jul 18, 2013 at 10:24 AM
Hi guys,
I've got the following problem:

I develop a form, where you have to chose a person with the "SharePoint:PeopleEditor" element. Now I try to get more information about that person from the active directory (for example the "Office" property) and want to show that information in the form.

If I try to get information about a person who has permissions on the site collection, I get the information I wanted (the "Office" property is filled).

But if I try to get information about a person who has an AD account, but has no permissions on the site collection the properties do not contain any information.

Anyone has an idea what to do?

Best regards,
Jul 18, 2013 at 12:07 PM

If you're calling GetUserprofileByName then you're querying the User Profile Store, not AD. As long as the sync is running, you should get results for everyone.

The issue you're describing makes it sound more like you are querying the User Information List. Until a person has "touched" a Site Collection, they won't be in that list. "Touching" the Site collection can mean a lot of thing, though, and the person doesn't have to do it themselves. Basically, the first time anything occurs with that user in the Site Collection, they are added to the UIL.

Jul 18, 2013 at 1:05 PM
Hey M.,
thanks for your quick reply and your help.

My problem was, that I develop on my development machine and its profile store is not synced to the AD... :-)

Thank you so much,