"No User Profile Application Available" Mystery in SharePoint 2010
Here's another in what seems like a growing list of permissions gotchas in SharePoint 2010. Assume if you will, you are a crack developer and building a custom application for SharePoint 2010. You're writing code on your development server, which has a FULLY functioning installation of SharePoint 2010. You want to work with some user profile data, so you create an instance of the UserProfileConfigManager. Strangely, when you do this you get an exception that says "No User Profile Application available to service the request. Contact your farm administrator."
Hmm, seems strange. You double check your settings, your user profile service application is up and running. You're probably a farm admin even in this scenario and you are able to manage it - so what is the scoop? You may think, ah, I need to grant myself rights to manage the application. We've seen that behavior in another posting I published just today on working with FAST user contexts. So you find your user profile service app, click on the Administrators button in the ribbon and give your self Full Control rights to it. You try again - same problem. Grrr! Yes, this can get frustrating. As it turns out, there is yet another place where you may need to set permissions, and this is one of those cases. If you look in the ribbon when you select a service application, you will see the Administrators button, but there is also the Permissions button on the far right. In this case, click the Permissions button. Add your account and give it Full Control rights. NOW, go back and try your code again - this time it should work.
Sorry, I wanted to add one other scenario I have seen happen. Many times you create the ServiceContext for getting the UserProfileManager by getting a reference to an SPSite and then using the SPServiceContext.GetContext method. What I have seen happen before is that if that site that you create the SPSite reference to allows anonymous access, you may still get this error. When disabling anonymous access at the site collection level it started working. Just another FYI.
Comments
Anonymous
January 01, 2003
After some "Grrr!" I finally found your blog post. Thank you!Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
This is a funny thing. I tear down and build up this service so often on my dev machine, I've forgotten this piece more than a couple times only to return to this same blog post. Thanks, Steve.Anonymous
January 01, 2003
Referenced your post in my one: blogs.technet.com/.../configure-service-application-permissions-in-sharepoint-2010-using-powershell.aspx Thanks for the info!Anonymous
January 01, 2003
FYI, Today I was receiving the "No User Profile Application available to service the request" message and followed the instructions in this blog post and also reset IIS. For some reason, it did not clear up until I switched the service connections on the web application to 'custom' and then switched them back again to default. I did this for both the main app and My Sites, and afterward, the error disappeared. The resolution may be some combination of permissions, IIS reset, and service connections... I don't know, and at this point, I'm just glad it's working. :-)Anonymous
January 01, 2003
what do I do if I get this error when I try to open user profile service application ??? I'm going nutz...Anonymous
January 01, 2003
Thanks for sharing! Still helping.Anonymous
June 01, 2010
i am still in Grrrrrrrr! mode.. tried giving full access to me.. still same grrrrr. help meAnonymous
June 10, 2010
Have you double checked it? For me it also didn't work but after a restart I found the user lost so I retried and it worked at once!Anonymous
June 14, 2010
Will try this out and report back the results.Anonymous
July 15, 2010
Thanks so much !! After an IISRESET it worked perfectly !!Anonymous
August 03, 2010
Worked for me, remember to close and reopen your pshell window ;)Anonymous
August 06, 2010
Thanks for the tip. No more Grrrrrrr moments here :)Anonymous
September 18, 2010
Thank you for this post! It saved me a lot of time and grrrrs :)Anonymous
September 26, 2010
I tried this still problem with the profile serviceAnonymous
October 07, 2010
Thanks.. This helped me out with a program that I was trying to use to do a bulk import of user profile pictures. I did have to reboot the server. though an IISRESET may have worked!Anonymous
October 27, 2010
Thanks, saved me a lot of time to find this blog post! :-)Anonymous
November 10, 2010
The comment has been removedAnonymous
November 21, 2010
Thanks very much for your sharing! It really helps me a lot!Anonymous
November 26, 2010
It's a good approach but my Grrrrrrr's not stop. I receive this error when I add a Outlook WebPart :(Anonymous
January 13, 2011
Hey thanks a lot for this!!! It fixed my problem of doing some unit testing locally...Anonymous
March 31, 2011
Grrrr..... just wanted to join in the general growling. Thanks - had exactly this problem and your solution worked first time!Anonymous
August 15, 2011
Just what I needed at the right time. Thanks for the post, you saved me some hair-pulling.Anonymous
August 18, 2011
This is right on. I appreciate you posting this.Anonymous
May 04, 2013
I got the error after recreate the User Profile Appliction Proxy, I fixed it configuring the Service Applications Associations.Anonymous
February 28, 2014
You saved the day!Anonymous
May 26, 2014
Thank for this post. It helps me a lot.Anonymous
July 17, 2014
I followed KCRyan318, I switched the service connections on the web application (only) to 'custom' , and select all service as the default profile do. The error disappear immediately.
Then I switch it back to default, no futher error occur.Anonymous
September 18, 2014
The comment has been removed