Today I was working on some cool features to update the User Profile store in SharePoint 2010 by Power Shell but I keep get this error was :

‘No User Profile Application available to service the request. Contact your farm administrator.’

function GetSpContext($url)
    [Microsoft.SharePoint.SPSite]$site = GetSPSite -url $url    
    return [Microsoft.Office.Server.ServerContext]::GetContext($site);

function GetProfileManager($url)
    [Microsoft.Office.Server.ServerContext]$ctx = GetSpContext -url $url
    [Microsoft.Office.Server.UserProfiles.UserProfileManager]$upm = New-Object "Microsoft.Office.Server.UserProfiles.UserProfileManager" -ArgumentList $ctx
    return $upm;

$upm = GetProfileManager -url http://chidev51

After Search around, I found the problem was Permission.

There are 2 place you need give your permission to “Full Control” . They are “Administrators” and “Permissions” :