Please delete this if it ends up being a double post. Not sure if the first attempt worked.
I think that I may have found a solution for the schedule part of the problem. Below are the steps that I have carried out
Add a new property to the Common.Globals (Global.vb)
Private _ApplicationIdentity As System.Security.Principal.WindowsIdentity
Public Property ApplicationIdentity() As System.Security.Principal.WindowsIdentity
Get
Return _ApplicationIdentity
End Get
Set(ByVal value As System.Security.Principal.WindowsIdentity)
_ApplicationIdentity = value
End Set
End Property
Then in the UrlRewriteModule.vb within the OnBeginRequest add the following code
' Check that the services are running under the current user
If DotNetNuke.Common.ApplicationIdentity.Name <> System.Security.Principal.WindowsIdentity.GetCurrent().Name Then
DotNetNuke.Common.ApplicationIdentity = System.Security.Principal.WindowsIdentity.GetCurrent()
End If
Note that I could not use the Init because at this point it was still processing under the Network Service account.
Then in the Schedule Provider within the ProcessGroup.vb within the Start method introduce the following code (the code that I have added is in italics
Try
Process.ScheduleHistoryItem.Succeeded = False
Dim changedIdentity As Boolean = False
Dim wi As System.Security.Principal.WindowsImpersonationContext
If System.Security.Principal.WindowsIdentity.GetCurrent.Name <> Common.ApplicationIdentity.Name Then
wi = Common.ApplicationIdentity.Impersonate()
changedIdentity = True
End If
Process.DoWork()
If changedIdentity Then
wi.Undo()
End If
This changes the identity that the schedule code (DoWork) is done under. Since most of the time the website is running under the correct account the setting the new property should only happen once in the Begin event mentioned. This can then be used as the main account to run the scheduled services under.
Not sure if it is the best solution however, it does work.