Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Strange Error on new UserProfileManager()

Posted by Paul on July 30, 2012


Today I was receiving a strange error on creating instance of UserProfileManager()

eg: UserProfileManager obj = new UserProfileManager();

Error

Object reference not set to an instance..

Root Cause

Although the error message was not self explanatory on the web i could see the root cause was that the user who executed the application not in the Permissions list of User Profile Service Application.

Fix

Open Central Admin > Manage Service Applications > User Profile Service Application (select) > Permissions > Add current logged in user (user who executes the program)

image

Add and Assign Full Control  to the user

image

Note: It did not worked for me as i was having cross-forest issues may be.

Actual Fix

Following was my fix which worked: (STSADM Command through PowerShell)

STSADM –o updatefarmcredentials –userlogin DOMAIN\USER –password YOURPASSWORD

This command should be executed in the Central Administration hosting server.

More Info: http://technet.microsoft.com/en-us/library/cc262150(v=office.12).aspx

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s