0

I need to fetch all users ID from their Manager in Sharepoint userprofile.. Means Multiple users are under of a single Manager. Using C# how to fetch? Anyone knows..Help me.

4

1 回答 1

-1

应该可以做类似的事情。

SPServiceContext serviceContext = SPServiceContext.GetContext(SPContext.Current.Site);
UserProfileManager upm = new UserProfileManager(serviceContext);
UserProfile u = upm.GetUserProfile(false);
var users = u.GetDirectReports();

请务必包含对 Microsoft.Office.Server.UserProfiles 的引用

于 2012-08-27T13:50:36.140 回答