Share via


SPWebApplicationCollection class

Represents a collection of SPWebApplication objects.

Inheritance hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPPersistedObjectCollection<SPWebApplication>
    Microsoft.SharePoint.Administration.SPPersistedChildCollection<SPWebApplication>
      Microsoft.SharePoint.Administration.SPWebApplicationCollection

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

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public NotInheritable Class SPWebApplicationCollection _
    Inherits SPPersistedChildCollection(Of SPWebApplication)
'Usage
Dim instance As SPWebApplicationCollection
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public sealed class SPWebApplicationCollection : SPPersistedChildCollection<SPWebApplication>

Remarks

Use the WebApplications property of the SPWebService class to return an SPWebApplicationCollection object that represents the collection of Web applications within a Web service. To create a new Web application within the collection, use the SPWebApplicationBuilder class.

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

Thread safety

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

See also

Reference

SPWebApplicationCollection members

Microsoft.SharePoint.Administration namespace