SPFarm class

Represents a Microsoft SharePoint Foundation farm.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

No code example is currently available or this language may not be supported.

The SPFarm object is the top node in the extensible configuration object model, which is designed to interact with the configuration data store. It contains global settings for all the servers, services, and solutions that are installed in a server farm. Use the Servers, Services, or Solutions property to retrieve these collections.

To access the current server farm object, you can use members on SPFarm.Local. For example, to return an SPServiceCollection object that represents the collection of services in the current server farm, use SPFarm.Local.Services. In addition, you can use the Farm property of classes that derive from the SPPersistedObject class, or you can use the Farm property of the SPSolution class, to get the server farm of the current object or solution.

The following example registers a custom job definition on each Web application within the current server farm.

No code example is currently available or this language may not be supported.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: