Export (0) Print
Expand All

SPServiceCollection Class

Represents a collection of SPService objects.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

[GuidAttribute("6CEF670D-FE58-4b38-AF3B-43E7C9365E99")]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPServiceCollection : SPPersistedChildCollection<SPService>

Use the Services property of the SPFarm class to return an SPServiceCollection object that represents the collection of services on the server farm. To add a service to the server farm, use the Add method of the SPPersistedChildCollection<T> class.

Use an indexer to return a single service from the collection. For example, if the collection is assigned to a variable named myServices, use myServices[index] in C#, or myServices(index) in Visual Basic, where index is either the GUID or the name that identifies the service.

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:
© 2015 Microsoft