Nota
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
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);
});