Interface IWeb
Public interface to define a Web object of SharePoint Online
Assembly: PnP.Core.dll
Syntax
public interface IWeb : IDataModel<IWeb>, IDataModelParent, IDataModelWithContext, ISupportModules<IWeb>, IDataModelGet<IWeb>, IDataModelLoad<IWeb>, IDataModelUpdate, IDataModelDelete, IDataModelSupportingGetChanges, ISecurableObject, IQueryableDataModel
Properties
Gets the URL of the access request list to the current site.
Declaration
string AccessRequestListUrl { get; }
Property Value
Gets or sets the description of the access request to this site.
Declaration
string AccessRequestSiteDescription { get; set; }
Property Value
A special property used to add an asterisk to a $select statement
Declaration
Property Value
Gets a value that specifies whether the automatic ASPX page indexed is allowed.
Declaration
bool AllowAutomaticASPXPageIndexing { get; set; }
Property Value
Gets a value that specifies whether the current user is allowed to create declarative workflow on this site.
Declaration
bool AllowCreateDeclarativeWorkflowForCurrentUser { get; set; }
Property Value
Gets a value that specifies whether the current user is allowed to use a designer application to customize this site.
Declaration
bool AllowDesignerForCurrentUser { get; set; }
Property Value
Gets a value that specifies whether the current user is allowed to edit the master page.
Declaration
bool AllowMasterPageEditingForCurrentUser { get; }
Property Value
Gets a value that specifies whether the current user is allowed to revert the site to a default site template.
Declaration
bool AllowRevertFromTemplateForCurrentUser { get; }
Property Value
Gets a value that specifies whether the current user is allowed to save declarative workflows as template.
Declaration
bool AllowSaveDeclarativeWorkflowAsTemplateForCurrentUser { get; }
Property Value
Gets a value that specifies whether the current user is allowed to publish a declarative workflow.
Declaration
bool AllowSavePublishDeclarativeWorkflowForCurrentUser { get; }
Property Value
Gets a collection of metadata for the Web site.
Declaration
IPropertyValues AllProperties { get; }
Property Value
The AlternateCSS of the Site, optional attribute.
Declaration
string AlternateCssUrl { get; set; }
Property Value
The instance Id of the App Instance that this website represents.
Declaration
Guid AppInstanceId { get; }
Property Value
Associated SharePoint Member group
Declaration
ISharePointGroup AssociatedMemberGroup { get; }
Property Value
Associated SharePoint owner group
Declaration
ISharePointGroup AssociatedOwnerGroup { get; }
Property Value
Associated SharePoint Visitor group
Declaration
ISharePointGroup AssociatedVisitorGroup { get; }
Property Value
Declaration
ISharePointUser Author { get; }
Property Value
Declaration
IContentTypeCollection AvailableContentTypes { get; }
Property Value
Declaration
IFieldCollection AvailableFields { get; }
Property Value
Gets a boolean value that specifies whether the site contains highly confidential information.
If the tenant settings don't allow tagging sites as confidential, this property will always return false.
Declaration
bool ContainsConfidentialInfo { get; set; }
Property Value
Declaration
IContentTypeCollection ContentTypes { get; }
Property Value
Gets a value that specifies when the site was created.
Declaration
DateTime Created { get; }
Property Value
Gets the current user in the current context
Declaration
ISharePointUser CurrentUser { get; }
Property Value
The Custom MasterPage Url of the Site, optional attribute.
Declaration
string CustomMasterUrl { get; set; }
Property Value
The id of the default new page template. Use SetDefaultNewPageTemplateId to set the value.
Declaration
Guid DefaultNewPageTemplateId { get; set; }
Property Value
The Description of the Site, optional attribute.
Declaration
string Description { get; set; }
Property Value
Gets or sets the design package Id of this site.
Declaration
Guid DesignPackageId { get; set; }
Property Value
Defines whether disable PowerApps for the current web
Declaration
bool DisableAppViews { get; set; }
Property Value
Defines whether disable flows for the current web
Declaration
bool DisableFlows { get; set; }
Property Value
Gets or sets whether the recommended items are disabled on this site.
Declaration
bool DisableRecommendedItems { get; set; }
Property Value
Determines if the Document Library Callout's WAC previewers are enabled or not.
Declaration
bool DocumentLibraryCalloutOfficeWebAppPreviewersDisabled { get; }
Property Value
Get's the permission levels set on this web
Declaration
IBasePermissions EffectiveBasePermissions { get; }
Property Value
Gets or sets a Boolean value that specifies whether the Web site should use Minimal Download Strategy.
Declaration
bool EnableMinimalDownload { get; set; }
Property Value
Declaration
IEventReceiverDefinitionCollection EventReceivers { get; }
Property Value
Defines whether to exclude the web from offline client
Declaration
bool ExcludeFromOfflineClient { get; set; }
Property Value
Declaration
IFeatureCollection Features { get; }
Property Value
Declaration
IFieldCollection Fields { get; }
Property Value
Declaration
IFolderCollection Folders { get; }
Property Value
Defines whether to enable the Horizontal QuickLaunch for the current web
Declaration
bool HorizontalQuickLaunch { get; set; }
Property Value
The Unique ID of the Web object
Declaration
Property Value
Gets a value that indicates whether the homepage is modernized.
Declaration
bool IsHomepageModernized { get; }
Property Value
Defines whether to enable Multilingual capabilities for the current web
Declaration
bool IsMultilingual { get; set; }
Property Value
Gets a value that indicates whether the provisioning is complete.
Declaration
bool IsProvisioningComplete { get; }
Property Value
Gets or sets a value that specifies whether the link to revert homepage is hidden.
Declaration
bool IsRevertHomepageLinkHidden { get; set; }
Property Value
Gets a value that specifies the LCID for the language that is used on the site.
Declaration
Property Value
Gets a value that specifies when an item was last modified in the site.
Declaration
DateTime LastItemModifiedDate { get; }
Property Value
Gets a value that specifies when an item was last modified by user in the site.
Declaration
DateTime LastItemUserModifiedDate { get; }
Property Value
Declaration
IListCollection Lists { get; }
Property Value
Gets or sets the logo alignment of the site.
Declaration
LogoAlignment LogoAlignment { get; set; }
Property Value
Gets or sets the URL of the master page that is used for the website.
Declaration
string MasterUrl { get; set; }
Property Value
Defines whether members can share content from the current web
Declaration
bool MembersCanShare { get; set; }
Property Value
Gets or sets a value that specifies whether the audience targeting is enabled on the navigation of the site.
Declaration
bool NavAudienceTargetingEnabled { get; set; }
Property Value
Declaration
INavigation Navigation { get; }
Property Value
Gets or sets a value that specifies if the Next steps pane should open automatically as a first run experience
when someone visits the site. You can only enable the experience for sites created on or after January 1, 2020
Declaration
bool NextStepsFirstRunEnabled { get; set; }
Property Value
Defines whether the site has to be crawled or not
Declaration
bool NoCrawl { get; set; }
Property Value
Returns if true if the tenant allowed to send push notifications in OneDrive for Business.
Declaration
bool NotificationsInOneDriveForBusinessEnabled { get; }
Property Value
Returns if true if the tenant allowed to send push notifications in SharePoint.
Declaration
bool NotificationsInSharePointEnabled { get; }
Property Value
Gets or sets a value that specifies whether the object cache is enabled on the site.
Declaration
bool ObjectCacheEnabled { get; set; }
Property Value
Defines whether to OverwriteTranslationsOnChange on change for the current web
Declaration
bool OverwriteTranslationsOnChange { get; set; }
Property Value
Indicates whether the tenant administrator has chosen to disable the Preview Features. Default is true.
Declaration
bool PreviewFeaturesEnabled { get; }
Property Value
Gets or sets the primary color of the site.
Declaration
string PrimaryColor { get; }
Property Value
Enables or disables the QuickLaunch for the site
Declaration
bool QuickLaunchEnabled { get; set; }
Property Value
Declaration
IRecycleBinItemCollection RecycleBin { get; }
Property Value
Gets or sets a value that specifies whether the Recycle Bin is enabled.
Declaration
bool RecycleBinEnabled { get; set; }
Property Value
Regional settings configured for this web
Declaration
IRegionalSettings RegionalSettings { get; }
Property Value
The email address to which any access request will be sent
Declaration
string RequestAccessEmail { get; set; }
Property Value
Declaration
IRoleDefinitionCollection RoleDefinitions { get; }
Property Value
Gets the root folder for the website.
Declaration
IFolder RootFolder { get; }
Property Value
Gets or sets a Boolean value that specifies whether the Web site can be saved as a site template.
Declaration
bool SaveSiteAsTemplateEnabled { get; set; }
Property Value
Define if the suitebar search box should show or not
Declaration
SearchBoxInNavBar SearchBoxInNavBar { get; set; }
Property Value
Search placeholder text for search box in navbar - overrides default placeholder text if set, returns null if not set.
Declaration
string SearchBoxPlaceholderText { get; set; }
Property Value
Defines the SearchScope for the site
Declaration
SearchScope SearchScope { get; set; }
Property Value
Gets the server relative URL of the current site.
Declaration
string ServerRelativeUrl { get; }
Property Value
Declaration
ISharePointGroupCollection SiteGroups { get; }
Property Value
Gets or sets the description of the Web site logo.
Declaration
string SiteLogoDescription { get; set; }
Property Value
Gets or sets the server-relative URL of the Web site logo.
This can also contain an absolute URL to the logo.
Declaration
string SiteLogoUrl { get; set; }
Property Value
Gets the UserInfo list of the site collection that contains the website.
Declaration
IList SiteUserInfoList { get; }
Property Value
Declaration
ISharePointUserCollection SiteUsers { get; }
Property Value
List of languages (expressed via their id) that this site supports
Declaration
List<int> SupportedUILanguageIds { get; }
Property Value
PnP.Core.Model.SharePoint.List<System.Int32>
|
Gets or sets a value that specifies whether the RSS feeds are enabled on the site.
Declaration
bool SyndicationEnabled { get; set; }
Property Value
Gets or sets a value that specifies how the tenant admin members can share.
Declaration
SharingState TenantAdminMembersCanShare { get; }
Property Value
Get JSON serialized ThemeData for the current web.
Declaration
string ThemeData { get; }
Property Value
Gets a value that indicates whether third party MDM (Mobile Device Management) is enabled on the site.
Declaration
bool ThirdPartyMdmEnabled { get; }
Property Value
The Title of the Site, optional attribute.
Declaration
string Title { get; set; }
Property Value
Gets or sets value that specifies whether the tree view is enabled on the site.
Declaration
bool TreeViewEnabled { get; set; }
Property Value
The URL of the Web object
Declaration
Property Value
Determines if we need to use the default access request
If this value is True we send access requests to owner/owner's group
If this value is False we send access requests to the configured AccessRequestEmail
Declaration
bool UseAccessRequestDefault { get; }
Property Value
Declaration
IUserCustomActionCollection UserCustomActions { get; }
Property Value
Declaration
IWebCollection Webs { get; }
Property Value
Gets the name of the site definition or site template that was used to create the site.
Declaration
string WebTemplate { get; }
Property Value
Gets the web template configuration of the site.
Declaration
string WebTemplateConfiguration { get; }
Property Value
Gets or sets a value that specifies if the web templates experience should open automatically as a first run experience
after the site was created
Declaration
bool WebTemplatesGalleryFirstRunEnabled { get; set; }
Property Value
Specifies a string that contains the site-relative URL to which users are redirected when web is browsed (typically the site's home page).
Declaration
string WelcomePage { get; }
Property Value
Methods
Adds a web property as an indexed property
Declaration
bool AddIndexedProperty(string propertyName)
Parameters
System.String
propertyName
The property name
|
Returns
System.Boolean
True if it was successfully added or if it is already exists otherwise false
|
Adds a web property as an indexed property
Declaration
Task<bool> AddIndexedPropertyAsync(string propertyName)
Parameters
System.String
propertyName
The property name
|
Returns
Task<System.Boolean>
True if it was successfully added or if it is already exists otherwise false
|
Returns the current web as ISyntexContentCenter if the web is a Syntex Content Center, null is returned otherwise
Declaration
ISyntexContentCenter AsSyntexContentCenter()
Returns
Returns the current web as ISyntexContentCenter if the web is a Syntex Content Center, null is returned otherwise
Declaration
Task<ISyntexContentCenter> AsSyntexContentCenterAsync()
Returns
Checks if a user has a specific kind of permissions to a web
Declaration
bool CheckIfUserHasPermissions(string userPrincipalName, PermissionKind permissionKind)
Parameters
System.String
userPrincipalName
Login name of the user you wish to check if he has a specific permission
|
PermissionKind
permissionKind
Permission kind to check
|
Returns
System.Boolean
Boolean that says if the user has permissions or not
|
Checks if a user has a specific kind of permissions to a web
Declaration
Task<bool> CheckIfUserHasPermissionsAsync(string userPrincipalName, PermissionKind permissionKind)
Parameters
System.String
userPrincipalName
Login name of the user you wish to check if he has a specific permission
|
PermissionKind
permissionKind
Permission kind to check
|
Returns
Task<System.Boolean>
Boolean that says if the user has permissions or not
|
Retrieves everyone except external users and ensures the user in the current web
Declaration
ISharePointUser EnsureEveryoneExceptExternalUsers()
Returns
Retrieves everyone except external users and ensures the user in the current web
Declaration
Task<ISharePointUser> EnsureEveryoneExceptExternalUsersAsync()
Returns
Ensure a site can support multilingual (pages) for the passed along languages
Declaration
void EnsureMultilingual(List<int> requiredLanguageIds)
Parameters
Ensure a site can support multilingual (pages) for the passed along languages
Declaration
Task EnsureMultilingualAsync(List<int> requiredLanguageIds)
Parameters
Returns
Ensures that page publishing can work for this site. Page scheduling only works for the root web of a site collection
Declaration
void EnsurePageScheduling()
Ensures that page publishing can work for this site. Page scheduling only works for the root web of a site collection
Declaration
Task EnsurePageSchedulingAsync()
Returns
Ensures the given users exists
Declaration
ISharePointUser EnsureUser(string userPrincipalName)
Parameters
System.String
userPrincipalName
UserPrincipalName value of the user to verify
|
Returns
Ensures the given users exists
Declaration
Task<ISharePointUser> EnsureUserAsync(string userPrincipalName)
Parameters
System.String
userPrincipalName
UserPrincipalName value of the user to verify
|
Returns
Ensures the given users exists
Declaration
ISharePointUser EnsureUserBatch(Batch batch, string userPrincipalName)
Parameters
Batch
batch
Batch to add this request to
|
System.String
userPrincipalName
UserPrincipalName value of the user to verify
|
Returns
Ensures the given users exists
Declaration
ISharePointUser EnsureUserBatch(string userPrincipalName)
Parameters
System.String
userPrincipalName
UserPrincipalName value of the user to verify
|
Returns
Ensures the given users exists
Declaration
Task<ISharePointUser> EnsureUserBatchAsync(Batch batch, string userPrincipalName)
Parameters
Batch
batch
Batch to add this request to
|
System.String
userPrincipalName
UserPrincipalName value of the user to verify
|
Returns
Ensures the given users exists
Declaration
Task<ISharePointUser> EnsureUserBatchAsync(string userPrincipalName)
Parameters
System.String
userPrincipalName
UserPrincipalName value of the user to verify
|
Returns
Returns the branding manager which can be used to change the look of the web
Declaration
IBrandingManager GetBrandingManager()
Returns
Get's the current logged on user making the request to SharePoint
Declaration
ISharePointUser GetCurrentUser()
Returns
Get's the current logged on user making the request to SharePoint
Declaration
Task<ISharePointUser> GetCurrentUserAsync()
Returns
Get's the current logged on user making the request to SharePoint
Declaration
ISharePointUser GetCurrentUserBatch()
Returns
Get's the current logged on user making the request to SharePoint
Declaration
ISharePointUser GetCurrentUserBatch(Batch batch)
Parameters
Batch
batch
Batch to add this request to
|
Returns
Get's the current logged on user making the request to SharePoint
Declaration
Task<ISharePointUser> GetCurrentUserBatchAsync()
Returns
Get's the current logged on user making the request to SharePoint
Declaration
Task<ISharePointUser> GetCurrentUserBatchAsync(Batch batch)
Parameters
Batch
batch
Batch to add this request to
|
Returns
Get a file in the current web from its unique id.
Declaration
IFile GetFileById(Guid uniqueFileId, params Expression<Func<IFile, object>>[] expressions)
Parameters
Guid
uniqueFileId
The unique id of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Get a file in the current web from its unique id.
Declaration
Task<IFile> GetFileByIdAsync(Guid uniqueFileId, params Expression<Func<IFile, object>>[] expressions)
Parameters
Guid
uniqueFileId
The unique id of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Task<IFile>
The file to get
|
Get a file in the current web from its unique id via batch.
Declaration
IFile GetFileByIdBatch(Guid uniqueFileId, params Expression<Func<IFile, object>>[] expressions)
Parameters
Guid
uniqueFileId
The unique id of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Get a file in the current web from its unique id via batch.
Declaration
IFile GetFileByIdBatch(Batch batch, Guid uniqueFileId, params Expression<Func<IFile, object>>[] expressions)
Parameters
Batch
batch
Batch to add this request to
|
Guid
uniqueFileId
The unique id of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Get a file in the current web from its unique id via batch.
Declaration
Task<IFile> GetFileByIdBatchAsync(Guid uniqueFileId, params Expression<Func<IFile, object>>[] expressions)
Parameters
Guid
uniqueFileId
The unique id of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Task<IFile>
The file to get
|
Get a file in the current web from its unique id via batch.
Declaration
Task<IFile> GetFileByIdBatchAsync(Batch batch, Guid uniqueFileId, params Expression<Func<IFile, object>>[] expressions)
Parameters
Batch
batch
Batch to add this request to
|
Guid
uniqueFileId
The unique id of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Task<IFile>
The file to get
|
Get's a file from a given link (sharing link, path to file)
Declaration
IFile GetFileByLink(string link, params Expression<Func<IFile, object>>[] expressions)
Parameters
System.String
link
Link pointing to a file
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
IFile
IFile reference when the file could be found, exception otherwise
|
Get's a file from a given link (sharing link, path to file)
Declaration
Task<IFile> GetFileByLinkAsync(string link, params Expression<Func<IFile, object>>[] expressions)
Parameters
System.String
link
Link pointing to a file
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Task<IFile>
IFile reference when the file could be found, exception otherwise
|
Get a file in the current web from its server relative URL.
Declaration
IFile GetFileByServerRelativeUrl(string serverRelativeUrl, params Expression<Func<IFile, object>>[] expressions)
Parameters
System.String
serverRelativeUrl
The server relative URL of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Get a file in the current web from its server relative URL.
Declaration
Task<IFile> GetFileByServerRelativeUrlAsync(string serverRelativeUrl, params Expression<Func<IFile, object>>[] expressions)
Parameters
System.String
serverRelativeUrl
The server relative URL of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Task<IFile>
The file to get
|
Get a file in the current web from its server relative URL via batch.
Declaration
IFile GetFileByServerRelativeUrlBatch(Batch batch, string serverRelativeUrl, params Expression<Func<IFile, object>>[] expressions)
Parameters
Batch
batch
Batch to add this request to
|
System.String
serverRelativeUrl
The server relative URL of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Get a file in the current web from its server relative URL via batch.
Declaration
IFile GetFileByServerRelativeUrlBatch(string serverRelativeUrl, params Expression<Func<IFile, object>>[] expressions)
Parameters
System.String
serverRelativeUrl
The server relative URL of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Get a file in the current web from its server relative URL via batch.
Declaration
Task<IFile> GetFileByServerRelativeUrlBatchAsync(Batch batch, string serverRelativeUrl, params Expression<Func<IFile, object>>[] expressions)
Parameters
Batch
batch
Batch to add this request to
|
System.String
serverRelativeUrl
The server relative URL of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Task<IFile>
The file to get
|
Get a file in the current web from its server relative URL via batch.
Declaration
Task<IFile> GetFileByServerRelativeUrlBatchAsync(string serverRelativeUrl, params Expression<Func<IFile, object>>[] expressions)
Parameters
System.String
serverRelativeUrl
The server relative URL of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Task<IFile>
The file to get
|
Get a file in the current web from its server relative URL, it not available null will be returned
Declaration
IFile GetFileByServerRelativeUrlOrDefault(string serverRelativeUrl, params Expression<Func<IFile, object>>[] expressions)
Parameters
System.String
serverRelativeUrl
The server relative URL of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
IFile
The file to get or null if the file was not available
|
Get a file in the current web from its server relative URL, it not available null will be returned
Declaration
Task<IFile> GetFileByServerRelativeUrlOrDefaultAsync(string serverRelativeUrl, params Expression<Func<IFile, object>>[] expressions)
Parameters
System.String
serverRelativeUrl
The server relative URL of the file to get.
|
Expression<Func<IFile, System.Object>>[]
expressions
Properties to load for the requested IFile
|
Returns
Task<IFile>
The file to get or null if the file was not available
|
Get a folder in the current web from its id.
Declaration
IFolder GetFolderById(Guid folderId, params Expression<Func<IFolder, object>>[] expressions)
Parameters
Guid
folderId
The id of the folder to get.
|
Expression<Func<IFolder, System.Object>>[]
expressions
Expressions needed to create the request
|
Returns
Get a folder in the current web from its id.
Declaration
Task<IFolder> GetFolderByIdAsync(Guid folderId, params Expression<Func<IFolder, object>>[] expressions)
Parameters
Guid
folderId
The id of the folder to get.
|
Expression<Func<IFolder, System.Object>>[]
expressions
Expressions needed to create the request
|
Returns
Get a folder in the current web from its id via batch.
Declaration
IFolder GetFolderByIdBatch(Guid folderId, params Expression<Func<IFolder, object>>[] expressions)
Parameters
Guid
folderId
The id of the folder to get.
|
Expression<Func<IFolder, System.Object>>[]
expressions
Expressions needed to create the request
|
Returns
Get a folder in the current web from its id via batch.
Declaration
IFolder GetFolderByIdBatch(Batch batch, Guid folderId, params Expression<Func<IFolder, object>>[] expressions)
Parameters
Batch
batch
Batch to add this request to
|
Guid
folderId
The id of the folder to get.
|
Expression<Func<IFolder, System.Object>>[]
expressions
Expressions needed to create the request
|
Returns
Get a folder in the current web from its id via batch.
Declaration
Task<IFolder> GetFolderByIdBatchAsync(Guid folderId, params Expression<Func<IFolder, object>>[] expressions)
Parameters
Guid
folderId
The id of the folder to get.
|
Expression<Func<IFolder, System.Object>>[]
expressions
Expressions needed to create the request
|
Returns
Get a folder in the current web from its id via batch.
Declaration
Task<IFolder> GetFolderByIdBatchAsync(Batch batch, Guid folderId, params Expression<Func<IFolder, object>>[] expressions)
Parameters
Batch
batch
Batch to add this request to
|
Guid
folderId
The id of the folder to get.
|
Expression<Func<IFolder, System.Object>>[]
expressions
Expressions needed to create the request
|
Returns
Get a folder in the current web from its server relative URL.
Declaration
IFolder GetFolderByServerRelativeUrl(string serverRelativeUrl, params Expression<Func<IFolder, object>>[] expressions)
Parameters
System.String
serverRelativeUrl
The server relative URL of the folder to get.
|
Expression<Func<IFolder, System.Object>>[]
expressions
Expressions needed to create the request
|
Returns
Get a folder in the current web from its server relative URL.
Declaration
Task<IFolder> GetFolderByServerRelativeUrlAsync(string serverRelativeUrl, params Expression<Func<IFolder, object>>[] expressions)
Parameters
System.String
serverRelativeUrl
The server relative URL of the folder to get.
|
Expression<Func<IFolder, System.Object>>[]
expressions
Expressions needed to create the request
|
Returns
Get a folder in the current web from its server relative URL via batch.
Declaration
IFolder GetFolderByServerRelativeUrlBatch(Batch batch, string serverRelativeUrl, params Expression<Func<IFolder, object>>[] expressions)
Parameters
Batch
batch
Batch to add this request to
|
System.String
serverRelativeUrl
The server relative URL of the folder to get.
|
Expression<Func<IFolder, System.Object>>[]
expressions
Expressions needed to create the request
|
Returns
Get a folder in the current web from its server relative URL via batch.
Declaration
IFolder GetFolderByServerRelativeUrlBatch(string serverRelativeUrl, params Expression<Func<IFolder, object>>[] expressions)
Parameters
System.String
serverRelativeUrl
The server relative URL of the folder to get.
|
Expression<Func<IFolder, System.Object>>[]
expressions
Expressions needed to create the request
|
Returns
Get a folder in the current web from its server relative URL via batch.
Declaration
Task<IFolder> GetFolderByServerRelativeUrlBatchAsync(Batch batch, string serverRelativeUrl, params Expression<Func<IFolder, object>>[] expressions)
Parameters
Batch
batch
Batch to add this request to
|
System.String
serverRelativeUrl
The server relative URL of the folder to get.
|
Expression<Func<IFolder, System.Object>>[]
expressions
Expressions needed to create the request
|
Returns
Get a folder in the current web from its server relative URL via batch.
Declaration
Task<IFolder> GetFolderByServerRelativeUrlBatchAsync(string serverRelativeUrl, params Expression<Func<IFolder, object>>[] expressions)
Parameters
System.String
serverRelativeUrl
The server relative URL of the folder to get.
|
Expression<Func<IFolder, System.Object>>[]
expressions
Expressions needed to create the request
|
Returns
Gets the modern pages of this site, optionally scoped down via a filter
Declaration
List<IPage> GetPages(string pageName = null)
Parameters
System.String
pageName
Page name to filter on, uses a "starts with" filter
|
Returns
PnP.Core.Model.SharePoint.List<IPage>
One of more modern pages
|
Gets the modern pages of this site, optionally scoped down via a filter
Declaration
Task<List<IPage>> GetPagesAsync(string pageName = null)
Parameters
System.String
pageName
Page name to filter on, uses a "starts with" filter
|
Returns
Task<PnP.Core.Model.SharePoint.List<IPage>>
One of more modern pages
|
Searches the recyclebin returning items based upon the passed search criteria
Declaration
IRecycleBinItemCollection GetRecycleBinItemsByQuery(RecycleBinQueryOptions options)
Parameters
Returns
Searches the recyclebin returning items based upon the passed search criteria
Declaration
Task<IRecycleBinItemCollection> GetRecycleBinItemsByQueryAsync(RecycleBinQueryOptions options)
Parameters
Returns
Searches the recyclebin returning items based upon the passed search criteria
Declaration
IRecycleBinItemCollection GetRecycleBinItemsByQueryBatch(RecycleBinQueryOptions options)
Parameters
Returns
Searches the recyclebin returning items based upon the passed search criteria
Declaration
IRecycleBinItemCollection GetRecycleBinItemsByQueryBatch(Batch batch, RecycleBinQueryOptions options)
Parameters
Returns
Searches the recyclebin returning items based upon the passed search criteria
Declaration
Task<IRecycleBinItemCollection> GetRecycleBinItemsByQueryBatchAsync(RecycleBinQueryOptions options)
Parameters
Returns
Searches the recyclebin returning items based upon the passed search criteria
Declaration
Task<IRecycleBinItemCollection> GetRecycleBinItemsByQueryBatchAsync(Batch batch, RecycleBinQueryOptions options)
Parameters
Returns
Gets the managed properties from the search configuration of this web
Declaration
List<IManagedProperty> GetSearchConfigurationManagedProperties()
Returns
Gets the managed properties from the search configuration of this web
Declaration
Task<List<IManagedProperty>> GetSearchConfigurationManagedPropertiesAsync()
Returns
Task<PnP.Core.Model.SharePoint.List<IManagedProperty>>
List of managed properties
|
Gets the search configuration of the web
Declaration
string GetSearchConfigurationXml()
Returns
System.String
Search configuration XML
|
Gets the search configuration of the web
Declaration
Task<string> GetSearchConfigurationXmlAsync()
Returns
Task<System.String>
Search configuration XML
|
Get's a user by it's id in this site. The user needs to exist, use EnsureUser(String) if you want to create the user if it does not yet exist
Declaration
ISharePointUser GetUserById(int userId)
Parameters
System.Int32
userId
Id of the user to get
|
Returns
Get's a user by it's id in this site. The user needs to exist, use EnsureUserAsync(String) if you want to create the user if it does not yet exist
Declaration
Task<ISharePointUser> GetUserByIdAsync(int userId)
Parameters
System.Int32
userId
Id of the user to get
|
Returns
Get's a user by it's id in this site. The user needs to exist, use EnsureUserBatch(String) if you want to create the user if it does not yet exist
Declaration
ISharePointUser GetUserByIdBatch(Batch batch, int userId)
Parameters
Batch
batch
Batch to add this request to
|
System.Int32
userId
Id of the user to get
|
Returns
Get's a user by it's id in this site. The user needs to exist, use EnsureUserBatch(String) if you want to create the user if it does not yet exist
Declaration
ISharePointUser GetUserByIdBatch(int userId)
Parameters
System.Int32
userId
Id of the user to get
|
Returns
Get's a user by it's id in this site. The user needs to exist, use EnsureUserBatchAsync(String) if you want to create the user if it does not yet exist
Declaration
Task<ISharePointUser> GetUserByIdBatchAsync(Batch batch, int userId)
Parameters
Batch
batch
Batch to add this request to
|
System.Int32
userId
Id of the user to get
|
Returns
Get's a user by it's id in this site. The user needs to exist, use EnsureUserBatchAsync(String) if you want to create the user if it does not yet exist
Declaration
Task<ISharePointUser> GetUserByIdBatchAsync(int userId)
Parameters
System.Int32
userId
Id of the user to get
|
Returns
Gets the user effective permissions of a user for a web
Declaration
IBasePermissions GetUserEffectivePermissions(string userPrincipalName)
Parameters
System.String
userPrincipalName
Login name of the user you wish to retrieve the permissions of
|
Returns
IBasePermissions
Base permissions object that contains the High and the Low permissions
|
Gets the user effective permissions of a user for a web
Declaration
Task<IBasePermissions> GetUserEffectivePermissionsAsync(string userPrincipalName)
Parameters
System.String
userPrincipalName
Login name of the user you wish to retrieve the permissions of
|
Returns
Task<IBasePermissions>
Base permissions object that contains the High and the Low permissions
|
Gets Viva Connections dashboard.
If there is no dashboard configured, returns null
Declaration
IVivaDashboard GetVivaDashboard()
Returns
Gets Viva Connections dashboard.
If there is no dashboard configured, returns null
Declaration
Task<IVivaDashboard> GetVivaDashboardAsync()
Returns
Return a specific web template based by a name
Declaration
IWebTemplate GetWebTemplateByName(string name, int lcid = 1033, bool includeCrossLanguage = false)
Parameters
System.String
name
Name of the template to retrieve
|
System.Int32
lcid
Specifies the LCID of the site templates to be retrieved.
|
System.Boolean
includeCrossLanguage
Specifies whether to include language-neutral site templates.
|
Returns
IWebTemplate
The template with the specified name, if available
|
Return a specific web template based by a name
Declaration
Task<IWebTemplate> GetWebTemplateByNameAsync(string name, int lcid = 1033, bool includeCrossLanguage = false)
Parameters
System.String
name
Name of the template to retrieve
|
System.Int32
lcid
Specifies the LCID of the site templates to be retrieved.
|
System.Boolean
includeCrossLanguage
Specifies whether to include language-neutral site templates.
|
Returns
Task<IWebTemplate>
The template with the specified name, if available
|
Return a specific web template based by a name
Declaration
IBatchSingleResult<IWebTemplate> GetWebTemplateByNameBatch(Batch batch, string name, int lcid = 1033, bool includeCrossLanguage = false)
Parameters
Batch
batch
Batch to add this request to
|
System.String
name
Name of the template to retrieve
|
System.Int32
lcid
Specifies the LCID of the site templates to be retrieved.
|
System.Boolean
includeCrossLanguage
Specifies whether to include language-neutral site templates.
|
Returns
Return a specific web template based by a name
Declaration
IBatchSingleResult<IWebTemplate> GetWebTemplateByNameBatch(string name, int lcid = 1033, bool includeCrossLanguage = false)
Parameters
System.String
name
Name of the template to retrieve
|
System.Int32
lcid
Specifies the LCID of the site templates to be retrieved.
|
System.Boolean
includeCrossLanguage
Specifies whether to include language-neutral site templates.
|
Returns
Return a specific web template based by a name
Declaration
Task<IBatchSingleResult<IWebTemplate>> GetWebTemplateByNameBatchAsync(Batch batch, string name, int lcid = 1033, bool includeCrossLanguage = false)
Parameters
Batch
batch
Batch to add this request to
|
System.String
name
Name of the template to retrieve
|
System.Int32
lcid
Specifies the LCID of the site templates to be retrieved.
|
System.Boolean
includeCrossLanguage
Specifies whether to include language-neutral site templates.
|
Returns
Return a specific web template based by a name
Declaration
Task<IBatchSingleResult<IWebTemplate>> GetWebTemplateByNameBatchAsync(string name, int lcid = 1033, bool includeCrossLanguage = false)
Parameters
System.String
name
Name of the template to retrieve
|
System.Int32
lcid
Specifies the LCID of the site templates to be retrieved.
|
System.Boolean
includeCrossLanguage
Specifies whether to include language-neutral site templates.
|
Returns
Returns a collection of site templates available for the site.
Declaration
List<IWebTemplate> GetWebTemplates(int lcid = 1033, bool includeCrossLanguage = false)
Parameters
System.Int32
lcid
Specifies the LCID of the site templates to be retrieved.
|
System.Boolean
includeCrossLanguage
Specifies whether to include language-neutral site templates.
|
Returns
PnP.Core.Model.SharePoint.List<IWebTemplate>
The list of webtemplates available on the current web
|
Returns a collection of site templates available for the site.
Declaration
Task<List<IWebTemplate>> GetWebTemplatesAsync(int lcid = 1033, bool includeCrossLanguage = false)
Parameters
System.Int32
lcid
Specifies the LCID of the site templates to be retrieved.
|
System.Boolean
includeCrossLanguage
Specifies whether to include language-neutral site templates.
|
Returns
Task<PnP.Core.Model.SharePoint.List<IWebTemplate>>
The list of webtemplates available on the current web
|
Returns a collection of site templates available for the site.
Declaration
IEnumerableBatchResult<IWebTemplate> GetWebTemplatesBatch(Batch batch, int lcid = 1033, bool includeCrossLanguage = false)
Parameters
Batch
batch
Batch to add this request to
|
System.Int32
lcid
Specifies the LCID of the site templates to be retrieved.
|
System.Boolean
includeCrossLanguage
Specifies whether to include language-neutral site templates.
|
Returns
Returns a collection of site templates available for the site.
Declaration
IEnumerableBatchResult<IWebTemplate> GetWebTemplatesBatch(int lcid = 1033, bool includeCrossLanguage = false)
Parameters
System.Int32
lcid
Specifies the LCID of the site templates to be retrieved.
|
System.Boolean
includeCrossLanguage
Specifies whether to include language-neutral site templates.
|
Returns
Returns a collection of site templates available for the site.
Declaration
Task<IEnumerableBatchResult<IWebTemplate>> GetWebTemplatesBatchAsync(Batch batch, int lcid = 1033, bool includeCrossLanguage = false)
Parameters
Batch
batch
Batch to add this request to
|
System.Int32
lcid
Specifies the LCID of the site templates to be retrieved.
|
System.Boolean
includeCrossLanguage
Specifies whether to include language-neutral site templates.
|
Returns
Returns a collection of site templates available for the site.
Declaration
Task<IEnumerableBatchResult<IWebTemplate>> GetWebTemplatesBatchAsync(int lcid = 1033, bool includeCrossLanguage = false)
Parameters
System.Int32
lcid
Specifies the LCID of the site templates to be retrieved.
|
System.Boolean
includeCrossLanguage
Specifies whether to include language-neutral site templates.
|
Returns
Returns the Id for a term if present in the TaxonomyHiddenList. Otherwise returns -1;
Declaration
int GetWssIdForTerm(string termId)
Parameters
System.String
termId
Id of the term to lookup
|
Returns
System.Int32
Id of the term in the taxonomy hidden list, otherwise -1
|
Returns the Id for a term if present in the TaxonomyHiddenList. Otherwise returns -1;
Declaration
Task<int> GetWssIdForTermAsync(string termId)
Parameters
System.String
termId
Id of the term to lookup
|
Returns
Task<System.Int32>
Id of the term in the taxonomy hidden list, otherwise -1
|
Does this web have the communication site features enabled?
Declaration
bool HasCommunicationSiteFeatures()
Returns
System.Boolean
True if enabled, false otherwise
|
Does this web have the communication site features enabled?
Declaration
Task<bool> HasCommunicationSiteFeaturesAsync()
Returns
Task<System.Boolean>
True if enabled, false otherwise
|
Checks if this web is configured for NoScript
Declaration
Returns
System.Boolean
True if set to NoScript, false otherwise
|
Checks if this web is configured for NoScript
Declaration
Task<bool> IsNoScriptSiteAsync()
Returns
Task<System.Boolean>
True if set to NoScript, false otherwise
|
Checks if this web is a sub site
Declaration
Returns
System.Boolean
True if the web is a sub site
|
Checks if this web is a sub site
Declaration
Task<bool> IsSubSiteAsync()
Returns
Task<System.Boolean>
True if the web is a sub site
|
Is this web a Syntex Content Center
Declaration
bool IsSyntexContentCenter()
Returns
System.Boolean
True if this web is a Syntex Content Center, false otherwise
|
Is this web a Syntex Content Center
Declaration
Task<bool> IsSyntexContentCenterAsync()
Returns
Task<System.Boolean>
True if this web is a Syntex Content Center, false otherwise
|
Is the tenant enabled for SharePoint Syntex
Declaration
Returns
System.Boolean
True if SharePoint Syntex is enabled, false otherwise
|
Is the tenant enabled for SharePoint Syntex
Declaration
Task<bool> IsSyntexEnabledAsync()
Returns
Task<System.Boolean>
True if SharePoint Syntex is enabled, false otherwise
|
Is SharePoint Syntex enabled for the current user
Declaration
bool IsSyntexEnabledForCurrentUser()
Returns
System.Boolean
True if SharePoint Syntex is enabled for the current user, false otherwise
|
Is SharePoint Syntex enabled for the current user
Declaration
Task<bool> IsSyntexEnabledForCurrentUserAsync()
Returns
Task<System.Boolean>
True if SharePoint Syntex is enabled for the current user, false otherwise
|
Creates a new modern page
Declaration
IPage NewPage(PageLayoutType pageLayoutType = default(PageLayoutType), EditorType editorType = default(EditorType))
Parameters
PageLayoutType
pageLayoutType
Optionally specify the page type, defaults to Article
|
EditorType
editorType
Editor type to be used by the new page, CK4 is the legacy model, CK5 the current
|
Returns
IPage
Created modern page
|
Creates a new modern page
Declaration
Task<IPage> NewPageAsync(PageLayoutType pageLayoutType = default(PageLayoutType), EditorType editorType = default(EditorType))
Parameters
PageLayoutType
pageLayoutType
Optionally specify the page type, defaults to Article
|
EditorType
editorType
Editor type to be used by the new page, CK4 is the legacy model, CK5 the current
|
Returns
Task<IPage>
Created modern page
|
Removes a web propetry from the indexed properties
Declaration
bool RemoveIndexedProperty(string propertyName)
Parameters
System.String
propertyName
The property name
|
Returns
System.Boolean
True if it was successfully removed otherwise false
|
Removes a web propetry from the indexed properties
Declaration
Task<bool> RemoveIndexedPropertyAsync(string propertyName)
Parameters
System.String
propertyName
The property name
|
Returns
Task<System.Boolean>
True if it was successfully removed otherwise false
|
Declaration
ISearchResult Search(SearchOptions query)
Parameters
Returns
Declaration
Task<ISearchResult> SearchAsync(SearchOptions query)
Parameters
Returns
Declaration
IBatchSingleResult<ISearchResult> SearchBatch(SearchOptions query)
Parameters
Returns
Declaration
IBatchSingleResult<ISearchResult> SearchBatch(Batch batch, SearchOptions query)
Parameters
Returns
Declaration
Task<IBatchSingleResult<ISearchResult>> SearchBatchAsync(SearchOptions query)
Parameters
Returns
Declaration
Task<IBatchSingleResult<ISearchResult>> SearchBatchAsync(Batch batch, SearchOptions query)
Parameters
Returns
Applies the access request settings
Declaration
Task SetAccessRequest(AccessRequestOption operation, string email = null)
Parameters
AccessRequestOption
operation
The operation to be performed
|
System.String
email
Applies the email address for the 'SpecificMail' operation
|
Returns
Applies the access request settings
Declaration
Task SetAccessRequestAsync(AccessRequestOption operation, string email = null)
Parameters
AccessRequestOption
operation
The operation to be performed
|
System.String
email
Applies the email address for the 'SpecificMail' operation
|
Returns
Sets the search configuration for the web
Declaration
void SetSearchConfigurationXml(string configuration)
Parameters
Sets the search configuration for the web
Declaration
Task SetSearchConfigurationXmlAsync(string configuration)
Parameters
Returns
Sync the hub site theme from parent hub site
Declaration
Task SyncHubSiteThemeAsync()
Returns
Takes in a sharing or regular SharePoint link and tries to provide relavant information about the resource behind the passed in link
Declaration
IUnfurledResource UnfurlLink(string link, UnfurlOptions unfurlOptions = null)
Parameters
System.String
link
Link to resource to get information for
|
UnfurlOptions
unfurlOptions
Options to control the unfurling data gathering
|
Returns
Takes in a sharing or regular SharePoint link and tries to provide relavant information about the resource behind the passed in link
Declaration
Task<IUnfurledResource> UnfurlLinkAsync(string link, UnfurlOptions unfurlOptions = null)
Parameters
System.String
link
Link to resource to get information for
|
UnfurlOptions
unfurlOptions
Options to control the unfurling data gathering
|
Returns
Checks if the provided list of user UPN's are valid users in Azure AD and returns the 'ensured' SharePoint user
Declaration
IList<ISharePointUser> ValidateAndEnsureUsers(IList<string> userList)
Parameters
PnP.Core.Model.SharePoint.IList<System.String>
userList
List of user UPN's to validate in Azure AD
|
Returns
Checks if the provided list of user UPN's are valid users in Azure AD and returns the 'ensured' SharePoint user
Declaration
Task<IList<ISharePointUser>> ValidateAndEnsureUsersAsync(IList<string> userList)
Parameters
PnP.Core.Model.SharePoint.IList<System.String>
userList
List of user UPN's to validate in Azure AD
|
Returns
Checks if the provided list of user UPN's are valid users in Azure AD
Declaration
IList<string> ValidateUsers(IList<string> userList)
Parameters
PnP.Core.Model.SharePoint.IList<System.String>
userList
List of user UPN's to validate in Azure AD
|
Returns
PnP.Core.Model.SharePoint.IList<System.String>
A list of users that were not found in Azure AD
|
Checks if the provided list of user UPN's are valid users in Azure AD
Declaration
Task<IList<string>> ValidateUsersAsync(IList<string> userList)
Parameters
PnP.Core.Model.SharePoint.IList<System.String>
userList
List of user UPN's to validate in Azure AD
|
Returns
Task<PnP.Core.Model.SharePoint.IList<System.String>>
A list of users that were not found in Azure AD
|
Extension Methods