Table of Contents

Interface ISite

Namespace
PnP.Core.Model.SharePoint
Assembly
PnP.Core.dll

Public interface to define a Site object of SharePoint Online

public interface ISite : IDataModel<ISite>, IDataModelParent, IDataModelWithContext, ISupportModules<ISite>, IDataModelGet<ISite>, IDataModelLoad<ISite>, IDataModelUpdate, IDataModelSupportingGetChanges
Inherited Members
Extension Methods

Properties

All

A special property used to add an asterisk to a $select statement

object All { get; }

Property Value

object

AllWebs

Collection of sub-webs in the current Site object Implements IQueryable<T>.
See Requesting model collections and IQueryable performance considerations to learn more.

IWebCollection AllWebs { get; }

Property Value

IWebCollection

AllowCreateDeclarativeWorkflow

Gets or sets a value that specifies whether the creation of declarative workflows is allowed on this site collection.

bool AllowCreateDeclarativeWorkflow { get; set; }

Property Value

bool

AllowDesigner

Gets or sets a value that specifies whether a designer can be used on this site collection.

bool AllowDesigner { get; set; }

Property Value

bool

AllowExternalEmbeddingWrapper

Gets or sets a value that specifies whether external embedding wrapper is allowed on this site collection. 0 means "Don't allow embedding any external domains" 1 means "Only allow embedding external domains from allow-embed-domains-list" 2 means "Allow embedding any external domains"

int AllowExternalEmbeddingWrapper { get; set; }

Property Value

int

AllowMasterPageEditing

Gets or sets a value that specifies whether master page editing is allowed on this site collection.

bool AllowMasterPageEditing { get; set; }

Property Value

bool

AllowRevertFromTemplate

Gets or sets a value that specifies whether this site collection can be reverted to its base template.

bool AllowRevertFromTemplate { get; set; }

Property Value

bool

AllowSaveDeclarativeWorkflowAsTemplate

Gets or sets a value that specifies whether it is allowed to save declarative workflows as template on this site collection.

bool AllowSaveDeclarativeWorkflowAsTemplate { get; set; }

Property Value

bool

AllowSavePublishDeclarativeWorkflow

Gets or sets a value that specifies whether it is allowed to save and publish declarative workflows on this site collection.

bool AllowSavePublishDeclarativeWorkflow { get; set; }

Property Value

bool

AuditLogTrimmingRetention

This is the number of days of audit log data to retain. If unset and audit trimming is enabled, the retention defaults default configured schedule for trimming

int AuditLogTrimmingRetention { get; set; }

Property Value

int

CanSyncHubSitePermissions

Gets or sets value if syncing hub site permissions to this associated site is allowed.

bool CanSyncHubSitePermissions { get; set; }

Property Value

bool

ChannelGroupId

Gets the ID of the Modern Group associated with this site.

Guid ChannelGroupId { get; }

Property Value

Guid

Classification

The Classification of the Site object

string Classification { get; set; }

Property Value

string

CommentsOnSitePagesDisabled

Gets or sets a value that specifies whether the comments on site pages are disabled on this site collection.

bool CommentsOnSitePagesDisabled { get; set; }

Property Value

bool

DisableAppViews

Sets whether or not to disable app views for all child webs. True means app views are disabled throughout the site collection; False otherwise.

bool DisableAppViews { get; set; }

Property Value

bool

Sets whether or not to disable company sharing links for all child webs. True means companywide sharing links are disabled throughout the site collection, regardless of the settings on the root or child webs. False means each web can individually decide whether to turn on or off companywide sharing links.

bool DisableCompanyWideSharingLinks { get; set; }

Property Value

bool

DisableFlows

Sets whether or not to disable Flows for all child webs. True means Flows are disabled throughout the site collection; False otherwise.

bool DisableFlows { get; set; }

Property Value

bool

EventReceivers

Event Receivers defined in this web Implements IQueryable<T>.
See Requesting model collections and IQueryable performance considerations to learn more.

IEventReceiverDefinitionCollection EventReceivers { get; }

Property Value

IEventReceiverDefinitionCollection

ExternalSharingTipsEnabled

Gets a boolean value that specifies whether users will be greeted with a notification bar telling them that the site can be shared with external users. True - notification bar is enabled; False - otherwise

bool ExternalSharingTipsEnabled { get; }

Property Value

bool

ExternalUserExpirationInDays

Property that indicates the default number of days an external user will expire in. 0 if the policy is disabled or unavailable, otherwise the number of days

int ExternalUserExpirationInDays { get; }

Property Value

int

Features

Collection of features enabled for the site Implements IQueryable<T>.
See Requesting model collections and IQueryable performance considerations to learn more.

IFeatureCollection Features { get; }

Property Value

IFeatureCollection

GeoLocation

returns the Geo Location hosting this site collection

string GeoLocation { get; }

Property Value

string

GroupId

The unique ID of the associated Microsoft 365 Group (if any)

Guid GroupId { get; }

Property Value

Guid

HubSiteId

Gets the ID of the HubSite this site is associated with.

Guid HubSiteId { get; }

Property Value

Guid

Remarks

Use JoinHubSite method to change the value of this property.

HubSiteSynchronizableVisitorGroup

Gets the synchronizable visitor group for a hub site

ISharePointGroup HubSiteSynchronizableVisitorGroup { get; }

Property Value

ISharePointGroup

Id

The Unique ID of the Site object

Guid Id { get; }

Property Value

Guid

IsHubSite

Returns whether or not this site is a HubSite. Hub sites can be associated with one or more sites.

bool IsHubSite { get; }

Property Value

bool

LockIssue

Gets the comment that is used in locking a site collection.

string LockIssue { get; }

Property Value

string

MaxItemsPerThrottledOperation

Maximum items that will not be throttled per operation.

int MaxItemsPerThrottledOperation { get; }

Property Value

int

ReadOnly

Gets or sets a bool value that specifies whether the site collection is read-only, locked, and unavailable for write access.

bool ReadOnly { get; set; }

Property Value

bool

RecycleBin

Gets a value that specifies the collection of Recycle Bin items for the site collection. Implements IQueryable<T>.
See Requesting model collections and IQueryable performance considerations to learn more.

IRecycleBinItemCollection RecycleBin { get; }

Property Value

IRecycleBinItemCollection

RelatedGroupId

Gets the ID of the Modern Group related to this site.

Guid RelatedGroupId { get; }

Property Value

Guid

RootWeb

The RootWeb of the Site object

IWeb RootWeb { get; }

Property Value

IWeb

SearchBoxInNavBar

Whether suite nav search box is shown on modern and classic pages

SearchBoxInNavBar SearchBoxInNavBar { get; set; }

Property Value

SearchBoxInNavBar

SearchBoxPlaceholderText

Search placeholder text for search box in navbar - overrides default placeholder text if set.

string SearchBoxPlaceholderText { get; set; }

Property Value

string

SensitivityLabel

Information Protection Label Id for an individual site collection

string SensitivityLabel { get; }

Property Value

string

SensitivityLabelId

Gets the Information Protection Label Id for an individual site collection.

Guid SensitivityLabelId { get; }

Property Value

Guid

ServerRelativeUrl

Gets the server-relative URL of the root Web site in the site collection.

string ServerRelativeUrl { get; }

Property Value

string

ShareByEmailEnabled

ShareByEmailEnabled when true means that user's will be able to grant permissions to guests for resources within the site collection

bool ShareByEmailEnabled { get; set; }

Property Value

bool

ShareByLinkEnabled

Property that indicates whether users will be able to share links to documents that can be accessed without logging in.

bool ShareByLinkEnabled { get; }

Property Value

bool

ShowPeoplePickerSuggestionsForGuestUsers

Gets or sets a value that specifies whether guest users should be displayed as suggestions in people picker on this site collection.

bool ShowPeoplePickerSuggestionsForGuestUsers { get; set; }

Property Value

bool

SocialBarOnSitePagesDisabled

Defines whether social bar is disabled on Site Pages in this site collection

bool SocialBarOnSitePagesDisabled { get; set; }

Property Value

bool

Gets or sets a value that specifies the status bar link on this site collection (sets the SiteStatusBarLink property on the root web).

string StatusBarLink { get; set; }

Property Value

string

StatusBarText

Gets or sets a value that specifies the text of the status bar on this site collection (sets the SiteStatusBarText property on the root web).

