Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7591209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:35:45+00:00 2026-05-30T20:35:45+00:00

I am getting this error while trying to retrieve a user profile: An error

  • 0

I am getting this error while trying to retrieve a user profile:

An error was encountered while retrieving the user profile.

here is my code:

foreach (SPUser parent in parentGroup.Users)
{
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        using (SPSite elevatedSite = new SPSite(site.ID))
        {
            using (SPWeb elevatedWeb = site.OpenWeb(web.ID))
            {
                elevatedWeb.EnsureUser(parent.LoginName);
            }
        }
    });
    web.EnsureUser(parent.LoginName);
    try
    {
        UserProfile profile = upm.GetUserProfile(parent.LoginName);
        if ((bool)profile["ParentAssignmentSubscribe"].Value)
        {
            receivingParents.Add(new SlkUser(parent));
        }
    }
    catch(Exception ex)
    {
        throw new Exception("failed to load profile of " + parent.LoginName + " in order to send them an assignment notification for web " + web.Name + ". The error returned was: " + ex.Message);
    }
}

obviously the user does exist, because i am getting his username from the group, and i also am using EnsureUser. what is going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:35:47+00:00Added an answer on May 30, 2026 at 8:35 pm

    Maybe it is because your process cannt found your user profile .

    Can you try the below steps ?

    1. Open Central Administrator-→Security-→General Security,copy user name from Configure service accounts  

    2. Open Central Administrator-→Application Management →Service Application→Manage Service Applications.

    3. Click User Profile Service from the page you have opened at step2 , and select Manage User Profile from People

    4. You can search the user profile by user name which you have copied at step1 , If you cant find it , that might be your error reason.

    5. Click New Profile,create a new profile for your user name(at step1).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting this error while trying to modify some tables. Here's my code:
Am getting this compiler error while trying to compile an VS 6 VC++ code.
Getting this error while trying to compile a copied code from a Fortran 77
I´m getting this error while trying to commit to a svn repository: svn: MKACTIVITY
All of a sudden I start getting this error while trying to open 2
While trying to host the CLR, I keep getting this: error C2440: 'function' :
I am getting an error while trying to run this Application ... the error
In Eclipse, while trying to start Tomcat, I am getting this error: The project:
I am getting this error while trying to run an ajaxq call. I am
I'm getting this error while trying to de-serialize my object : [org.xml.sax.SAXParseException: cvc-complex-type.2.4.b: The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.