Jean Paul's Blog

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

  • 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();


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.


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


Add and Assign Full Control  to the user


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:


Leave a Reply

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

You are commenting using your 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