views:

178

answers:

0

I'm doing a SP 2007 custom timer job on Windows Server 2003 (in Virtual Machine) that runs as user mossservice. mossservice is a member of Farm Administrator. I granted the user mossservice as member of Administrator in Active Directory. Still same problem.

[SharePointPermission(SecurityAction.LinkDemand, ObjectModel = true)]

 public override void Execute(Guid contentDbId)

 {

  SPSecurity.RunWithElevatedPrivileges(delegate()

{

 // get a reference to the current site collection's content database

 SPWebApplication webApplication = this.Parent as SPWebApplication;

 SPContentDatabase contentDb = webApplication.ContentDatabases[contentDbId];

 // get a reference to the "Tasks" list in the RootWeb of the first site collection in the content database

 SPList oList = contentDb.Sites[0].RootWeb.Lists[Globals.ListName];

The last line throws the security exception.

Below is a LOG dump:

06/08/2010 22:15:02.84 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 Medium Adding NT AUTHORITY\NETWORK SERVICE to local group 2.
06/08/2010 22:15:02.85 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 High NT AUTHORITY\NETWORK SERVICE cannot be added to the group IIS_WPG. This may be because SharePoint is being installed on a domain controller which does not allow some account types to be added to domain groups. Administrators and Network Service will be explicitly granted access to all SharePoint resources on the local system. You may need to manually grant other accounts the same access.
06/08/2010 22:15:02.85 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 Medium Adding NT AUTHORITY\NETWORK SERVICE to local group 0.
06/08/2010 22:15:02.86 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 High NT AUTHORITY\NETWORK SERVICE cannot be added to the group WSS_WPG. This may be because SharePoint is being installed on a domain controller which does not allow some account types to be added to domain groups. Administrators and Network Service will be explicitly granted access to all SharePoint resources on the local system. You may need to manually grant other accounts the same access.
06/08/2010 22:15:02.87 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 High Updating identity for application pool 'OfficeServerApplicationPool' to 'NT AUTHORITY\NETWORK SERVICE'.
06/08/2010 22:15:02.87 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 High Identity for application pool 'OfficeServerApplicationPool' updated to 'NT AUTHORITY\NETWORK SERVICE'.
06/08/2010 22:15:02.99 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 Medium Adding NT AUTHORITY\NETWORK SERVICE to local group 2.
06/08/2010 22:15:03.00 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 High NT AUTHORITY\NETWORK SERVICE cannot be added to the group IIS_WPG. This may be because SharePoint is being installed on a domain controller which does not allow some account types to be added to domain groups. Administrators and Network Service will be explicitly granted access to all SharePoint resources on the local system. You may need to manually grant other accounts the same access.
06/08/2010 22:15:03.00 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 Medium Adding NT AUTHORITY\NETWORK SERVICE to local group 0.
06/08/2010 22:15:03.01 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 High NT AUTHORITY\NETWORK SERVICE cannot be added to the group WSS_WPG. This may be because SharePoint is being installed on a domain controller which does not allow some account types to be added to domain groups. Administrators and Network Service will be explicitly granted access to all SharePoint resources on the local system. You may need to manually grant other accounts the same access.
06/08/2010 22:15:03.02 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 High Updating identity for application pool 'OfficeServerApplicationPool' to 'NT AUTHORITY\NETWORK SERVICE'.
06/08/2010 22:15:03.02 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 High Identity for application pool 'OfficeServerApplicationPool' updated to 'NT AUTHORITY\NETWORK SERVICE'.
06/08/2010 22:15:03.10 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 Medium Adding NT AUTHORITY\NETWORK SERVICE to local group 2.
06/08/2010 22:15:03.11 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 High NT AUTHORITY\NETWORK SERVICE cannot be added to the group IIS_WPG. This may be because SharePoint is being installed on a domain controller which does not allow some account types to be added to domain groups. Administrators and Network Service will be explicitly granted access to all SharePoint resources on the local system. You may need to manually grant other accounts the same access.
06/08/2010 22:15:03.11 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 Medium Adding NT AUTHORITY\NETWORK SERVICE to local group 0.
06/08/2010 22:15:03.12 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 High NT AUTHORITY\NETWORK SERVICE cannot be added to the group WSS_WPG. This may be because SharePoint is being installed on a domain controller which does not allow some account types to be added to domain groups. Administrators and Network Service will be explicitly granted access to all SharePoint resources on the local system. You may need to manually grant other accounts the same access.
06/08/2010 22:15:03.13 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 High Updating identity for application pool 'OfficeServerApplicationPool' to 'NT AUTHORITY\NETWORK SERVICE'.
06/08/2010 22:15:03.13 OWSTIMER.EXE (0x0EC4) 0x0B34 Windows SharePoint Services Topology 0 High Identity for application pool 'OfficeServerApplicationPool' updated to 'NT AUTHORITY\NETWORK SERVICE'.
06/08/2010 22:15:06.10 mssearch.exe (0x0FFC) 0x00B4 Search Server Common GatherSvc 0 Medium CGatherApplication::CGatherApplication::GetRole - What is the role of this server? - File:d:\office\source\search\search\gather\gthrsvc\gthrapp.cxx Line:730
06/08/2010 22:15:06.10 mssearch.exe (0x0FFC) 0x00B4 Search Server Common GatherSvc 0 Medium CGatherApplication::CGatherApplication::GetRole - The role of this server is 3 - File:d:\office\source\search\search\gather\gthrsvc\gthrapp.cxx Line:752
06/08/2010 22:15:06.10 mssearch.exe (0x0FFC) 0x00AC Search Server Common GatherSvc 0 Medium CGatherApplication::CGatherApplication::GetRole - What is the role of this server? - File:d:\office\source\search\search\gather\gthrsvc\gthrapp.cxx Line:730
06/08/2010 22:15:06.10 mssearch.exe (0x0FFC) 0x00AC Search Server Common GatherSvc 0 Medium CGatherApplication::CGatherApplication::GetRole - The role of this server is 3 - File:d:\office\source\search\search\gather\gthrsvc\gthrapp.cxx Line:752
06/08/2010 22:15:19.51 OWSTIMER.EXE (0x0EC4) 0x0764 Windows SharePoint Services General 0 Medium Entering MRU trim routine.
06/08/2010 22:15:19.51 OWSTIMER.EXE (0x0EC4) 0x0764 Windows SharePoint Services General 0 Medium Initial table size: 38155 in 1 entries
06/08/2010 22:15:19.51 OWSTIMER.EXE (0x0EC4) 0x0764 Windows SharePoint Services General 0 Medium MRU trim pass 1
06/08/2010 22:15:19.51 OWSTIMER.EXE (0x0EC4) 0x0764 Windows SharePoint Services General 0 Medium Preserving template record with size 38155, use count 1, key 13-1033
06/08/2010 22:15:19.51 OWSTIMER.EXE (0x0EC4) 0x0764 Windows SharePoint Services General 0 Medium MRU trim pass 2
06/08/2010 22:15:19.51 OWSTIMER.EXE (0x0EC4) 0x0764 Windows SharePoint Services General 0 Medium Deleting template record with size 38155, use count 1, key 13-1033
06/08/2010 22:15:19.51 OWSTIMER.EXE (0x0EC4) 0x0764 Windows SharePoint Services General 0 Medium Final table size: 0 in 0 entries
06/08/2010 22:15:19.51 OWSTIMER.EXE (0x0EC4) 0x0764 Windows SharePoint Services General 0 Medium Exiting MRU trim routine.
06/08/2010 22:15:24.08 OWSTIMER.EXE (0x0EC4) 0x0B34 SharePoint Portal Server Business Data 7pkf Monitorable Portal Analytics processing job started.
06/08/2010 22:15:24.60 mssearch.exe (0x0FFC) 0x0BD8 Search Server Common GatherSvc 0 Medium CGatherApplication::CGatherApplication::GetRole - What is the role of this server? - File:d:\office\source\search\search\gather\gthrsvc\gthrapp.cxx Line:730
06/08/2010 22:15:24.60 mssearch.exe (0x0FFC) 0x0BD8 Search Server Common GatherSvc 0 Medium CGatherApplication::CGatherApplication::GetRole - The role of this server is 3 - File:d:\office\source\search\search\gather\gthrsvc\gthrapp.cxx Line:752
06/08/2010 22:15:24.60 OWSTIMER.EXE (0x0EC4) 0x0B34 SharePoint Portal Server Business Data 63tr Monitorable Usage data processing on SSP SharedServices1 was skipped because it is not enabled.
06/08/2010 22:15:24.60 OWSTIMER.EXE (0x0EC4) 0x0B34 Search Server Common MS Search Administration 7plh Monitorable Starting query log processing on SSP SharedServices1.
06/08/2010 22:15:24.60 OWSTIMER.EXE (0x0EC4) 0x0B34 Search Server Common MS Search Administration 7pli Monitorable Query log processing on SSP SharedServices1 complete.
06/08/2010 22:15:24.60 OWSTIMER.EXE (0x0EC4) 0x0B34 SharePoint Portal Server Business Data 7pkg Monitorable Portal Analytics processing job finished.
06/08/2010 22:15:24.66 OWSTIMER.EXE (0x0EC4) 0x0840 Windows SharePoint Services General 8e2s Medium Unknown SPRequest error occurred. More information: 0x80070005
06/08/2010 22:15:24.66 OWSTIMER.EXE (0x0EC4) 0x0840 Windows SharePoint Services Timer 7psa Critical The Execute method of job definition CustomTimerJob.EmailJob (ID 64bf2a8a-d608-43a1-a903-0dffa6b8904e) threw an exception. More information is included below. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
06/08/2010 22:15:24.66 OWSTIMER.EXE (0x0EC4) 0x0840 Windows SharePoint Services Timer 72ae Unexpected Exception stack trace: at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex) at Microsoft.SharePoint.Library.SPRequest.GetListsWithCallback(String bstrUrl, Guid foreignWebId, String bstrListInternalName, Int32 dwBaseType, Int32 dwBaseTypeAlt, Int32 dwServerTemplate, UInt32 dwGetListFlags, UInt32 dwListFilterFlags, Boolean bPrefetchMetaData, Boolean bSecurityTrimmed, Boolean bGetSecurityData, ISP2DSafeArrayWriter p2DWriter, Int32& plRecycleBinCount) at Microsoft.SharePoint.SPListCollection.EnsureListsData(Guid webId, String strListName) at Microsoft.SharePoint.SPListCollection.EnsureListsData(String strListName) at Microsoft.SharePoint.SPListCollection.GetListByName(String strListName, Boolean bThrowException) at Microsoft....
06/08/2010 22:15:24.66* OWSTIMER.EXE (0x0EC4) 0x0840 Windows SharePoint Services Timer 72ae Unexpected ...SharePoint.SPListCollection.get_Item(String strListName) at CustomTimerJob.EmailJob.<>c_DisplayClass1.b_0() at Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state) at Microsoft.SharePoint.SPSecurity.<>c_DisplayClass4.b_2() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) at CustomTimerJob.EmailJob.Execute(Guid contentDbId) at Microsoft.SharePoint.Administration.SPTimerJobInvoke.Invoke(TimerJobExecuteData& data, Int32& result)
06/08/2010 22:15:24.66 OWSTIMER.EXE (0x0EC4) 0x0840 Windows SharePoint Services General 8l1n Monitorable An SPRequest object was not disposed before the end of this thread. To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it. This object will now be disposed. Allocation Id: {22119771-B80B-403C-A66F-BC6741E319CE} To determine where this object was allocated, create a registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings. Then create a new DWORD named SPRequestStackTrace with the value 1 under this key.

Any assistance would be greatly appreciated.