Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In Sharepoint lists, where it gives you a link to the user who created or modified a file, or to a username specified in a "user field" on a list, sometimes I get a plain "Edit User Profile" panel, and sometimes I end up at mysites.

Why? And how do I standardize that?

share|improve this question

3 Answers 3

Are you utilizing OOTB functionality or custom code on the particular location? We had a custom redirect that forced users to non my sites profile pages, which I had to fix when we started to use my sites.

Also, are the users active users? Or deleted?

This behavior shouldn't occur OOTB.

If the user does not have a mysite account, by default it should auto-create one for the user the first time they visit the page.

share|improve this answer
    
No, I have no custom code to that regard. Yes, the users are all active. And the users have not visited their mysites page. Likewise, if the user goes to "My Settings" in the little button menu at the top-right, it shows a sharepoint popup with the user information instead of a mysites link. –  BGM Jul 7 '12 at 13:45
    
Basically, there is a page in the _layouts folder called userdisp.aspx that determines where to go when a user's name is clicked, the following is worth a read sharepoint.microsoft.com/blogs/lkuhn/lists/posts/…. Alternatively, I'll post some custom code I wrote later today that'll do exactly what you need, as I wrote it for my company's SharePoint environment. –  Quinn Johns Jul 7 '12 at 14:36
    
You are very kind, thank you very much. I will look for your assistance! –  BGM Jul 7 '12 at 14:40
    
Will it make any difference if I only use AD groups instead of individual AD users? –  BGM Jul 7 '12 at 15:09
    
Actually, I'd prefer not to use mysites, because users will have to login again to view profiles - it is a separate site. –  BGM Jul 7 '12 at 15:11

Assuming you want to have all user links bring users to My Sites, you can start off creating the user control, by the following code on http://blogs.sharepointguys.com/brendon/sharepoint-2007/programming/redirect-to-your-own-mysite-landing-page/ and then in the RedirectIfNecessary(SPListItem user) you can utilize the following code.

            if (Request.QueryString["id"] != null)
            {
                SPSite _site = SPContext.Current.Site;
                SPServiceContext _serviceContext = SPServiceContext.GetContext(_site);
                UserProfileManager _userProfileManager = new UserProfileManager(_serviceContext);
                string _mySiteUrl = _userProfileManager.MySiteHostUrl;
                string _profileUrl = string.Empty;
                int userID = 0;

                if (int.TryParse(Request.QueryString["id"].ToString(), out userID))
                {
                    SPUser profileUser = SPContext.Current.Web.SiteUsers.GetByID(userID);
                    if (_userProfileManager.UserExists(profileUser.LoginName))
                    {
                        UserProfile _userProfile = _userProfileManager.GetUserProfile(profileUser.LoginName);
                        _profileUrl = _userProfile.PublicUrl.AbsoluteUri;
                    }
                    else
                    {                            
                        _profileUrl = String.Format("{0}Person.aspx?accountname={1}", _mySiteUrl, profileUser.LoginName);
                    }

                    SPUtility.Redirect(_profileUrl, SPRedirectFlags.Static, this.Context);
                }
            }
share|improve this answer
    
Thank you for your time, but I found the solution. Please see my answer. –  BGM Oct 11 '12 at 16:29
up vote 0 down vote accepted

If the user's AD account profile has never been synchronized to sharepoint, then, when you view a user's profile, it will pull info from AD and show you a simple in-page profile report. If, however, the user's profile has been scynchronized properly, you will be taken to mysites instead.

Note that the AD profiles won't synchronize to sharepoint if you point your USP service to an AD group. In order for synchronization to work, you have to point your USP service to an OU with users, not a security group. Sharepoint will not synchronize user profiles based on users added to a security group. It only synchronizes with user accounts directly inside of an OU.

Thus, to standardize things, either make sure the USP service works and all your user accounts in AD are synchronizable, OR disable mysites completely.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.