Compartilhar via


SPSite Members

Include Protected Members
Include Inherited Members

Represents a collection of sites in a Web application, including a top-level Web site and all its subsites. Each SPSite object, or site collection, is represented within an SPSiteCollection object that consists of the collection of all site collections in the Web application.

The SPSite type exposes the following members.

Constructors

  Name Description
Public method SPSite(Guid) Initializes a new instance of the SPSite class based on the specified ID for a site collection.
Public method SPSite(String) Initializes a new instance of the SPSite class based on the specified URL.
Public method SPSite(Guid, SPUrlZone) Initializes a new instance of the SPSite class based on the specified site collection GUID and URL zone.
Public method SPSite(Guid, SPUserToken) Initializes a new instance of the SPSite class based on the specified site collection GUID and user token.
Public method SPSite(String, SPUserToken) Initializes a new instance of the SPSite class based on the specified absolute URL and user token.
Public method SPSite(Guid, SPUrlZone, SPUserToken) Initializes a new instance of the SPSite class based on the specified site collection GUID, URL zone, and user token.

Top

Properties

  Name Description
Public property AdministrationSiteType Represents administration site types supported by SharePoint Foundation.
Public property AllowDesigner Used to assign or retrieve the Site Collection Allow Designer property.
Public property AllowMasterPageEditing Used to assign or retrieve the Site Collection property that allows master page editing.
Public property AllowRevertFromTemplate Used to assign or retrieve the Site Collection property that allows reverting from a template.
Public property AllowRssFeeds Gets a Boolean value that specifies whether the site collection allows RSS feeds.
Public property AllowUnsafeUpdates Gets or sets a Boolean value that specifies whether to allow updates to the database as a result of a GET request or without requiring a security validation.
Public property AllWebs Gets the collection of all Web sites that are contained within the site collection, including the top-level site and its subsites.
Public property ApplicationRightsMask Gets the rights mask for the parent Web application of the site collection.
Public property Audit Gets an audit store that is attached to the site collection.
Public property AuditLogTrimmingCallout Gets or sets the class name of the object that performs audit log trimming.
Public property AuditLogTrimmingRetention Gets or sets the number of days of audit log data to retain.
Public property AverageResourceUsage the average resource usage of the site collection over the configured window in days.
Public property BrowserDocumentsEnabled Indicates whether the documents can be opened in a browser or not.
Public property Cache A thread-safe cache that may be used to store very small amounts of data associated with this SPSite.
Public property CatchAccessDeniedException Reserved for internal use. Use the CatchAccessDeniedException property instead to specify whether SharePoint Foundation traps and handles “Access Denied” exceptions.
Public property CertificationDate Gets the date and time on which use of the site collection was confirmed for automatic deletion.
Public property ContentDatabase Gets the content database that is associated with the site collection.
Public property CurrentChangeToken Gets the change token that will be used to log the next change to the site collection.
Public property CurrentResourceUsage Indicates the current resource usage of the site collection.
Public property DeadWebNotificationCount Gets the number of notifications that have been sent about Web sites within the site collection that are out of use.
Public property EventReceivers Provides event receivers for events that occur at the scope of the site collection.
Public property ExternalBinaryIds Obsolete. Gets an SPExternalBinaryIdCollection object that is used to retrieve the IDs of external binary large object (BLOB) files that are contained in the external BLOB store provider (EBS Provider).
Public property FeatureDefinitions Gets the collection of feature definitions for the site collection.
Public property Features Gets the collection of SPFeature objects that are associated with the site collection.
Public property GlobalPermMask Obsolete. Use the ApplicationRightsMask property to get the rights mask for the Web application instead. (In Windows SharePoint Services 2.0, the GlobalPermMask property got the rights for the permissions mask that was used globally on the virtual server.)
Public property HostHeaderIsSiteName Gets a Boolean value that specifies whether the host header is used instead of the server-relative path to uniquely identify the site collection.
Public property HostName Gets the name of the server that hosts the site collection.
Public property ID Gets the GUID that identifies the site collection.
Public property IISAllowsAnonymous Gets a Boolean value that indicates whether anonymous access is enabled in Microsoft Internet Information Services (IIS).
Public property Impersonating Gets a Boolean value that indicates the impersonation status of the SPSite object.
Public property IsPaired Obsolete. Gets a Boolean value that indicates whether the site collection is paired with its parent.
Public property LastContentModifiedDate Gets the date and time in Coordinated Universal Time (UTC) when the content of the site was last changed.
Public property LastSecurityModifiedDate Gets the date and time in Coordinated Universal Time (UTC) when security on the site was last changed.
Public property LockIssue Gets or sets the comment that is used in locking a site collection.
Public property Owner Gets or sets the owner of the site collection. (Read-only in sandboxed solutions.)
Public property Port Gets the port number that is used for input and output on the virtual server that contains the site collection.
Public property PortalName Gets or sets the name of a portal. (Read-only in sandboxed solutions.)
Public property PortalUrl Gets or sets the URL to a portal. (Read-only in sandboxed solutions.)
Public property Protocol Gets the protocol that is used by the server.
Public property Quota Gets or sets a quota for the site collection.
Public property ReadLocked This member is reserved for internal use and is not intended to be used directly from your code. Use the SPSiteAdministration.ReadLocked property of the SPSiteAdministration class instead. Sets, and in some cases gets, a Boolean value that specifies whether the site collection is locked and unavailable for Read access.
Public property ReadOnly Gets or sets a Boolean value that specifies whether the site collection is read-only, locked, and unavailable for write access.
Public property RecycleBin Gets the collection of recycle bin items for the site collection.
Public property ResourceQuotaExceeded Indicates whether the resource quota limit for this site collection has been exceeded since the last daily quota reset or not.
Public property ResourceQuotaExceededNotificationSent Indicates whether a resource quota exceeded notification was sent (or not) for this site collection since the last daily quota reset.
Public property ResourceQuotaWarningNotificationSent Indicates whether a resource quota warning notification was sent or not for this site collection since the last daily quota reset.
Public property RootWeb Gets the root Web site of the site collection.
Public property SearchServiceInstance Gets an SPServiceInstance object that represents an instance of the SharePoint Search service that is associated with the site collection.
Public property SecondaryContact Gets or sets the secondary contact that is used for the site collection. (Read-only in sandboxed solutions.)
Public property ServerRelativeUrl Gets the server-relative URL of the root Web site in the site collection.
Public property ShowURLStructure Indicates whether to show the site collection URL structure.
Public property SiteSubscription Gets the subscription to which this site collection belongs.
Public property Solutions Gets the collection of user solutions that have been activated for the site collection.
Public property SyndicationEnabled Gets or sets a Boolean value that specifies whether RSS syndication is enabled for the site collection.
Public property SystemAccount Gets the system account of the site collection.
Public property TrimAuditLog Gets or sets a value that specifies whether to remove excess from the audit log periodically.
Public property UIVersionConfigurationEnabled Gets or sets a Boolean value that specifies whether to enable the visual upgrade user interface (UI) for changing the UI version of the site collection.
Public property UpgradeRedirectUri Obsolete. Gets an object representation of the upgrade redirect uniform resource identifier (URI) of the site collection.
Public property Url Gets the full URL to the root Web site of the site collection, including host name, port number, and path.
Public property Usage Gets information about site usage, including bandwidth, storage, and number of visits to the site collection.
Public property UserAccountDirectoryPath Obsolete. Gets or sets the provider-specific user account directory path for the site collection.
Public property UserCodeEnabled Gets a value that indicates whether the user code service is enabled for the site collection.
Public property UserCustomActions Gets the SPUserCustomActionCollection object that contains a list of SPUserCustomAction objects that are assigned to this site.
Public property UserDefinedWorkflowsEnabled Gets or sets a Boolean value that indicates whether user-defined workflows are enabled.
Public property UserToken Gets the user token that is associated with the site collection.
Public property WarningNotificationSent Gets a Boolean value that indicates whether a warning notification has been sent.
Public property WebApplication Gets the SharePoint Foundation Web application to which the site collection belongs.
Public property WorkflowManager Gets the SPWorkflowManager object that is associated with the site collection, enabling you to centrally control the workflow templates and instances across the site collection.
Public property WriteLocked Gets or sets a Boolean value that specifies whether the site collection is locked and unavailable for Write access.
Public property Zone Gets the URL zone that was specified in the constructor that was used to create the current SPSite object.

