Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a question about getting the default WebApplication in the farm - how do I do it?

I need to, because my timer job must be completed only for one WebApplication.

PS: I'm using SharePoint 2010

share|improve this question
add comment

3 Answers 3

There is no such thing as a default WebApplication in a SharePoint farm.

The closest thing would be the WebApplication for Central Administration, but that's usually not the one you would like to get.

If you want to get that then you can Access the WebApplications property of the AdministrationService static property of SPWebService (here in PowerShell syntax)

[Microsoft.Sharepoint.Administration.SPWebService]::AdministrationService.WebApplications
share|improve this answer
add comment

As mentioned, there is no default Web Application.

You can install a timer job using a Feature. You need to use the FeatureActivated method in a Feature Receiver.

Your Feature needs to have the Web Application scope. This will let you activate the Feature in a chosen Web Application, using Central Administration.

The Web Application then runs with the context of the current Web Application.

Read this tutorial on MSDN for more information on how to do this: http://msdn.microsoft.com/en-us/library/ff798313.aspx

share|improve this answer
add comment

To be clear many of the videos from MS Technet will refer to a Default Webapp. However, they are just referring to the default Webapp that they built after installing SharePoint 2010 for demoing reasons. Central Adminastration is not a Default WebApp but, the main WebApp tool much like PowerShell, IIS, FeatureAdmin(Codeplex) and so on. So, don't think anything of it when those videos mention it or any other source.

To answer your question: 1. On App Server - Start - Central Administration 2. In Central Admin Click Monitoring 3. In monitoring find the Timer Job 4. Note the WebApp it is running on and disable it on all WebApps you don't want the timer to run on.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.