string StatusBarText { get; set; }

Property Value

string

ThicketSupportDisabled

Gets a value that indicates whether thicket support is disabled on this site collection.

bool ThicketSupportDisabled { get; }

Property Value

bool

TrimAuditLog

When this flag is set for the site, the audit events are trimmed periodically.

bool TrimAuditLog { get; set; }

Property Value

bool

Url

The URL of the Site object

Uri Url { get; }

Property Value

Uri

UserCustomActions

Gets a value that specifies the collection of user custom actions for the site collection. Implements IQueryable<T>.
See Requesting model collections and IQueryable performance considerations to learn more.

IUserCustomActionCollection UserCustomActions { get; }

Property Value

IUserCustomActionCollection

Methods

CreateCopyJobs(string[], string, CopyMigrationOptions, bool, int)

Creates a new migration job

Array of the objects to migrate (absolute url to the file / folder) Destination URI to where the objects have to be migrated Migration options Defines if we have to wait until all the migrations have finished Duration between every GetCopyJobProgress call in seconds. Defaults to 1. List of all the jobs being created (one for every exportObjectUri)
IList<ICopyMigrationInfo> CreateCopyJobs(string[] exportObjectUris, string destinationUri, CopyMigrationOptions options, bool waitUntilFinished = false, int waitAfterStatusCheck = 1)

Parameters

exportObjectUris string[]
destinationUri string
options CopyMigrationOptions
waitUntilFinished bool
waitAfterStatusCheck int

Returns

IList<ICopyMigrationInfo>

CreateCopyJobsAsync(string[], string, CopyMigrationOptions, bool, int)

Creates a new migration job

Array of the objects to migrate (absolute url to the file / folder) Destination URI to where the objects have to be migrated Migration options Defines if we have to wait until all the migrations have finished Duration between every GetCopyJobProgress call in seconds. Defaults to 1. List of all the jobs being created (one for every exportObjectUri)
Task<IList<ICopyMigrationInfo>> CreateCopyJobsAsync(string[] exportObjectUris, string destinationUri, CopyMigrationOptions options, bool waitUntilFinished = false, int waitAfterStatusCheck = 1)

Parameters

exportObjectUris string[]
destinationUri string
options CopyMigrationOptions
waitUntilFinished bool
waitAfterStatusCheck int

Returns

Task<IList<ICopyMigrationInfo>>

EnsureCopyJobHasFinished(IList<ICopyMigrationInfo>, int)

Ensures that a migration job has completely run

List of migration jobs to check the process of Duration between every GetCopyJobProgress call in seconds. Defaults to 1.
void EnsureCopyJobHasFinished(IList<ICopyMigrationInfo> copyMigrationInfos, int waitAfterStatusCheck = 1)

Parameters

copyMigrationInfos IList<ICopyMigrationInfo>
waitAfterStatusCheck int

EnsureCopyJobHasFinishedAsync(IList<ICopyMigrationInfo>, int)

Ensures that a migration job has completely run

List of migration jobs to check the process of Duration between every GetCopyJobProgress call in seconds. Defaults to 1.
Task EnsureCopyJobHasFinishedAsync(IList<ICopyMigrationInfo> copyMigrationInfos, int waitAfterStatusCheck = 1)

Parameters

copyMigrationInfos IList<ICopyMigrationInfo>
waitAfterStatusCheck int

Returns

Task

GetAnalytics(AnalyticsOptions)

Gets site analytics

List<IActivityStat> GetAnalytics(AnalyticsOptions options = null)

Parameters

options AnalyticsOptions

Defines which analytics are needed

Returns

List<IActivityStat>

The requested analytics data

GetAnalyticsAsync(AnalyticsOptions)

Gets site analytics

Task<List<IActivityStat>> GetAnalyticsAsync(AnalyticsOptions options = null)

Parameters

options AnalyticsOptions

Defines which analytics are needed

Returns

Task<List<IActivityStat>>

The requested analytics data

GetAvailableComplianceTags()

Retrieves the available compliance tags / retention labels for this site

IEnumerable<IComplianceTag> GetAvailableComplianceTags()

Returns

IEnumerable<IComplianceTag>

