Hot answers tagged

12

I was having the same issue and solution to the problem we got is to use following link to get the user profile photo instead of directly accessing picture url coming from sear result or accessing direct url to the image.. [https:///_layouts/15/userphoto.aspx?size=&accountname=&url=] size=S/M/L accountname=user's email url=url of image - optional - ...


11

This is usually a permissions issue, the user running this code should be added to the User Profile service both as an Admin and Permissions.


10

UserProfile.PersonalSite property gets the personal site of the User: var profileManager = new UserProfileManager(ServerContext.GetContext(SPContext.Current.Site)); var profile = profileManager.GetUserProfile("domain\\username"); using (SPSite personalSite = profile.PersonalSite) { var personalSiteUrl = personalSite.PersonalUrl; }


9

You can use the Where cmdlet to filter the users. $profiles = $profileManager.GetEnumerator() | Where {$_.name -like "IT*"} Note: This does the filtering after retrieving the full list. Also $profiles = $profileManager.GetEnumerator() | Where {$_.MultiloginAccounts -like "domainname\adminID*"}


9

Gary Lapointe and Mathew McDermott recently published an article on this topic in SharePointPro magazine. It is available online here: http://www.sharepointpromag.com/article/sharepoint/monitor-sharepoint-user-profile-changes-129846 Synopsis of the article: First you enable logging via the STSADM tool (no PS available for this) stsadm -o ...


9

Contrary to the accepted answer, there's a number of ways to accomplish this using out-of-the-box SharePoint 2010 features. You can allow certain users permissions to manage any user profile in the system by granting them Manage Profiles permissions in Central Admin. You can find more info on TechNet: Assign administration of User Profile service features ...


8

This is a pretty old thread so you've probably already figured this out but for the sake of helping to close it out, here's one way you could solve the problem (there are others): $profiles | ForEach-Object { $vals = $_.GetEnumerator(); $hash = @{}; foreach ($val in $vals) { $hash[$val.Key] = $val.Value } New-Object PSObject ...


8

Getting only the current user won't be enough to get user profile properties. You need to use the PeopleManager as well. Your code should look something like this: var context = SP.ClientContext.get_current() var web = context.get_web(); var user = web.get_currentUser(); var peopleManager = new SP.UserProfiles.PeopleManager(context); var personProperties = ...


7

For a client solution I would use the Search REST API. The grouping has to be done on the client, it depends on how you configure your Managed Properties. The trick with People is to pass the correct Result Source ID in the query: For example: ...


7

To answer your first question -> When you grant a specific user permissions to a site, they are added automatically to the hidden User Information list. As far as an Active Directory group -> The group gets added to the hidden User Information list, but the user does not get added until they access the site. (As an example, I granted an AD group ...


7

Theres not much stuff out there regarding User Profile upgrade yet, but technet dont report any specific considerations beside if you use choice lists, you should remap these later to Managed Metadata Service tags if you choose in-place upgrade and if you use db attach (recommended) you should create MMS before so it can be mapped during upgrade. Remember ...


7

This will give you all profiles, without restrictions: var serviceContext = SPServiceContext.GetContext(site); var userProfileManager = new UserProfileManager(serviceContext); foreach (UserProfile userProfile in userProfileManager) { // ... } This operation in itself is not super costly, but retrieving individual user profile properties can be. ...


7

The function below will get you the UserProfile based on the accountName public static UserProfile GetUserInfo(string AccountName) { UserProfile profile = null; SPServiceContext serviceContext = SPServiceContext.Current; UserProfileManager profileManager = new UserProfileManager(serviceContext); if (AccountName != string.Empty) { ...


7

You need to execute the following Move-SPUser command (an equivalent of the STSADM MigrateUser command) for the user account in order to update the account name in SharePoint: Move-SPUser -Identity "DOMAIN\jdoh" -NewAlias "DOMAIN\jdoe"


6

Go to central admin Application Management -> Manage service applications User Profile Service Application People -> Manage User Properties Picture -> Edit Edit Settings -> Do not allow users to edit values for this property


6

I suspect that your user profile has changed, but SharePoint didn't pick up the changes. Here's a post with some suggestions.


6

It is not possible to configure the user profile synchronization service to import users from other sources than the built in synchronization sources (AD DS, Novell, Tivoli....) I dont think it is possible to write your own synchronization connection - there are absolutely no documentation, and after having poked around i reflector for days i found no where ...


6

It is not possible to add event handlers to the user info list. Please see this following thread: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/81aae5ef-9621-48c5-ad52-706e5d6a0f05 That was me asking the question.


6

You can try this if I understand you correct? Microsoft.SharePoint.SPContext.Current.Web.CurrentUser.LoginName; or HttpContext.Current.User.Identity.Name and Microsoft.SharePoint.SPContext.Current.Web.CurrentUser.ID; hope this helps :)


6

You can perform the following to resolve the issues: Make sure User Profile Synchronization service is running In the user profile service application make sure "Profile Synchronization Status" is not stuck in synchronizing state. Start a full User Profile Synchronization Re-add forest and make sure the password of the account used for synchronization ...


6

Looks like I found the answer.. $MySite = Get-SPSite "$site" $context = Get-SPServiceContext $MySite $profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context) $profilemanager.properties | ft name,displayorder $profileManager.Properties.SetDisplayOrderByPropertyName(“userpropertyname”,1) ...


5

You cannot change any properties in the User Profiles via client OM code (neither .NET nor via JavaScript) with the exception of the user's profile picture. MSDN - Work with user profiles in SharePoint 2013 Not all functionality that you find in the Microsoft.Office.Server.UserProfiles assembly is available from client APIs. For example, you have ...


5

Have you enabled "replicable" on the field properties? If this isnt enabled, the properties are not propagated to the hidden user list Edit: if you look at this post, it seems that not all user profile types are propagated. Change one of the properties to TEXT just to test if this is the cause of this.


5

You also can use the SPUser and SPUserCollection Object to iterate through all user profiles using Microsoft.SharePoint; using Microsoft.Office.Server.UserProfiles; using Microsoft.Office.Server; using System.Web; here is the code: SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite siteCollection = new ...


5

Peter Holpar has a very good article on this topic as it relates to SharePoint 2010. Generally speaking, it's very much the same in SP 2013. If the property is just going to be populated once from the WCF service and then SharePoint will be the owner of the property (i.e. where people go to update it) then you do not need a BCS model or the sync connection. ...


5

This might be a long shot, but in SharePoint 2003 I remember some web parts needed the user to have visited the site collection / site / page before the information became available. In other words, ask User 2 to visit the page.


5

When you changed the My Site Host URL did you extend and map it to your original my site host or did you just add the binding in IIS and then change AAM? Change the web application and ensure that all of the dependancies are working as well as changing the setting in the User Profile Service Application. Ensure that the URL you wish to use for the MySite ...


5

You should use: using (SPSite site = new SPSite(_upa)) { SPServiceContext context = SPServiceContext.GetContext(site); UserProfileManager _upaManager = new UserProfileManager(context); // Chek if user exists if( _upaManager.UserExists("mydomain\\myuser")} { // The user exists } else{ // The User doesn't exists ...


5

SPUtility.ResolvePrincipal can do this - but I can't guarantee that it'll be fast. It should be something like: SPPrincipcalInfo user = SPUtility.ResolvePrincipal( webApp, null, "email", SPPrincipalType.User, SPPrincipalSource.Windows, true); UserProfileManager profileManager = new UserProfileManager(serviceContext); if ...



Only top voted, non community-wiki answers of a minimum length are eligible