Scheduler invoked automatically throws exception...

Vote:
 

The Schedule executes properly, when it is invoked "Start Manually", but throws exception as shown below when it is invoked automatically based on the schedule frequency.

Exception has been thrown by the target of an invocation. [Access was denied to page 15528.]

We have tested with all the possible AccessLevel permission to access the HomePage.

#25108
Oct 14, 2008 5:23
Vote:
 

When you run the task manually the job will execute as current user. When it executed by scheduler by default it will be a non authenticated user. The error you got indicated that some page has restricted access ( not just homepage ). I think you need to do impersonate or make that page less restricted. impersontate could be done like this

bool isValidUser = System.Web.Security.Membership.Provider.ValidateUser(username, password);

if (isValidUser)
{
MembershipUser mu = System.Web.Security.Membership.Provider.GetUser(username, true);
EPiServer.Security.PrincipalInfo.CurrentPrincipal = EPiServer.Security.PrincipalInfo.CreatePrincipal(username);
} else
throw new Exception( "Fail on validate user " + username );

#25112
Oct 14, 2008 9:49
Vote:
 

We tried impersonating with the username [Epiadmin] but still it throws the exception...

Exception has been thrown by the target of an invocation. [Access was denied to page 15528.]

#25329
Oct 21, 2008 8:47
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.