Have a constructor on your job which takes in a SPWeb or string url, and then store the web url and list url and whatever other properties you want as a persisted property on the job.
I recommend creating a web-scoped feature to install the timer job, and create it with a name that has the web ID tacked on (for uniqueness sake in case you want the job on ...
Your issue is related to access to Configuration Database. Please follow the link for details - http://blog.falchionconsulting.com/index.php/2009/07/custom-sharepoint-2007-site-collection-creation-page/. It describes the same issues with creation of site collection and possible solutions and also touches Timer Job.
To debug timer job you need to attach to SharePoint Timer process (after each code deployment you also need restart this service to make sure that it picks up your recent code updates, you can restart it using command prompt - net stop SPTimerV4 and net start SPTimerV4)
About sending mail - make sure that your mail server configured and working (write a ...
I like Arsalan's answer, however MS is pushing people to avoid server side development, which includes Timer Jobs. As timer jobs run on the SharePoint server, a poorly written timer job can have a negative impact on the farm. Also, if a customer ever moves to Office 365, any custom timer jobs will have to be re-written.
An app run by the windows task ...
The timer job is run by SharePoint Timer Service (OWSTimer.exe). So you need to restart the service (so that the new dll is referenced) from the Services control panel.
To open Services, Start>Control Panel>Administrative Tools>Services. Right-click the SharePoint Timer Service and click Restart.
Here are few more differences between Timer Job and Windows Task schedulers:
Timer jobs require downtime to deploy.
Control via Central Admin.
Schedule of Timer Job will be backed up and restore in your normal process of SharePoint backup and restore.
Can be deployed using standard WSP solution.
Custom Timer Jobs provides the power to specify ...
The actual point is: there's no need at all to use SPSecurity.RunWithElevatedPrivileges in a job.
A job runs in OWSTIMER.exe, which uses the "SPFarm" account. "SPFarm" account has all privileges against all content DBs; it's seen as "system account" everywhere. So there's really no need to elevate its privileges at all.
However, as a side note, code ...
Your scope of timer job is already at Web Application.
So what you have to do is, just make sure the feature should not be auto activated. You just disable the setting Automatically Activate.
So, just activate the feature on the Web Application you need to use.
A job does not have a thing such as a "scope". They have a lock (Job, Database and None) but that's something else.
So you're actually talking about the scope of the feature that deploys (through a feature event receiver).
Several things have to be noted:
Web application-scoped features are (by default) automatically activated when the WSP is deployed. ...
Just to accomplish what John said, you can create a schedules task for the following PowerShell script:
$UserProfileService= Get-SPServiceApplication 42gg4bda-1hd0-4df6-bfgg-54gd4df33ff
P.S. Full Import can be intensive though so be very careful with the schedule.
This article can probably help you, briefly, you will need to set ContentService.RemoteAdministratorAccessDenied setting to false.
PowerShell code (copy-pasted from the article):
$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$contentService.RemoteAdministratorAccessDenied = $false
5 minutes is a good default setting. Setting it less than that as suggested can cause additional overhead. Where I've seen it be really bad, is when it's set to one minute, and yet it takes longer than a minute to finish all of the timer jobs. I've seen cases where the timer job has hung. Really depends on the environment, number of users, and if you're ...
Enabling document id on a hierarchy of sites is not as straight forward as one should think.
I have digged pretty deep into this one more than one occasion (might collect it to a blog post later), and it all boils down to the SPWorkItems that the timer job uses to enable document id on the sites/subsites and the timer job that sets the document id on each ...
Each SharePoint Timer Job has a property bag (SPPersistedObject) that it can read from. When I write timer jobs that need to have configuration that is where I store it. Accessing this configuration information from your timer job is as easy as having code like the following in your Execute() method. In the example below, I put all of my configuration as ...
In order to execute RunNow method Farm Administrator rights are required. When you use RunWithElevatedPrivileges method, the code runs in the context of application pool account, which usually does not have farm admin rights (and it should not have it according to best practices)
So the solution is to run the code in context of some user that does have farm ...
You cannot configure a timer job like that. The best approach you can go for is:
Configure the timer job to use an hourly schedule (run every hour)
At the start of timer job check if DateTime.Now.Hour is divisible by 4.
If not, exit the job, if yes - continue.
To set up a timer job to use hourly schedule, use the following code:
string strJobTitle = "...
Yes, The web application will work fine. because it relies on IIS!
The SharePoint Timer service is a windows service that runs other
services according to schedules specified in timer jobs. If it stops,
all services and timer jobs controlled by the SharePoint timer service
will be stopped, use Get-SPTimerJob to return timer jobs
You need to have SharePoint installed for you to develop for it. No getting around that. You could just write pure CAML and use a standard C# assembly project for the DLLs, and use something like WSPBuilder to compile it into a deployable WSP file, though you would be unable to test your development as you went along, and it would take you a horrendously ...
Ok, first are both checkboxes at the bottom marked ("Show processes from all users" and "Show processes in all sessions")? If so, maybe you changed the type of code shown under the "Attach to:" field. I would dig through these three settings.
If you still can't find the process after that, try an old fashioned reboot.
One thing to remember when you are using site-scoped or site collection–scoped Features to install the timer jobs: The account that does the scheduling must have write permissions to the configuration database of the server farm. Usually, the identity of the application pool that is hosting the SharePoint site does not have permissions on the configuration ...
Benefits of Sharepoint Timer jobs over Windows Task Scheduler are :
Single point of failure : Windows Task Scheduler need to be configured on all the web servers. If you configure to run the job on 1 server only, and this server crashes, job will not work at all.
Status Reporting : Windows Task Scheduler doesn't have any reporting on when was the last time ...
Number of items in a list as per your description not a big because SharePoint can store millions of items in a List. Only problem is the List view Threshold, Number items are returns in a view cause the issue if it breach MSFT best practice limit( 5000 items).
Their are ways to deal with large with i.e using the index column, metadata columns etc
Here is ...
It's not possible to configure (change schedule, trigger, etc.) timer jobs in SharePoint Online.
The best thing you can do is to make sure your policy settings are good and wait for jobs to be completed. :)
1. What happens when share point timer stops?
As Chicago has mentioned, If it stops, all services and timer jobs controlled by the SharePoint timer service will be stopped. This means:
Your workflows will stop
Alert mails will stop
Search crawling will stop (means you will not able to search new items)
Cleanup Jobs will stop (this will result in increase ...
AFAIK, there is no standard way to achieve this.
But this can be done programmatically with no apparent troubles.
In this case, I would recommend you to create a timer job, and based on settings stored in detached "configuration" list - change permissions on particular folders every night (or more often, if needed).
I assume, the "configuration" list ...
There is no "cancel" method on SPSolution's.
If you still have the solution file(s) you can just add the solution again and re-i stall it. First you should start timer job and finish the retraction, and remove solutions though...