Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
A work-around to this issue is, execute the code under admin privileges(impersonate the user), you can either follow the Win API impersonation or using the SPSecurity.RunWithElevatedPrivilages() method.
You would get errors like,
'Microsoft.SharePoint.SPException'
base {System.ApplicationException}: {"Cannot complete this action.\n\nPlease try again."}
ErrorCode: -2147467259
UserProfileChangeJobSchedule: 'new UserProfileManager(context,false).UserProfileChangeJobSchedule' threw an exception of type 'Microsoft.SharePoint.SPException'
SPSecurity.RunWithElevatedPrivilages(delegate()
{
ServerContext context = ServerContext.GetContext("SharedServices2");
UserProfileManager manager = new UserProfileManager(context);
});