Top

Methods

  Name Description
Public method AddWorkItem(Guid, DateTime, Guid, Guid, Guid, Int32, Boolean, Guid, Guid, Int32, [], String, Guid) Adds a work item to the site collection.
Public method AddWorkItem(Guid, DateTime, Guid, Guid, Guid, Int32, Boolean, Guid, Guid, Int32, [], String, Guid, Boolean) Adds a work item to the site collection.
Public method BypassUseRemoteApis Bypasses using SOAP, WebDAV, or Microsoft Office SharePoint Designer 2007 interfaces to access the site collection.
Public method CheckForPermissions Checks the permissions for a given set of rights and throws an Unauthorized Access exception if the permission check fails.
Public method Close Closes the site collection and releases resources.
Public method ConfirmUsage Certifies that the site collection is in use.
Public method Delete() Deletes the site collection from the server.
Public method Delete(Boolean) Deletes the site collection from the server and removes the site collection users from Active Directory Domain Services (ADDS) if bDeleteADAccounts is true.
Public method Delete(Boolean, Boolean) Deletes the site collection from the server, optionally removes the site collection users from Active Directory Domain Services (ADDS), and optionally uses a timer job to delete the site collection gradually.
Public method Dispose Releases all unmanaged resources that are used by the site collection object.
Public method DoesUserHavePermissions(SPReusableAcl, SPBasePermissions) Returns a Boolean value indicates whether the user has permissions for the specified set of rights.
Public method DoesUserHavePermissions(SPReusableAcl, SPBasePermissions, SPWeb) Returns a Boolean value that indicates whether the user has permissions for the specified Web site and set of rights.
Public method Equals (Inherited from Object.)
Public methodStatic member Exists Returns a Boolean value that indicates whether the specified site collection exists.
Protected method Finalize (Inherited from Object.)
Public method GetAllReusableAcls() Returns the reusable access control lists (ACLs) for the site collection.
Public method GetAllReusableAcls(Int32) Returns the reusable access control lists (ACLs) of the site collection up to a specified limit.
Public method GetCatalog Returns the list template gallery, site template gallery, Web Part gallery, master page gallery, or other galleries from the site collection, including custom galleries that are defined by users.
Public method GetChanges() Returns the default number of changes listed in the current change log for the site collection.
Public method GetChanges(SPChangeQuery) Returns a collection of changes from the change log filtered by the specified query.
Public method GetChanges(SPChangeToken) Returns a collection of changes, starting from a particular point in the change log.
Public method GetChanges(SPChangeToken, SPChangeToken) Returns a collection of changes that have been logged over a specified period of time.
Public method GetCustomListTemplates Returns the collection of custom list templates, which are created by end users, from the specified site.
Public method GetCustomWebTemplates Returns the collection of site templates for the site collection based on the specified locale ID (LCID).
Public method GetEffectiveRightsForAcl(SPReusableAcl) Returns the actual permissions that the current user has for the specified Access Control List (ACL).
Public method GetEffectiveRightsForAcl(SPReusableAcl, SPWeb) Returns the actual permissions that the current user has for the specified access control list (ACL).
Public method GetHashCode (Inherited from Object.)
Public method GetRecycleBinItems Returns a collection of recycle bin items based on the specified query.
Public method GetRecycleBinStatistics Gets both the number of items in the recycle bin and its size.
Public method GetReusableAclForScope Returns the reusable access control list (ACL) for the specified scope.
Public method GetSelfServiceSiteCreationSettings Gets the settings that are used for Self-Service Site Creation.
Public method GetType (Inherited from Object.)
Public method GetVisualReport Retrieves a list of SPSite.WebVisualReport objects for all Web sites in this site collection and their corresponding visual upgrade data.
Public method GetWebTemplates Returns the collection of site definitions that are available for creating Web sites within the site collection.
Public method GetWorkItems Returns the individual work items, number of columns, and number of rows in the specified work item collection as output parameters.
Public methodStatic member InvalidateCacheEntry Removes the specified cache entry and returns a Boolean value that indicates whether the entry was cached.
Public methodStatic member LookupUriInRemoteFarm Returns the Uniform Resource Identifier (URI) of a Web site in the specified remote server farm.
Public method MakeFullUrl Returns the full URL for the specified server-relative URL.
Protected method MemberwiseClone (Inherited from Object.)
Public method OpenWeb() Returns the Web site that is associated with the URL that is used in an SPSite constructor.
Public method OpenWeb(Guid) Returns the Web site with the specified GUID.
Public method OpenWeb(String) Returns the Web site that is located at the specified server-relative or site-relative URL.
Public method OpenWeb(String, Boolean) Returns the Web site that is located at the specified server-relative or site-relative URL based on a Boolean value that specifies whether the exact URL must be supplied.
Public method QueryFeatures(Guid) Gets a collection of the features deployed in this site collection that have a specific definition identifier.
Public method QueryFeatures(Guid, Boolean) Gets a collection of the features deployed in this site collection that have a specific definition identifier, including only features that either do or do not need to be upgraded.
Public method QueryFeatures(Guid, Version) Gets a collection of the features deployed in this site collection that have a specific definition identifier and a specific version.
Public method QueryFeatures(SPFeatureScope, Boolean) Gets a collection of the features deployed in this site collection with either Site or Web scope, including only features that either do or do not need to be upgraded.
Public method RecalculateStorageUsed Recalculates the storage that is used by the site collection.
Public method RefreshEmailEnabledObjects Refreshes the email–enabled objects of the site collection.
Public method Rename Changes the URL of a host-header-named site collection to a new URL.
Public method SelfServiceCreateSite(String, String, String, UInt32, String, String, String, String, String, String, String) Creates a site collection by using Self-Service Site Creation.
Public method SelfServiceCreateSite(String, String, String, UInt32, String, String, String, String, String, String, String, String) Creates a site collection by using Self-Service Site Creation based on the specified quota template and other information.
Public method SelfServiceCreateSite(String, String, String, UInt32, String, String, String, String, String, String, String, String, SPSiteSubscription) Creates a site collection by using Self-Service Site Creation based on the specified quota template and other specified information (see parameter list).
Public method StorageManagementInformation Obsolete. Returns information about storage management for the site collection.
Public method ToString Returns the name of the site collection. (Overrides Object.ToString().)
Public method UpdateValidationKey Updates the key that is used to generate the form digest validation of the site collection.
Public methodStatic member ValidateDomainCompatibility(String, String) Verifies whether two URLs point to the same site collection, even if the domain portions of the URLs are different.
Public methodStatic member ValidateDomainCompatibility(SPSite, SPSite) Verifies that two URLs have compatible domains.
Public method VisualUpgradeWebs Updates all Webs in this site to the new SharePoint UI.

Top

Extension Methods

  Name Description
Public Extension Method ActivateHelpCollection (Defined by SPSiteExtension.)
Public Extension Method DeactivateHelpCollection (Defined by SPSiteExtension.)

Top

Fields

  Name Description
Public fieldStatic member MaxFullUrlLength Represents the maximum number of characters that can be used in the absolute URL for a site collection.
Public fieldStatic member MaxWebNameLength Represents the maximum number of characters that can be used in site names for the site collection.

Top

See Also

Reference

SPSite Class

Microsoft.SharePoint Namespace