SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am making the following call

    new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigmanager($servercontext)

And get the following error:

New-Object : Exception calling ".ctor" with "1" argument(s): "Object reference not set to an instance of an object."
At C:\Users\Administrator\AppData\Local\Temp\1\6ff1f5cc-8ca6-44b8-a721-41f7c8042848.ps1:24 char:13
+         new-object <<<<  Microsoft.Office.Server.UserProfiles.UserProfileConfigmanager($servercontext)
+ CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

Can anyone help please?

share|improve this question
up vote 10 down vote accepted

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.

share|improve this answer
Thanks for taking the time to help me. I tried what you suggested but didn't have any luck. Any other ideas? – Burt Oct 27 '11 at 10:15
Can you open User profile app with that user via Central Admin UI? Is there anything else interesting in ULS logs? – Toni Frankola Oct 27 '11 at 11:33

I had the same issue. But I solved it as Toni Frankola said. May be you did wrong steps to add permissions to the user profile service. Look at this post to be sure that you added these permissions correctly.

share|improve this answer

Your Answer


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.