GetAvailableComplianceTagsAsync()

Retrieves the available compliance tags / retention labels for this site

Task<IEnumerable<IComplianceTag>> GetAvailableComplianceTagsAsync()

Returns

Task<IEnumerable<IComplianceTag>>

GetCopyJobProgress(ICopyMigrationInfo)

Gets the progress of an existing migration info object

Migration job to get the progress of Progress of the copy job
ICopyJobProgress GetCopyJobProgress(ICopyMigrationInfo copyMigrationInfo)

Parameters

copyMigrationInfo ICopyMigrationInfo

Returns

ICopyJobProgress

GetCopyJobProgressAsync(ICopyMigrationInfo)

Gets the progress of an existing migration info object

Migration job to get the progress of Progress of the copy job
Task<ICopyJobProgress> GetCopyJobProgressAsync(ICopyMigrationInfo copyMigrationInfo)

Parameters

copyMigrationInfo ICopyMigrationInfo

Returns

Task<ICopyJobProgress>

GetHubSiteData(Guid?)

Gets hubsite data from the current site OR another specified hub site ID

IHubSite GetHubSiteData(Guid? id)

Parameters

id Guid?

Hub Site Guid

Returns

IHubSite

GetHubSiteDataAsync(Guid?)

Gets hubsite data from the current site OR another specified hub site ID

Task<IHubSite> GetHubSiteDataAsync(Guid? id)

Parameters

id Guid?

Hub Site Guid

Returns

Task<IHubSite>

GetSearchConfigurationManagedProperties()

Gets the managed properties from the search configuration of this site

List<IManagedProperty> GetSearchConfigurationManagedProperties()

Returns

List<IManagedProperty>

List of managed properties

GetSearchConfigurationManagedPropertiesAsync()

Gets the managed properties from the search configuration of this site

Task<List<IManagedProperty>> GetSearchConfigurationManagedPropertiesAsync()

Returns

Task<List<IManagedProperty>>

List of managed properties

GetSearchConfigurationXml()

Gets the search configuration of the web

string GetSearchConfigurationXml()

Returns

string

Search configuration XML

GetSearchConfigurationXmlAsync()

Gets the search configuration of the web

Task<string> GetSearchConfigurationXmlAsync()

Returns

Task<string>

Search configuration XML

IsHomeSite()

Checks if current site is a HomeSite

bool IsHomeSite()

Returns

bool

IsHomeSiteAsync()

Checks if current site is a HomeSite

Task<bool> IsHomeSiteAsync()

Returns

Task<bool>

JoinHubSite(Guid)

Associates the current site to a primary hub site

bool JoinHubSite(Guid hubSiteId)

Parameters

hubSiteId Guid

Returns

bool

JoinHubSiteAsync(Guid)

Associates the current site to a primary hub site

Task<bool> JoinHubSiteAsync(Guid hubSiteId)

Parameters

hubSiteId Guid

Returns

Task<bool>

RegisterHubSite()

Registers the current site as a primary hub site

IHubSite RegisterHubSite()

Returns

IHubSite

RegisterHubSiteAsync()

Registers the current site as a primary hub site

Task<IHubSite> RegisterHubSiteAsync()

Returns

Task<IHubSite>

SetSearchConfigurationXml(string)

Sets the search configuration for the site

void SetSearchConfigurationXml(string configuration)

Parameters

configuration string

Search configuration, obtained via GetSearchConfigurationXml() to apply

SetSearchConfigurationXmlAsync(string)

Sets the search configuration for the site

Task SetSearchConfigurationXmlAsync(string configuration)

Parameters

configuration string

Search configuration, obtained via GetSearchConfigurationXml() to apply

Returns

Task

UnJoinHubSite()

Disassociates current site from primary hub site

bool UnJoinHubSite()

Returns

bool

UnJoinHubSiteAsync()

Disassociates current site from primary hub site

Task<bool> UnJoinHubSiteAsync()

Returns

Task<bool>

UnregisterHubSite()

Unregisters the current site as a primary hub site

bool UnregisterHubSite()

Returns

bool

UnregisterHubSiteAsync()

Unregisters the current site as a primary hub site

Task<bool> UnregisterHubSiteAsync()

Returns

Task<bool>