Permalink
Find file
19734 lines (10975 sloc) 468 KB

OfficeDevPnP.Core

This is automatically generate documentation for the Office 365 Dev PnP Sites Core component.

SharePoint.Client.ClientContextExtensions

Class that holds the deprecated clientcontext methods

Methods

Clone(Microsoft.SharePoint.Client.ClientRuntimeContext,System.String)

Clones a ClientContext object while "taking over" the security context of the existing ClientContext instance

Parameters

clientContext: ClientContext to be cloned

siteUrl: Site url to be used for cloned ClientContext

Return value

A ClientContext object created for the passed site url

ExecuteQueryRetry(Microsoft.SharePoint.Client.ClientRuntimeContext,System.Int32,System.Int32)

Parameters

clientContext:

retryCount: Number of times to retry the request

delay: Milliseconds to wait before retrying the request. The delay will be increased (doubled) every retry

Clone(Microsoft.SharePoint.Client.ClientRuntimeContext,System.Uri)

Clones a ClientContext object while "taking over" the security context of the existing ClientContext instance

Parameters

clientContext: ClientContext to be cloned

siteUrl: Site url to be used for cloned ClientContext

Return value

A ClientContext object created for the passed site url

GetSiteCollectionContext(Microsoft.SharePoint.Client.ClientRuntimeContext)

Gets a site collection context for the passed web. This site collection client context uses the same credentials as the passed client context

Parameters

clientContext: Client context to take the credentials from

Return value

A site collection client context object for the site collection

IsAppOnly(Microsoft.SharePoint.Client.ClientRuntimeContext)

Checks if the used ClientContext is app-only

Parameters

clientContext: The ClientContext to inspect

Return value

True if app-only, false otherwise

Constructor

Constructor

Parameters

message:

HasMinimalServerLibraryVersion(Microsoft.SharePoint.Client.ClientRuntimeContext,System.String)

Checks the server library version of the context for a minimally required version

Parameters

clientContext:

minimallyRequiredVersion:

Return value

SharePoint.Client.ClientContextExtensions.MaximumRetryAttemptedException

Defines a Maximum Retry Attemped Exception

Methods

Constructor

Constructor

Parameters

message:

SharePoint.Client.BrandingExtensions

Class that holds the deprecated branding methods

Class that deals with branding features

Methods

DisableReponsiveUI(Microsoft.SharePoint.Client.Site)

Disables the Responsive UI on a Classic SharePoint Site

Parameters

site: The Site to disable the Responsive UI on

DisableReponsiveUI(Microsoft.SharePoint.Client.Web)

Disables the Responsive UI on a Classic SharePoint Web

Parameters

web: The Web to disable the Responsive UI on

ComposedLookExists(Microsoft.SharePoint.Client.Web,System.String)

Checks if a composed look exists.

Parameters

web: Web to check

composedLookName: Name of the composed look

Return value

true if it exists; otherwise false

CreateComposedLookByName(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.String,System.String,System.Int32,System.Boolean)

Creates (or updates) a composed look in the web site; usually this is done in the root site of the collection.

Parameters

web: Web to create the composed look in

lookName: Name of the theme

paletteFileName: File name of the palette file in the theme catalog of the site collection; path component ignored.

fontFileName: File name of the font file in the theme catalog of the site collection; path component ignored.

backgroundFileName: File name of the background image file in the theme catalog of the site collection; path component ignored.

masterFileName: File name of the master page in the mastepage catalog of the web site; path component ignored.

displayOrder: Display order of the composed look

replaceContent: Replace composed look if it already exists (default true)

CreateComposedLookByUrl(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.String,System.String,System.Int32,System.Boolean)

Creates (or updates) a composed look in the web site; usually this is done in the root site of the collection.

Parameters

web: Web to create the composed look in

lookName: Name of the theme

paletteServerRelativeUrl: URL of the palette file, usually in the theme catalog of the site collection

fontServerRelativeUrl: URL of the font file, usually in the theme catalog of the site collection

backgroundServerRelativeUrl: URL of the background image file, usually in /_layouts/15/images

masterServerRelativeUrl: URL of the master page, usually in the masterpage catalog of the web site

displayOrder: Display order of the composed look

replaceContent: Replace composed look if it already exists (default true)

SetComposedLookByUrl(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.String,System.String,System.Boolean,System.Boolean)

Retrieves the named composed look, overrides with specified palette, font, background and master page, and then recursively sets the specified values.

Parameters

web: Web to apply composed look to

lookName: Name of the composed look to apply; null will apply the override values only

paletteServerRelativeUrl: Override palette file URL to use

fontServerRelativeUrl: Override font file URL to use

backgroundServerRelativeUrl: Override background image file URL to use

masterServerRelativeUrl: Override master page file URL to use

resetSubsitesToInherit: false (default) to apply to currently inheriting subsites only; true to force all subsites to inherit

updateRootOnly: false to apply to subsites; true (default) to only apply to specified site

SetThemeByUrl(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.Boolean,System.Boolean)

Recursively applies the specified palette, font, and background image.

Parameters

web: Web to apply to

paletteServerRelativeUrl: URL of palette file to apply

fontServerRelativeUrl: URL of font file to apply

backgroundServerRelativeUrl: URL of background image to apply

resetSubsitesToInherit: false (default) to apply to currently inheriting subsites only; true to force all subsites to inherit

updateRootOnly: false (default) to apply to subsites; true to only apply to specified site

UploadThemeFile(Microsoft.SharePoint.Client.Web,System.String,System.String)

Uploads the specified file (usually an spcolor or spfont file) to the web site themes gallery (usually only exists in the root web of a site collection).

Parameters

web: Web site to upload to

localFilePath: Location of the file to be uploaded

themeFolderVersion: Leaf folder name to upload to; default is "15"

Return value

The uploaded file, with at least the ServerRelativeUrl property available

UploadThemeFile(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String)

Uploads the specified file (usually an spcolor or spfont file) to the web site themes gallery (usually only exists in the root web of a site collection).

Parameters

web: Web site to upload to

fileName: Name of the file to upload

localFilePath: Location of the file to be uploaded

themeFolderVersion: Leaf folder name to upload to; default is "15"

Return value

The uploaded file, with at least the ServerRelativeUrl property available

UploadThemeFile(Microsoft.SharePoint.Client.Web,System.String,System.IO.Stream,System.String)

Uploads the specified file (usually an spcolor or spfont file) to the web site themes gallery (usually only exists in the root web of a site collection).

Parameters

web: Web site to upload to

fileName: Name of the file to upload

localStream: Stream containing the contents of the file

themeFolderVersion: Leaf folder name to upload to; default is "15"

Return value

The uploaded file, with at least the ServerRelativeUrl property available

DeployPageLayout(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.String,System.String)

Can be used to deploy page layouts to master page gallery. Should be only used with root web of site collection where publishing features are enabled.

Parameters

web: Web as the root site of the publishing site collection

sourceFilePath: Full path to the file which will be uploaded

title: Title for the page layout

description: Description for the page layout

associatedContentTypeID: Associated content type ID

folderHierarchy: Folder hierarchy where the page layouts will be deployed

DeployHtmlPageLayout(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.String,System.String)

Can be used to deploy html page layouts to master page gallery. Should be only used with root web of site collection where publishing features are enabled.

Parameters

web: Web as the root site of the publishing site collection

sourceFilePath: Full path to the file which will be uploaded

title: Title for the page layout

description: Description for the page layout

associatedContentTypeID: Associated content type ID

folderHierarchy: Folder hierarchy where the html page layouts will be deployed

DeployMasterPageGalleryItem(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.String,System.String,System.String)

Private method to support all kinds of file uploads to the master page gallery

Parameters

web: Web as the root site of the publishing site collection

sourceFilePath: Full path to the file which will be uploaded

title: Title for the page layout

description: Description for the page layout

associatedContentTypeID: Associated content type ID

itemContentTypeId: Content type id for the item.

folderHierarchy: Folder hierarchy where the file will be uploaded

DeployMasterPage(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.String,System.String,System.String)

Deploys a new masterpage

Parameters

web: The web to process

sourceFilePath: The path to the source file

title: The title of the masterpage

description: The description of the masterpage

uiVersion:

defaultCSSFile:

folderPath:

SetMasterPagesByName(Microsoft.SharePoint.Client.Web,System.String,System.String)

Can be used to set master page and custom master page in single command

Parameters

web:

masterPageName:

customMasterPageName:

Exceptions

System.ArgumentException: Thrown when masterPageName or customMasterPageName is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when masterPageName or customMasterPageName is null

SetMasterPagesByUrl(Microsoft.SharePoint.Client.Web,System.String,System.String)

Can be used to set master page and custom master page in single command

Parameters

web:

masterPageUrl:

customMasterPageUrl:

Exceptions

System.ArgumentException: Thrown when masterPageName or customMasterPageName is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when masterPageName or customMasterPageName is null

SetMasterPageByName(Microsoft.SharePoint.Client.Web,System.String)

Master page is set by using master page name. Master page is set from the current web.

Parameters

web: Current web

masterPageName: Name of the master page. Path is resolved from this.

Exceptions

System.ArgumentException: Thrown when masterPageName is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when masterPageName is null

SetCustomMasterPageByName(Microsoft.SharePoint.Client.Web,System.String)

Master page is set by using master page name. Master page is set from the current web.

Parameters

web: Current web

masterPageName: Name of the master page. Path is resolved from this.

Exceptions

System.ArgumentException: Thrown when masterPageName is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when masterPageName is null

GetRelativeUrlForMasterByName(Microsoft.SharePoint.Client.Web,System.String)

Returns the relative URL for a masterpage

Parameters

web:

masterPageName: The name of the masterpage, e.g. 'default' or 'seattle'

Return value

GetCurrentComposedLook(Microsoft.SharePoint.Client.Web)

Returns the current theme of a web

Parameters

web: Web to check

Return value

Entity with attributes of current composed look, or null if none

GetComposedLook(Microsoft.SharePoint.Client.Web,System.String)

Returns the named composed look from the web gallery

Parameters

web: Web to check

composedLookName: Name of the composed look to retrieve

Return value

Entity with the attributes of the composed look, or null if the composed look does not exists or cannot be determined

IsMatchingTheme(OfficeDevPnP.Core.Entities.ThemeEntity,System.String,System.String,System.String)

Compares master page URL, theme URL and font URL values to current theme entity to check if they are the same. Handles also possible null values. Point is to figure out which theme is the one that is currently being selected as "Current"

Parameters

theme: Current theme entity to compare values to

masterPageUrl: Master page URL

themeUrl: Theme URL

fontUrl: Font URL

Return value

GetPageLayoutListItemByName(Microsoft.SharePoint.Client.Web,System.String)

Gets a page layout from the master page catalog. Can be called with paramter as "pagelayout.aspx" or as full path like "_catalog/masterpage/pagelayout.aspx"

Parameters

web: root web

pageLayoutName: name of the page layout to retrieve

Return value

ListItem holding the page layout, null if not found

SetMasterPageByUrl(Microsoft.SharePoint.Client.Web,System.String,System.Boolean,System.Boolean)

Set master page by using given URL as parameter. Suitable for example in cases where you want sub sites to reference root site master page gallery. This is typical with publishing sites.

Parameters

web: Context web

masterPageServerRelativeUrl: URL to the master page.

resetSubsitesToInherit: false (default) to apply to currently inheriting subsites only; true to force all subsites to inherit

updateRootOnly: false (default) to apply to subsites; true to only apply to specified site

SetCustomMasterPageByUrl(Microsoft.SharePoint.Client.Web,System.String,System.Boolean,System.Boolean)

Set Custom master page by using given URL as parameter. Suitable for example in cases where you want sub sites to reference root site master page gallery. This is typical with publishing sites.

Parameters

web: Context web

masterPageServerRelativeUrl: URL to the master page.

resetSubsitesToInherit: false (default) to apply to currently inheriting subsites only; true to force all subsites to inherit

updateRootOnly: false (default) to apply to subsites; true to only apply to specified site

SetDefaultPageLayoutForSite(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Web,System.String)

Sets specific page layout the default page layout for the particular site

Parameters

web:

rootWeb:

pageLayoutName:

SetSiteToInheritPageLayouts(Microsoft.SharePoint.Client.Web)

Can be used to set the site to inherit the default page layout option from parent. Cannot be used for root site of the site collection

Parameters

web: Web to operate against

AllowAllPageLayouts(Microsoft.SharePoint.Client.Web)

Allow the web to use all available page layouts

Parameters

web: Web to operate against

SetAvailablePageLayouts(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Web,System.Collections.Generic.IEnumerable{System.String})

Sets the available page layouts

Parameters

web: The web to process

rootWeb: The rootweb

pageLayouts: The page layouts to make available

SetAvailableWebTemplates(Microsoft.SharePoint.Client.Web,System.Collections.Generic.List{OfficeDevPnP.Core.Entities.WebTemplateEntity})

Defines which templates are available for subsite creation

Parameters

web: Web to operate against

availableTemplates: List of objects that define the templates that are allowed

ClearAvailableWebTemplates(Microsoft.SharePoint.Client.Web)

Can be used to remote filters from the available web template

Parameters

web:

SetHomePage(Microsoft.SharePoint.Client.Web,System.String)

Sets the web home page

Parameters

web: The Web to process

rootFolderRelativePath: The path relative to the root folder of the site, e.g. SitePages/Home.aspx

EnableResponsiveUI(Microsoft.SharePoint.Client.Web,System.String)

Enables the responsive UI of a classic SharePoint Web

Parameters

web: The Web to activate the Responsive UI to

infrastructureUrl: URL pointing to an infrastructure site

EnableResponsiveUI(Microsoft.SharePoint.Client.Site,System.String)

Enables the responsive UI of a classic SharePoint Site

Parameters

site: The Site to activate the Responsive UI to

infrastructureUrl: URL pointing to an infrastructure site

EnableResponsiveUIImplementation(Microsoft.SharePoint.Client.ClientObject,System.String)

Enables the responsive UI of a classic SharePoint Web or Site

Parameters

clientObject: The Web or Site to activate the Responsive UI to

infrastructureUrl: URL pointing to an infrastructure site

DisableResponsiveUI(Microsoft.SharePoint.Client.Web)

Disables the Responsive UI on a Classic SharePoint Web

Parameters

web: The Web to disable the Responsive UI on

DisableResponsiveUI(Microsoft.SharePoint.Client.Site)

Disables the Responsive UI on a Classic SharePoint Site

Parameters

site: The Site to disable the Responsive UI on

SharePoint.Client.FeatureExtensions

Class that holds deprecated feature activation and deactivation methods

Class that deals with feature activation and deactivation

Methods

ActivateFeature(Microsoft.SharePoint.Client.Web,System.Guid,System.Boolean,System.Int32)

Activates a site collection or site scoped feature

Parameters

web: Web to be processed - can be root web or sub web

featureID: ID of the feature to activate

sandboxed: Set to true if the feature is defined in a sandboxed solution

pollingIntervalSeconds: The time in seconds between polls for "IsActive"

ActivateFeature(Microsoft.SharePoint.Client.Site,System.Guid,System.Boolean,System.Int32)

Activates a site collection or site scoped feature

Parameters

site: Site to be processed

featureID: ID of the feature to activate

sandboxed: Set to true if the feature is defined in a sandboxed solution

pollingIntervalSeconds: The time in seconds between polls for "IsActive"

DeactivateFeature(Microsoft.SharePoint.Client.Web,System.Guid,System.Int32)

Deactivates a site collection or site scoped feature

Parameters

web: Web to be processed - can be root web or sub web

featureID: ID of the feature to deactivate

pollingIntervalSeconds: The time in seconds between polls for "IsActive"

DeactivateFeature(Microsoft.SharePoint.Client.Site,System.Guid,System.Int32)

Deactivates a site collection or site scoped feature

Parameters

site: Site to be processed

featureID: ID of the feature to deactivate

pollingIntervalSeconds: The time in seconds between polls for "IsActive"

IsFeatureActive(Microsoft.SharePoint.Client.Site,System.Guid)

Checks if a feature is active

Parameters

site: Site to operate against

featureID: ID of the feature to check

Return value

True if active, false otherwise

IsFeatureActive(Microsoft.SharePoint.Client.Web,System.Guid)

Checks if a feature is active

Parameters

web: Web to operate against

featureID: ID of the feature to check

Return value

True if active, false otherwise

IsFeatureActiveInternal(Microsoft.SharePoint.Client.FeatureCollection,System.Guid,System.Boolean)

Checks if a feature is active in the given FeatureCollection.

Parameters

features: FeatureCollection to check in

featureID: ID of the feature to check

noRetry: Use regular ExecuteQuery

Return value

True if active, false otherwise

ProcessFeature(Microsoft.SharePoint.Client.Site,System.Guid,System.Boolean,System.Boolean,System.Int32)

Activates or deactivates a site collection scoped feature

Parameters

site: Site to be processed

featureID: ID of the feature to activate/deactivate

activate: True to activate, false to deactivate the feature

sandboxed: Set to true if the feature is defined in a sandboxed solution

pollingIntervalSeconds: The time in seconds between polls for "IsActive"

ProcessFeature(Microsoft.SharePoint.Client.Web,System.Guid,System.Boolean,System.Boolean,System.Int32)

Activates or deactivates a web scoped feature

Parameters

web: Web to be processed - can be root web or sub web

featureID: ID of the feature to activate/deactivate

activate: True to activate, false to deactivate the feature

sandboxed: True to specify that the feature is defined in a sandboxed solution

pollingIntervalSeconds: The time in seconds between polls for "IsActive"

ProcessFeatureInternal(Microsoft.SharePoint.Client.FeatureCollection,System.Guid,System.Boolean,Microsoft.SharePoint.Client.FeatureDefinitionScope,System.Int32)

Activates or deactivates a site collection or web scoped feature

Parameters

features: Feature Collection which contains the feature

featureID: ID of the feature to activate/deactivate

activate: True to activate, false to deactivate the feature

scope: Scope of the feature definition

pollingIntervalSeconds: The time in seconds between polls for "IsActive"

SharePoint.Client.FieldAndContentTypeExtensions

This class holds deprecated extension methods that will help you work with fields and content types.

This class provides extension methods that will help you work with fields and content types.

Methods

CreateField(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.Entities.FieldCreationInformation,System.Boolean)

Create field to web remotely

Parameters

web: Site to be processed - can be root web or sub site

fieldCreationInformation: Creation Information for the field.

executeQuery: Optionally skip the executeQuery action

Return value

The newly created field or existing field.

CreateField``1(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.Entities.FieldCreationInformation,System.Boolean)

Create field to web remotely

Parameters

web: Site to be processed - can be root web or sub site

fieldCreationInformation: Field creation information

executeQuery: Optionally skip the executeQuery action

Return value

The newly created field or existing field.

CreateField(Microsoft.SharePoint.Client.Web,System.String,System.Boolean)

Create field to web remotely

Parameters

web: Site to be processed - can be root web or sub site

fieldAsXml: The XML declaration of SiteColumn definition

executeQuery:

Return value

The newly created field or existing field.

RemoveFieldByInternalName(Microsoft.SharePoint.Client.Web,System.String)

Removes a field by specifying its internal name

Parameters

web:

internalName:

RemoveFieldById(Microsoft.SharePoint.Client.Web,System.String)

Removes a field by specifying its ID

Parameters

web:

fieldId: The id of the field to remove

CreateFieldsFromXMLFile(Microsoft.SharePoint.Client.Web,System.String)

Creates fields from feature element xml file schema. XML file can contain one or many field definitions created using classic feature framework structure.

Parameters

web: Site to be processed - can be root web or sub site. Site columns should be created to root site.

xmlFilePath: Absolute path to the xml location

CreateFieldsFromXMLString(Microsoft.SharePoint.Client.Web,System.String)

Creates fields from feature element xml file schema. XML file can contain one or many field definitions created using classic feature framework structure.

Parameters

web: Site to be processed - can be root web or sub site. Site columns should be created to root site.

xmlStructure: XML structure in string format

CreateFieldsFromXML(Microsoft.SharePoint.Client.Web,System.Xml.Linq.XDocument)

Creates field from xml structure which follows the classic feature framework structure

Parameters

web: Site to be processed - can be root web or sub site. Site columns should be created to root site.

xDocument: Actual XML document

FieldExistsById(Microsoft.SharePoint.Client.Web,System.Guid,System.Boolean)

Returns if the field is found

Parameters

web: Site to be processed - can be root web or sub site. Site columns should be created to root site.

fieldId: Guid for the field ID

searchInSiteHierarchy: If true, search parent sites and root site

Return value

True or false depending on the field existence

GetFieldById``1(Microsoft.SharePoint.Client.Web,System.Guid,System.Boolean)

Returns the field if it exists. Null if it does not exist.

Parameters

web: Site to be processed - can be root web or sub site. Site columns should be created to root site.

fieldId: Guid for the field ID

searchInSiteHierarchy: If true, search parent sites and root site

Return value

Field of type TField

GetFieldById(Microsoft.SharePoint.Client.Web,System.Guid,System.Boolean)

Returns the field if it exists. Null if it does not exist.

Parameters

web: Site to be processed - can be root web or sub site. Site columns should be created to root site.

fieldId: Guid for the field ID

searchInSiteHierarchy: If true, search parent sites and root site

Return value

Field of type TField

GetFieldById``1(Microsoft.SharePoint.Client.List,System.Guid)

Returns the field if it exists. Null if it does not exist.

Parameters

list: List to be processed. Columns assoc in lists are defined on web or rootweb.

fieldId: Guid for the field ID

Return value

Field of type TField

GetFieldById(Microsoft.SharePoint.Client.List,System.Guid)

Returns the field if it exists. Null if it does not exist.

Parameters

list: List to be processed. Columns assoc in lists are defined on web or rootweb.

fieldId: Guid for the field ID

Return value

Field

GetFieldByName``1(Microsoft.SharePoint.Client.FieldCollection,System.String)

Returns the field if it exists. Null if it does not exist.

Parameters

fields: FieldCollection to be processed.

internalName: Guid for the field ID

Return value

Field of type TField

GetFieldByName(Microsoft.SharePoint.Client.FieldCollection,System.String)

Returns the field if it exists. Null if it does not exist.

Parameters

fields: FieldCollection to be processed.

internalName: Guid for the field ID

Return value

Field

GetFieldByInternalName``1(Microsoft.SharePoint.Client.FieldCollection,System.String)

Returns the field if it exists. Null if it does not exist.

Parameters

fields: FieldCollection to be processed.

internalName: Internal name of the field

Return value

Field of type TField

GetFieldByInternalName(Microsoft.SharePoint.Client.FieldCollection,System.String)

Returns the field if it exists. Null if it does not exist.

Parameters

fields: FieldCollection to be processed.

internalName: Internal name of the field

Return value

Field

FieldExistsByName(Microsoft.SharePoint.Client.Web,System.String,System.Boolean)

Returns if the field is found

Parameters

web: Site to be processed - can be root web or sub site. Site columns should be created to root site.

fieldName: String for the field internal name to be used as query criteria

searchInSiteHierarchy: If true, search parent sites and root site

Return value

True or false depending on the field existence

FieldExistsById(Microsoft.SharePoint.Client.Web,System.String,System.Boolean)

Does field exist in web

Parameters

web: Site to be processed - can be root web or sub site. Site columns should be created to root site.

fieldId: String representation of the field ID (=guid)

searchInSiteHierarchy: If true, search parent sites and root site

Return value

True if exists, false otherwise

FieldExistsByNameInContentType(Microsoft.SharePoint.Client.Web,System.String,System.String)

Field exists in content type

Parameters

web: Site to be processed - can be root web or sub site. Site columns should be created to root site.

contentTypeName: Name of the content type

fieldName: Name of the field

Return value

True if exists, false otherwise

FieldExistsByNameInContentType(Microsoft.SharePoint.Client.ContentType,System.String)

Checks if a field exists in a content type by id

Parameters

contentType: The content type to check

fieldName: The name of the field to look for

Return value

True if field exists in content type, otherwise false

SetJsLinkCustomizations(Microsoft.SharePoint.Client.Field,System.String)

Adds jsLink to a field.

Parameters

field: The field to add jsLink to

jsLink: JSLink to set to the form. Set to empty string to remove the set JSLink customization. Specify multiple values separated by pipe symbol. For e.g.: ~sitecollection/_catalogs/masterpage/jquery-2.1.0.min.js|~sitecollection/_catalogs/masterpage/custom.js

CreateField(Microsoft.SharePoint.Client.List,OfficeDevPnP.Core.Entities.FieldCreationInformation,System.Boolean)

Adds field to a list

Parameters

list: List to process

fieldCreationInformation: Creation information for the field

executeQuery:

Return value

The newly created field or existing field.

CreateField``1(Microsoft.SharePoint.Client.List,OfficeDevPnP.Core.Entities.FieldCreationInformation,System.Boolean)

Adds field to a list

Parameters

list: List to process

fieldCreationInformation: Field creation information

executeQuery: Optionally skip the executeQuery action

Return value

The newly created field or existing field.

CreateFieldBase``1(Microsoft.SharePoint.Client.FieldCollection,OfficeDevPnP.Core.Entities.FieldCreationInformation,System.Boolean)

Base implementation for creating fields

Parameters

fields: Field collection to which the created field will be added

fieldCreationInformation: The information about the field to be created

executeQuery: Optionally skip the executeQuery action

Return value

FormatFieldXml(OfficeDevPnP.Core.Entities.FieldCreationInformation)

Formats a fieldcreationinformation object into Field CAML xml.

Parameters

fieldCreationInformation:

Return value

CreateField(Microsoft.SharePoint.Client.List,System.String,System.Boolean)

Adds a field to a list

Parameters

list: List to process

fieldAsXml: The XML declaration of SiteColumn definition

executeQuery: Optionally skip the executeQuery action

Return value

The newly created field or existing field.

FieldExistsById(Microsoft.SharePoint.Client.List,System.Guid)

Returns if the field is found

Parameters

list: List to process

fieldId: Guid of the field ID

Return value

True if the fields exists, false otherwise

FieldExistsById(Microsoft.SharePoint.Client.List,System.String)

Returns if the field is found, query based on the ID

Parameters

list: List to process

fieldId: String representation of the field ID (=guid)

Return value

True if the fields exists, false otherwise

FieldExistsByName(Microsoft.SharePoint.Client.List,System.String)

Field exists in list by name

Parameters

list: List to process

fieldName: Internal name of the field

Return value

True if the fields exists, false otherwise

GetFields(Microsoft.SharePoint.Client.List,System.String[])

Gets a list of fields from a list by names.

Parameters

list: The target list containing the fields.

fieldInternalNames: List of field names to retreieve.

Return value

List of fields requested.

SetJsLinkCustomizations(Microsoft.SharePoint.Client.List,System.String,System.String)

Adds jsLink to a list field.

Parameters

list: The list where the field exists.

fieldName: The field to add jsLink to.

jsLink: JSLink to set to the form. Set to empty string to remove the set JSLink customization. Specify multiple values separated by pipe symbol. For e.g.: ~sitecollection/_catalogs/masterpage/jquery-2.1.0.min.js|~sitecollection/_catalogs/masterpage/custom.js

ParseAdditionalAttributes(System.String)

Helper method to parse Key="Value" strings into a keyvaluepair

Parameters

xmlAttributes:

Return value

AddContentTypeToListById(Microsoft.SharePoint.Client.Web,System.String,System.String,System.Boolean,System.Boolean)

Adds content type to list

Parameters

web: Site to be processed - can be root web or sub site

listTitle: Title of the list

contentTypeId: Complete ID for the content type

defaultContent: Optionally make this the default content type

searchContentTypeInSiteHierarchy: search for content type in site hierarchy

AddContentTypeToListByName(Microsoft.SharePoint.Client.Web,System.String,System.String,System.Boolean,System.Boolean)

Adds content type to list

Parameters

web: Site to be processed - can be root web or sub site

listTitle: Title of the list

contentTypeName: Name of the content type

defaultContent: Optionally make this the default content type

searchContentTypeInSiteHierarchy: search for content type in site hierarchy

AddContentTypeToList(Microsoft.SharePoint.Client.Web,System.String,Microsoft.SharePoint.Client.ContentType,System.Boolean)

Adds content type to list

Parameters

web: Site to be processed - can be root web or sub site

listTitle: Title of the list

contentType: Content type to be added to the list

defaultContent: If set true, content type is updated to be default content type for the list

AddContentTypeToListById(Microsoft.SharePoint.Client.List,System.String,System.Boolean,System.Boolean)

Add content type to list

Parameters

list: List to add content type to

contentTypeID: Complete ID for the content type

defaultContent: If set true, content type is updated to be default content type for the list

searchContentTypeInSiteHierarchy: search for content type in site hierarchy

AddContentTypeToListByName(Microsoft.SharePoint.Client.List,System.String,System.Boolean,System.Boolean)

Add content type to list

Parameters

list: List to add content type to

contentTypeName: Name of the content type

defaultContent: If set true, content type is updated to be default content type for the list

searchContentTypeInSiteHierarchy: search for content type in site hierarchy

AddContentTypeToList(Microsoft.SharePoint.Client.List,Microsoft.SharePoint.Client.ContentType,System.Boolean)

Add content type to list

Parameters

list: List to add content type to

contentType: Content type to add to the list

defaultContent: If set true, content type is updated to be default content type for the list

AddFieldById(Microsoft.SharePoint.Client.ContentType,System.String,System.Boolean,System.Boolean)

Associates field to content type

Parameters

contentType: Content Type to add the field to

fieldId: String representation of the id of the field (=Guid)

required: True if the field is required

hidden: True if the field is hidden

AddFieldById(Microsoft.SharePoint.Client.ContentType,System.Guid,System.Boolean,System.Boolean)

Associates field to content type

Parameters

contentType: Content Type to add the field to

fieldId: The Id of the field

required: True if the field is required

hidden: True if the field is hidden

AddFieldByName(Microsoft.SharePoint.Client.ContentType,System.String,System.Boolean,System.Boolean)

Associates field to content type

Parameters

contentType: Content Type to add the field to

fieldName: The title or internal name of the field

required: True if the field is required

hidden: True if the field is hidden

AddFieldToContentTypeById(Microsoft.SharePoint.Client.Web,System.String,System.String,System.Boolean,System.Boolean)

Associates field to content type

Parameters

web: Site to be processed - can be root web or sub site

contentTypeID: String representation of the id of the content type to add the field to

fieldId: String representation of the field ID (=guid)

required: True if the field is required

hidden: True if the field is hidden

AddFieldToContentTypeByName(Microsoft.SharePoint.Client.Web,System.String,System.Guid,System.Boolean,System.Boolean)

Associates field to content type

Parameters

web: Site to be processed - can be root web or sub site

contentTypeName: Name of the content type

fieldID: Guid representation of the field ID

required: True if the field is required

hidden: True if the field is hidden

AddFieldToContentType(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.ContentType,Microsoft.SharePoint.Client.Field,System.Boolean,System.Boolean)

Associates field to content type

Parameters

web: Site to be processed - can be root web or sub site

contentType: Content type to associate field to

field: Field to associate to the content type

required: Optionally make this a required field

hidden: Optionally make this a hidden field

BestMatchContentTypeId(Microsoft.SharePoint.Client.List,System.String)

If the search finds multiple matches, the shorter ID is returned. For example, if 0x0101 is the argument, and the collection contains both 0x010109 and 0x01010901, the method returns 0x010109. Searches the list content types and returns the content type identifier (ID) that is the nearest match to the specified content type ID.

Parameters

list: The list to check for content types

baseContentTypeId: A string with the base content type ID to match.

Return value

The value of the Id property for the content type with the closest match to the value of the specified content type ID.

ContentTypeExistsById(Microsoft.SharePoint.Client.Web,System.String,System.Boolean)

Does content type exists in the web

Parameters

web: Web to be processed

contentTypeId: Complete ID for the content type

searchInSiteHierarchy: Searches accross all content types in the site up to the root site

Return value

True if the content type exists, false otherwise

ContentTypeExistsByName(Microsoft.SharePoint.Client.Web,System.String,System.Boolean)

Does content type exists in the web

Parameters

web: Web to be processed

contentTypeName: Name of the content type

searchInSiteHierarchy: Searches accross all content types in the site up to the root site

Return value

True if the content type exists, false otherwise

ContentTypeExistsById(Microsoft.SharePoint.Client.Web,System.String,System.String)

Does content type exist in web

Parameters

web: Web to be processed

listTitle: Title of the list to be updated

contentTypeId: Complete ID for the content type

Return value

True if the content type exists, false otherwise

ContentTypeExistsById(Microsoft.SharePoint.Client.List,System.String)

Does content type exist in list

Parameters

list: List to update

contentTypeId: Complete ID for the content type

Return value

True if the content type exists, false otherwise

ContentTypeExistsByName(Microsoft.SharePoint.Client.Web,System.String,System.String)

Does content type exist in web

Parameters

web: Web to be processed

listTitle: Title of the list to be updated

contentTypeName: Name of the content type

Return value

True if the content type exists, false otherwise

ContentTypeExistsByName(Microsoft.SharePoint.Client.List,System.String)

Does content type exist in list

Parameters

list: List to update

contentTypeName: Name of the content type

Return value

True if the content type exists, false otherwise

CreateContentTypeFromXMLFile(Microsoft.SharePoint.Client.Web,System.String)

Create a content type based on the classic feature framework structure.

Parameters

web: Web to operate against

absolutePathToFile: Absolute path to the xml location

CreateContentTypeFromXMLString(Microsoft.SharePoint.Client.Web,System.String)

Create a content type based on the classic feature framework structure.

Parameters

web: Web to operate against

xmlStructure: XML structure in string format

CreateContentTypeFromXML(Microsoft.SharePoint.Client.Web,System.Xml.Linq.XDocument)

Create a content type based on the classic feature framework structure.

Parameters

web: Web to operate against

xDocument: Actual XML document

CreateContentType(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String)

Create new content type to web

Parameters

web: Site to be processed - can be root web or sub site

name: Name of the content type

id: Complete ID for the content type

group: Group for the content type

Return value

CreateContentType(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.String,Microsoft.SharePoint.Client.ContentType)

Create new content type to web

Parameters

web: Site to be processed - can be root web or sub site

name: Name of the content type

description: Description for the content type

id: Complete ID for the content type

group: Group for the content type

parentContentType: Parent Content Type

Return value

The created content type

DeleteContentTypeByName(Microsoft.SharePoint.Client.Web,System.String)

Deletes a content type from the web by name

Parameters

web: Web to delete the content type from

contentTypeName: Name of the content type to delete

DeleteContentTypeById(Microsoft.SharePoint.Client.Web,System.String)

Deletes a content type from the web by id

Parameters

web: Web to delete the content type from

contentTypeId: Id of the content type to delete

GetContentTypeByName(Microsoft.SharePoint.Client.Web,System.String,System.Boolean)

Return content type by name

Parameters

web: Web to be processed

contentTypeName: Name of the content type

searchInSiteHierarchy: Searches accross all content types in the site up to the root site

Return value

Content type object or null if was not found

GetContentTypeById(Microsoft.SharePoint.Client.Web,System.String,System.Boolean)

Return content type by Id

Parameters

web: Web to be processed

contentTypeId: Complete ID for the content type

searchInSiteHierarchy: Searches accross all content types in the site up to the root site

Return value

Content type object or null if was not found

GetContentTypeByName(Microsoft.SharePoint.Client.List,System.String)

Return content type by name

Parameters

list: List to update

contentTypeName: Name of the content type

Return value

Content type object or null if was not found

GetContentTypeById(Microsoft.SharePoint.Client.List,System.String)

Return content type by Id

Parameters

list: List to update

contentTypeId: Complete ID for the content type

Return value

Content type object or null if was not found

BestMatch(Microsoft.SharePoint.Client.ContentTypeCollection,System.String)

Searches for the content type with the closest match to the value of the specified content type ID. If the search finds two matches, the shorter ID is returned.

Parameters

contentTypes: Content type collection to search

contentTypeId: Complete ID for the content type to search

Return value

Content type Id object or null if was not found

RemoveContentTypeFromListByName(Microsoft.SharePoint.Client.Web,System.String,System.String)

Removes content type from list

Parameters

web: Site to be processed - can be root web or sub site

listTitle: Title of the list

contentTypeName: The name of the content type

RemoveContentTypeFromListByName(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.List,System.String)

Removes content type from list

Parameters

web: Site to be processed - can be root web or sub site

list: The List

contentTypeName: The name of the content type

RemoveContentTypeFromListById(Microsoft.SharePoint.Client.Web,System.String,System.String)

Removes content type from a list

Parameters

web: Site to be processed - can be root web or sub site

listTitle: Title of the list

contentTypeId: Complete ID for the content type

RemoveContentTypeFromListById(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.List,System.String)

Removes content type from a list

Parameters

web: Site to be processed - can be root web or sub site

list: The List

contentTypeId: Complete ID for the content type

RemoveContentTypeFromList(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.List,Microsoft.SharePoint.Client.ContentType)

Removes content type from a list

Parameters

web: Site to be processed - can be root web or sub site

list: The List

contentType: The Content Type

SetDefaultContentTypeToList(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.List,System.String)

Set default content type to list

Parameters

web: Site to be processed - can be root web or sub site

list: List to update

contentTypeId: Complete ID for the content type

SetDefaultContentTypeToList(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.List,Microsoft.SharePoint.Client.ContentType)

Set default content type to list

Parameters

web: Site to be processed - can be root web or sub site

list: List to update

contentType: Content type to make default

SetDefaultContentTypeToList(Microsoft.SharePoint.Client.Web,System.String,System.String)

Set default content type to list

Parameters

web: Site to be processed - can be root web or sub site

listTitle: Title of the list to be updated

contentTypeId: Complete ID for the content type

SetDefaultContentTypeToList(Microsoft.SharePoint.Client.Web,System.String,Microsoft.SharePoint.Client.ContentType)

Notice. Currently removes other content types from the list. Known issue Set's default content type list.

Parameters

web: Site to be processed - can be root web or sub site

listTitle: Title of the list to be updated

contentType: Content type to make default

SetDefaultContentTypeToList(Microsoft.SharePoint.Client.List,System.String)

Notice. Currently removes other content types from the list. Known issue Set's default content type list.

Parameters

list: List to update

contentTypeId: Complete ID for the content type

SetDefaultContentTypeToList(Microsoft.SharePoint.Client.List,Microsoft.SharePoint.Client.ContentType)

Set default content type to list

Parameters

list: List to update

contentType: Content type to make default

ReorderContentTypes(Microsoft.SharePoint.Client.List,System.Collections.Generic.IEnumerable{System.String})

Reorders content types on the list. The first one in the list is the default item. Any items left out from the list will still be on the content type, but will not be visible on the new button.

Parameters

list: Target list containing the content types

contentTypeNamesOrIds: Content type names or ids to sort.

SetLocalizationForContentType(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.String)

Set localized labels for content type

Parameters

web: Web to operate on

contentTypeName: Name of the content type

cultureName: Culture for the localization (en-es, nl-be, fi-fi,...)

nameResource: Localized value for the Name property

descriptionResource: Localized value for the Description property

SetLocalizationForContentType(Microsoft.SharePoint.Client.List,System.String,System.String,System.String,System.String)

Set localized labels for content type

Parameters

list: List to update

contentTypeId: Complete ID for the content type

cultureName: Culture for the localization (en-es, nl-be, fi-fi,...)

nameResource: Localized value for the Name property

descriptionResource: Localized value for the Description property

SetLocalizationForContentType(Microsoft.SharePoint.Client.ContentType,System.String,System.String,System.String)

Set localized labels for content type

Parameters

contentType: Name of the content type

cultureName: Culture for the localization (en-es, nl-be, fi-fi,...)

nameResource: Localized value for the Name property

descriptionResource: Localized value for the Description property

SetLocalizationForField(Microsoft.SharePoint.Client.Web,System.Guid,System.String,System.String,System.String)

Set localized labels for field

Parameters

web: Web to operate on

siteColumnId: Guid with the site column ID

cultureName: Culture for the localization (en-es, nl-be, fi-fi,...)

titleResource: Localized value for the Title property

descriptionResource: Localized value for the Description property

SetLocalizationForField(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.String)

Set localized labels for field

Parameters

web: Web to operate on

siteColumnName: Name of the site column

cultureName: Culture for the localization (en-es, nl-be, fi-fi,...)

titleResource: Localized value for the Title property

descriptionResource: Localized value for the Description property

SetLocalizationForField(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Field,System.String,System.String,System.String)

Set localized labels for field

Parameters

web: Web to operate on

siteColumn: Site column to localize

cultureName: Culture for the localization (en-es, nl-be, fi-fi,...)

titleResource: Localized value for the Title property

descriptionResource: Localized value for the Description property

SetLocalizationForField(Microsoft.SharePoint.Client.List,System.Guid,System.String,System.String,System.String)

Set localized labels for field

Parameters

list: List to update

siteColumnId: Guid of the site column ID

cultureName: Culture for the localization (en-es, nl-be, fi-fi,...)

titleResource: Localized value for the Title property

descriptionResource: Localized value for the Description property

SetLocalizationForField(Microsoft.SharePoint.Client.List,System.String,System.String,System.String,System.String)

Set localized labels for field

Parameters

list: List to update

siteColumnName: Name of the site column

cultureName: Culture for the localization (en-es, nl-be, fi-fi,...)

titleResource: Localized value for the Title property

descriptionResource: Localized value for the Description property

SetLocalizationForField(Microsoft.SharePoint.Client.List,Microsoft.SharePoint.Client.Field,System.String,System.String,System.String)

Set localized labels for field

Parameters

list: List to update

siteColumn: Site column to update

cultureName: Culture for the localization (en-es, nl-be, fi-fi,...)

titleResource: Localized value for the Title property

descriptionResource: Localized value for the Description property

SetLocalizationForField(Microsoft.SharePoint.Client.Field,System.String,System.String,System.String)

Set localized labels for field

Parameters

field: Field to update

cultureName: Culture for the localization (en-es, nl-be, fi-fi,...)

titleResource: Localized value for the Title property

descriptionResource: Localized value for the Description property

SharePoint.Client.FileFolderExtensions

Class that holds the deprecated file and folder methods

Methods

ApproveFile(Microsoft.SharePoint.Client.Web,System.String,System.String)

Approves a file

Parameters

web: The web to process

serverRelativeUrl: The server relative url of the file to approve

comment: Message to be recorded with the approval

CheckInFile(Microsoft.SharePoint.Client.Web,System.String,Microsoft.SharePoint.Client.CheckinType,System.String)

Checks in a file

Parameters

web: The web to process

serverRelativeUrl: The server relative url of the file to checkin

checkinType: The type of the checkin

comment: Message to be recorded with the approval

CheckOutFile(Microsoft.SharePoint.Client.Web,System.String)

Checks out a file

Parameters

web: The web to process

serverRelativeUrl: The server relative url of the file to checkout

CreateDocumentSet(Microsoft.SharePoint.Client.Folder,System.String,Microsoft.SharePoint.Client.ContentTypeId)

var setContentType = list.BestMatchContentTypeId(BuiltInContentTypeId.DocumentSet); var set1 = list.RootFolder.CreateDocumentSet("Set 1", setContentType); Creates a new document set as a child of an existing folder, with the specified content type ID.

Parameters

folder:

documentSetName:

contentTypeId: Content type of the document set

Return value

The created Folder representing the document set, so that additional operations (such as setting properties) can be done.

ConvertFolderToDocumentSet(Microsoft.SharePoint.Client.List,System.String)

Note that this only checks one level of folder (the Folders collection) and cannot accept a name with path characters. Converts a folder with the given name as a child of the List RootFolder.

Parameters

list: List in which the folder exists

folderName: Folder name to convert

Return value

The newly converted Document Set, so that additional operations (such as setting properties) can be done.

ConvertFolderToDocumentSet(Microsoft.SharePoint.Client.List,Microsoft.SharePoint.Client.Folder)

Note that this only checks one level of folder (the Folders collection) and cannot accept a name with path characters. Converts a folder with the given name as a child of the List RootFolder.

Parameters

list: List in which the folder exists

folder: Folder to convert

Return value

The newly converted Document Set, so that additional operations (such as setting properties) can be done.

ConvertFolderToDocumentSetImplementation(Microsoft.SharePoint.Client.List,Microsoft.SharePoint.Client.Folder)

Internal implementation of the Folder conversion to Document set

Parameters

list: Library in which the folder exists

folder: Folder to convert

Return value

The newly converted Document Set, so that additional operations (such as setting properties) can be done.

CreateFolder(Microsoft.SharePoint.Client.Web,System.String)

Note that this only checks one level of folder (the Folders collection) and cannot accept a name with path characters. Creates a folder with the given name as a child of the Web. Note it is more common to create folders within an existing Folder, such as the RootFolder of a List.

Parameters

web: Web to check for the named folder

folderName: Folder name to retrieve or create

Return value

The newly created Folder, so that additional operations (such as setting properties) can be done.

CreateFolder(Microsoft.SharePoint.Client.Folder,System.String)

Note that this only checks one level of folder (the Folders collection) and cannot accept a name with path characters. var folder = list.RootFolder.CreateFolder("new-folder"); Creates a folder with the given name.

Parameters

parentFolder: Parent folder to create under

folderName: Folder name to retrieve or create

Return value

The newly created folder

DoesFolderExists(Microsoft.SharePoint.Client.Web,System.String)

Checks if a specific folder exists

Parameters

web: The web to process

serverRelativeFolderUrl: Folder to check

Return value

EnsureFolder(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Folder,System.String)

Ensure that the folder structure is created. This also ensures hierarchy of folders.

Parameters

web: Web to be processed - can be root web or sub site

parentFolder: Parent folder

folderPath: Folder path

Return value

The folder structure

EnsureFolder(Microsoft.SharePoint.Client.Web,System.String)

Note that this only checks one level of folder (the Folders collection) and cannot accept a name with path characters. Checks if the folder exists at the top level of the web site, and if it does not exist creates it. Note it is more common to create folders within an existing Folder, such as the RootFolder of a List.

Parameters

web: Web to check for the named folder

folderName: Folder name to retrieve or create

Return value

The existing or newly created folder

EnsureFolder(Microsoft.SharePoint.Client.Folder,System.String)

Note that this only checks one level of folder (the Folders collection) and cannot accept a name with path characters. Checks if the subfolder exists, and if it does not exist creates it.

Parameters

parentFolder: Parent folder to create under

folderName: Folder name to retrieve or create

Return value

The existing or newly created folder

EnsureFolderPath(Microsoft.SharePoint.Client.Web,System.String)

If the specified path is inside an existing list, then the folder is created inside that list. Any existing folders are traversed, and then any remaining parts of the path are created as new folders. Check if a folder exists with the specified path (relative to the web), and if not creates it (inside a list if necessary)

Parameters

web: Web to check for the specified folder

webRelativeUrl: Path to the folder, relative to the web site

Return value

The existing or newly created folder

FindFiles(Microsoft.SharePoint.Client.Web,System.String)

Finds files in the web. Can be slow.

Parameters

web: The web to process

match: a wildcard pattern to match

Return value

A list with the found objects

FindFiles(Microsoft.SharePoint.Client.List,System.String)

Find files in the list, Can be slow.

Parameters

list: The list to process

match: a wildcard pattern to match

Return value

A list with the found objects

FindFiles(Microsoft.SharePoint.Client.Folder,System.String)

Find files in a specific folder

Parameters

folder: The folder to process

match: a wildcard pattern to match

Return value

A list with the found objects

FolderExists(Microsoft.SharePoint.Client.Web,System.String)

Note that this only checks one level of folder (the Folders collection) and cannot accept a name with path characters. Checks if the folder exists at the top level of the web site.

Parameters

web: Web to check for the named folder

folderName: Folder name to retrieve

Return value

true if the folder exists; false otherwise

FolderExists(Microsoft.SharePoint.Client.Folder,System.String)

Note that this only checks one level of folder (the Folders collection) and cannot accept a name with path characters. Checks if the subfolder exists.

Parameters

parentFolder: Parent folder to check for the named subfolder

folderName: Folder name to retrieve

Return value

true if the folder exists; false otherwise

GetFileAsString(Microsoft.SharePoint.Client.Web,System.String)

Returns a file as string

Parameters

web: The Web to process

serverRelativeUrl: The server relative url to the file

Return value

The file contents as a string

PublishFile(Microsoft.SharePoint.Client.Web,System.String,System.String)

Publishes a file existing on a server url

Parameters

web: The web to process

serverRelativeUrl: the server relative url of the file to publish

comment: Comment recorded with the publish action

ResolveSubFolder(Microsoft.SharePoint.Client.Folder,System.String)

Gets a folder with a given name in a given

Parameters

folder: in which to search for

folderName: Name of the folder to search for

Return value

The found if available, null otherwise

SaveFileToLocal(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.Func{System.String,System.Boolean})

Saves a remote file to a local folder

Parameters

web: The Web to process

serverRelativeUrl: The server relative url to the file

localPath: The local folder

localFileName: The local filename. If null the filename of the file on the server will be used

fileExistsCallBack: Optional callback function allowing to provide feedback if the file should be overwritten if it exists. The function requests a bool as return value and the string input contains the name of the file that exists.

UploadFile(Microsoft.SharePoint.Client.Folder,System.String,System.String,System.Boolean)

Uploads a file to the specified folder.

Parameters

folder: Folder to upload file to.

fileName:

localFilePath: Location of the file to be uploaded.

overwriteIfExists: true (default) to overwite existing files

Return value

The uploaded File, so that additional operations (such as setting properties) can be done.

UploadFile(Microsoft.SharePoint.Client.Folder,System.String,System.IO.Stream,System.Boolean)

Uploads a file to the specified folder.

Parameters

folder: Folder to upload file to.

fileName: Location of the file to be uploaded.

stream:

overwriteIfExists: true (default) to overwite existing files

Return value

The uploaded File, so that additional operations (such as setting properties) can be done.

UploadFileWebDav(Microsoft.SharePoint.Client.Folder,System.String,System.String,System.Boolean)

Uploads a file to the specified folder by saving the binary directly (via webdav).

Parameters

folder: Folder to upload file to.

fileName:

localFilePath: Location of the file to be uploaded.

overwriteIfExists: true (default) to overwite existing files

Return value

The uploaded File, so that additional operations (such as setting properties) can be done.

UploadFileWebDav(Microsoft.SharePoint.Client.Folder,System.String,System.IO.Stream,System.Boolean)

Uploads a file to the specified folder by saving the binary directly (via webdav). Note: this method does not work using app only token.

Parameters

folder: Folder to upload file to.

fileName: Location of the file to be uploaded.

stream:

overwriteIfExists: true (default) to overwite existing files

Return value

The uploaded File, so that additional operations (such as setting properties) can be done.

GetFile(Microsoft.SharePoint.Client.Folder,System.String)

Gets a file in a document library.

Parameters

folder: Folder containing the target file.

fileName: File name.

Return value

The target file if found, null if no file is found.

VerifyIfUploadRequired(Microsoft.SharePoint.Client.File,System.String)

Used to compare the server file to the local file. This enables users with faster download speeds but slow upload speeds to evaluate if the server file should be overwritten.

Parameters

serverFile: File located on the server.

localFile: File to validate against.

VerifyIfUploadRequired(Microsoft.SharePoint.Client.File,System.IO.Stream)

Used to compare the server file to the local file. This enables users with faster download speeds but slow upload speeds to evaluate if the server file should be overwritten.

Parameters

serverFile: File located on the server.

localStream: Stream to validate against.

Return value

SetFileProperties(Microsoft.SharePoint.Client.File,System.Collections.Generic.IDictionary{System.String,System.String},System.Boolean)

Sets file properties using a dictionary.

Parameters

file: Target file object.

properties: Dictionary of properties to set.

checkoutIfRequired: Check out the file if necessary to set properties.

PublishFileToLevel(Microsoft.SharePoint.Client.File,Microsoft.SharePoint.Client.FileLevel)

Publishes a file based on the type of versioning required on the parent library.

Parameters

file: Target file to publish.

level: Target publish direction (Draft and Published only apply, Checkout is ignored).

SharePoint.Client.InformationManagementExtensions

Class that holds deprecated information management extension methods

Class that deals with information management features

Methods

HasSitePolicyApplied(Microsoft.SharePoint.Client.Web)

Does this web have a site policy applied?

Parameters

web: Web to operate on

Return value

True if a policy has been applied, false otherwise

GetSiteExpirationDate(Microsoft.SharePoint.Client.Web)

Gets the site expiration date

Parameters

web: Web to operate on

Return value

DateTime value holding the expiration date, DateTime.MinValue in case there was no policy applied

GetSiteCloseDate(Microsoft.SharePoint.Client.Web)

Gets the site closure date

Parameters

web: Web to operate on

Return value

DateTime value holding the closure date, DateTime.MinValue in case there was no policy applied

GetSitePolicies(Microsoft.SharePoint.Client.Web)

Gets a list of the available site policies

Parameters

web: Web to operate on

Return value

A list of objects

GetAppliedSitePolicy(Microsoft.SharePoint.Client.Web)

Gets the site policy that currently is applied

Parameters

web: Web to operate on

Return value

A object holding the applied policy

GetSitePolicyByName(Microsoft.SharePoint.Client.Web,System.String)

Gets the site policy with the given name

Parameters

web: Web to operate on

sitePolicy: Site policy to fetch

Return value

A object holding the fetched policy

ApplySitePolicy(Microsoft.SharePoint.Client.Web,System.String)

Apply a policy to a site

Parameters

web: Web to operate on

sitePolicy: Policy to apply

Return value

True if applied, false otherwise

SharePoint.Client.JavaScriptExtensions

Deprecated JavaScript related methods

JavaScript related methods

Fields

SCRIPT_LOCATION

Default Script Location value

Methods

AddJsLink(Microsoft.SharePoint.Client.Web,System.String,System.String,System.Int32)

Injects links to javascript files via a adding a custom action to the site

Parameters

web: Site to be processed - can be root web or sub site

key: Identifier (key) for the custom action that will be created

scriptLinks: semi colon delimited list of links to javascript files

sequence:

Return value

True if action was ok

AddJsLink(Microsoft.SharePoint.Client.Site,System.String,System.String,System.Int32)

Injects links to javascript files via a adding a custom action to the site

Parameters

site: Site to be processed

key: Identifier (key) for the custom action that will be created

scriptLinks: semi colon delimited list of links to javascript files

sequence:

Return value

True if action was ok

AddJsLink(Microsoft.SharePoint.Client.Web,System.String,System.Collections.Generic.IEnumerable{System.String},System.Int32)

Injects links to javascript files via a adding a custom action to the site

Parameters

web: Site to be processed - can be root web or sub site

key: Identifier (key) for the custom action that will be created

scriptLinks: IEnumerable list of links to javascript files

sequence:

Return value

True if action was ok

AddJsLink(Microsoft.SharePoint.Client.Site,System.String,System.Collections.Generic.IEnumerable{System.String},System.Int32)

Injects links to javascript files via a adding a custom action to the site

Parameters

site: Site to be processed

key: Identifier (key) for the custom action that will be created

scriptLinks: IEnumerable list of links to javascript files

sequence:

Return value

True if action was ok

DeleteJsLink(Microsoft.SharePoint.Client.Web,System.String)

Removes the custom action that triggers the execution of a javascript link

Parameters

web: Site to be processed - can be root web or sub site

key: Identifier (key) for the custom action that will be deleted

Return value

True if action was ok

DeleteJsLink(Microsoft.SharePoint.Client.Site,System.String)

Removes the custom action that triggers the execution of a javascript link

Parameters

site: Site to be processed

key: Identifier (key) for the custom action that will be deleted

Return value

True if action was ok

AddJsBlock(Microsoft.SharePoint.Client.Web,System.String,System.String,System.Int32)

Injects javascript via a adding a custom action to the site

Parameters

web: Site to be processed - can be root web or sub site

key: Identifier (key) for the custom action that will be created

scriptBlock: Javascript to be injected

sequence:

Return value

True if action was ok

AddJsBlock(Microsoft.SharePoint.Client.Site,System.String,System.String,System.Int32)

Injects javascript via a adding a custom action to the site

Parameters

site: Site to be processed

key: Identifier (key) for the custom action that will be created

scriptBlock: Javascript to be injected

sequence:

Return value

True if action was ok

ExistsJsLink(Microsoft.SharePoint.Client.Web,System.String)

Checks if the target web already has a custom JsLink with a specified key

Parameters

web: Web to be processed

key: Identifier (key) for the custom action that will be created

Return value

ExistsJsLink(Microsoft.SharePoint.Client.Site,System.String)

Checks if the target site already has a custom JsLink with a specified key

Parameters

site: Site to be processed

key: Identifier (key) for the custom action that will be created

Return value

SharePoint.Client.ListExtensions

Class that holds deprecated generic list creation and manipulation methods

Class that provides generic list creation and manipulation methods

Fields

UrlDelimiters

The common URL delimiters

Methods

AddRemoteEventReceiver(Microsoft.SharePoint.Client.List,System.String,System.String,Microsoft.SharePoint.Client.EventReceiverType,Microsoft.SharePoint.Client.EventReceiverSynchronization,System.Boolean)

Registers a remote event receiver

Parameters

list: The list to process

name: The name of the event receiver (needs to be unique among the event receivers registered on this list)

url: The URL of the remote WCF service that handles the event

eventReceiverType:

synchronization:

force: If True any event already registered with the same name will be removed first.

Return value

Returns an EventReceiverDefinition if succeeded. Returns null if failed.

AddRemoteEventReceiver(Microsoft.SharePoint.Client.List,System.String,System.String,Microsoft.SharePoint.Client.EventReceiverType,Microsoft.SharePoint.Client.EventReceiverSynchronization,System.Int32,System.Boolean)

Registers a remote event receiver

Parameters

list: The list to process

name: The name of the event receiver (needs to be unique among the event receivers registered on this list)

url: The URL of the remote WCF service that handles the event

eventReceiverType:

synchronization:

sequenceNumber:

force: If True any event already registered with the same name will be removed first.

Return value

Returns an EventReceiverDefinition if succeeded. Returns null if failed.

GetEventReceiverById(Microsoft.SharePoint.Client.List,System.Guid)

Returns an event receiver definition

Parameters

list:

id:

Return value

GetEventReceiverByName(Microsoft.SharePoint.Client.List,System.String)

Returns an event receiver definition

Parameters

list: The list to process

name:

Return value

SetPropertyBagValue(Microsoft.SharePoint.Client.List,System.String,System.Int32)

Sets a key/value pair in the web property bag

Parameters

list: The list to process

key: Key for the property bag entry

value: Integer value for the property bag entry

SetPropertyBagValue(Microsoft.SharePoint.Client.List,System.String,System.String)

Sets a key/value pair in the list property bag

Parameters

list: List that will hold the property bag entry

key: Key for the property bag entry

value: String value for the property bag entry

SetPropertyBagValueInternal(Microsoft.SharePoint.Client.List,System.String,System.Object)

Sets a key/value pair in the list property bag

Parameters

list: List that will hold the property bag entry

key: Key for the property bag entry

value: Value for the property bag entry

GetPropertyBagValueInt(Microsoft.SharePoint.Client.List,System.String,System.Int32)

Get int typed property bag value. If does not contain, returns default value.

Parameters

list: List to read the property bag value from

key: Key of the property bag entry to return

defaultValue:

Return value

Value of the property bag entry as integer

GetPropertyBagValueString(Microsoft.SharePoint.Client.List,System.String,System.String)

Get string typed property bag value. If does not contain, returns given default value.

Parameters

list: List to read the property bag value from

key: Key of the property bag entry to return

defaultValue:

Return value

Value of the property bag entry as string

GetPropertyBagValueInternal(Microsoft.SharePoint.Client.List,System.String)

Type independent implementation of the property gettter.

Parameters

list: List to read the property bag value from

key: Key of the property bag entry to return

Return value

Value of the property bag entry

PropertyBagContainsKey(Microsoft.SharePoint.Client.List,System.String)

Checks if the given property bag entry exists

Parameters

list: List to be processed

key: Key of the property bag entry to check

Return value

True if the entry exists, false otherwise

RemoveContentTypeByName(Microsoft.SharePoint.Client.List,System.String)

Removes a content type from a list/library by name

Parameters

list: The list

contentTypeName: The content type name to remove from the list

Exceptions

System.ArgumentException: Thrown when contentTypeName is a zero-length string or contains only white space

System.ArgumentNullException: contentTypeName is null

CreateDocumentLibrary(Microsoft.SharePoint.Client.Web,System.String,System.Boolean,System.String)

Adds a document library to a web. Execute Query is called during this implementation

Parameters

web: Site to be processed - can be root web or sub site

listName: Name of the library

enableVersioning: Enable versioning on the list

urlPath:

Exceptions

System.ArgumentException: Thrown when listName is a zero-length string or contains only white space

System.ArgumentNullException: listName is null

ListExists(Microsoft.SharePoint.Client.Web,System.String)

Checks if list exists on the particular site based on the list Title property.

Parameters

web: Site to be processed - can be root web or sub site

listTitle: Title of the list to be checked.

Return value

True if the list exists

Exceptions

System.ArgumentException: Thrown when listTitle is a zero-length string or contains only white space

System.ArgumentNullException: listTitle is null

ListExists(Microsoft.SharePoint.Client.Web,System.Uri)

Checks if list exists on the particular site based on the list's site relative path.

Parameters

web: Site to be processed - can be root web or sub site

siteRelativeUrlPath: Site relative path of the list

Return value

True if the list exists

ListExists(Microsoft.SharePoint.Client.Web,System.Guid)

Checks if list exists on the particular site based on the list id property.

Parameters

web: Site to be processed - can be root web or sub site

id: The id of the list to be checked.

Return value

True if the list exists

Exceptions

System.ArgumentException: Thrown when listTitle is a zero-length string or contains only white space

System.ArgumentNullException: listTitle is null

CreateList(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.ListTemplateType,System.String,System.Boolean,System.Boolean,System.String,System.Boolean)

Adds a default list to a site

Parameters

web: Site to be processed - can be root web or sub site

listType: Built in list template type

listName: Name of the list

enableVersioning: Enable versioning on the list

updateAndExecuteQuery: (Optional) Perform list update and executequery, defaults to true

urlPath: (Optional) URL to use for the list

enableContentTypes: (Optional) Enable content type management

Return value

The newly created list

CreateList(Microsoft.SharePoint.Client.Web,System.Guid,System.Int32,System.String,System.Boolean,System.Boolean,System.String,System.Boolean)

Adds a custom list to a site

Parameters

web: Site to be processed - can be root web or sub site

featureId: Feature that contains the list template

listType: Type ID of the list, within the feature

listName: Name of the list

enableVersioning: Enable versioning on the list

updateAndExecuteQuery: (Optional) Perform list update and executequery, defaults to true

urlPath: (Optional) URL to use for the list

enableContentTypes: (Optional) Enable content type management

Return value

The newly created list

UpdateListVersioning(Microsoft.SharePoint.Client.Web,System.String,System.Boolean,System.Boolean,System.Boolean)

Enable/disable versioning on a list

Parameters

web: Site to be processed - can be root web or sub site

listName: List to operate on

enableVersioning: True to enable versioning, false to disable

enableMinorVersioning: Enable/Disable minor versioning

updateAndExecuteQuery: Perform list update and executequery, defaults to true

Exceptions

System.ArgumentException: Thrown when listName is a zero-length string or contains only white space

System.ArgumentNullException: listName is null

UpdateListVersioning(Microsoft.SharePoint.Client.List,System.Boolean,System.Boolean,System.Boolean)

Enable/disable versioning on a list

Parameters

list: List to be processed

enableVersioning: True to enable versioning, false to disable

enableMinorVersioning: Enable/Disable minor versioning

updateAndExecuteQuery: Perform list update and executequery, defaults to true

UpdateTaxonomyFieldDefaultValue(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.Guid,System.Guid)

Sets the default value for a managed metadata column in the specified list. This operation will not change existing items in the list

Parameters

web: Extension web

termName: Name of a specific term

listName: Name of list

fieldInternalName: Internal name of field

groupGuid: TermGroup Guid

termSetGuid: TermSet Guid

SetJSLinkCustomizations(Microsoft.SharePoint.Client.List,Microsoft.SharePoint.Client.PageType,System.String)

Sets JS link customization for a list form

Parameters

list: SharePoint list

pageType: Type of form

jslink: JSLink to set to the form. Set to empty string to remove the set JSLink customization. Specify multiple values separated by pipe symbol. For e.g.: ~sitecollection/_catalogs/masterpage/jquery-2.1.0.min.js|~sitecollection/_catalogs/masterpage/custom.js

SetLocalizationLabelsForList(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.String)

Can be used to set translations for different cultures.

Parameters

web: Site to be processed - can be root web or sub site

listTitle: Title of the list

cultureName: Culture name like en-us or fi-fi

titleResource: Localized Title string

descriptionResource: Localized Description string

Exceptions

System.ArgumentException: Thrown when listTitle, cultureName, titleResource, descriptionResource is a zero-length string or contains only white space

System.ArgumentNullException: listTitle, cultureName, titleResource, descriptionResource is null

SetLocalizationLabelsForList(Microsoft.SharePoint.Client.List,System.String,System.String,System.String)

Can be used to set translations for different cultures.

Parameters

list: List to be processed

cultureName: Culture name like en-us or fi-fi

titleResource: Localized Title string

descriptionResource: Localized Description string

Example
            list.SetLocalizationForSiteLabels("fi-fi", "Name of the site in Finnish", "Description in Finnish");

GetListID(Microsoft.SharePoint.Client.Web,System.String)

Returns the GUID id of a list

Parameters

web: Site to be processed - can be root web or sub site

listName: List to operate on

Exceptions

System.ArgumentException: Thrown when listName is a zero-length string or contains only white space

System.ArgumentNullException: listName is null

GetListByTitle(Microsoft.SharePoint.Client.Web,System.String)

Get list by using Title

Parameters

web: Site to be processed - can be root web or sub site

listTitle: Title of the list to return

Return value

Loaded list instance matching to title or null

Exceptions

System.ArgumentException: Thrown when listTitle is a zero-length string or contains only white space

System.ArgumentNullException: listTitle is null

GetListByUrl(Microsoft.SharePoint.Client.Web,System.String)

Get list by using Url

Parameters

web: Web (site) to be processed

webRelativeUrl: Url of list relative to the web (site), e.g. lists/testlist

Return value

GetPagesLibrary(Microsoft.SharePoint.Client.Web)

Gets the publishing pages library of the web based on site language

Parameters

web: The web.

Return value

The publishing pages library. Returns null if library was not found.

Exceptions

System.InvalidOperationException: Could not load pages library URL name from 'cmscore' resources file.

GetWebRelativeUrl(Microsoft.SharePoint.Client.List)

Gets the web relative URL. Allow users to get the web relative URL of a list. This is useful when exporting lists as it can then be used as a parameter to Web.GetListByUrl().

Parameters

list: The list to export the URL of.

Return value

The web relative URL of the list.

GetWebRelativeUrl(System.String,System.String)

Gets the web relative URL.

Parameters

listRootFolderServerRelativeUrl: The list root folder server relative URL.

parentWebServerRelativeUrl: The parent web server relative URL.

Return value

The web relative URL.

Exceptions

System.Exception: Cannot establish web relative URL from the list root folder URI and the parent web URI.

SetListPermission(Microsoft.SharePoint.Client.List,OfficeDevPnP.Core.Enums.BuiltInIdentity,Microsoft.SharePoint.Client.RoleType)

Set custom permission to the list

Parameters

list: List on which permission to be set

user: Built in user

roleType: Role type

SetListPermission(Microsoft.SharePoint.Client.List,Microsoft.SharePoint.Client.Principal,Microsoft.SharePoint.Client.RoleType)

Set custom permission to the list

Parameters

list: List on which permission to be set

principal: SharePoint Group or User

roleType: Role type

CreateViewsFromXMLFile(Microsoft.SharePoint.Client.Web,System.String,System.String)

Creates list views based on specific xml structure from file

Parameters

web:

listUrl:

filePath:

CreateViewsFromXMLString(Microsoft.SharePoint.Client.Web,System.String,System.String)

Creates views based on specific xml structure from string

Parameters

web:

listUrl:

xmlString:

CreateViewsFromXML(Microsoft.SharePoint.Client.Web,System.String,System.Xml.XmlDocument)

Create list views based on xml structure loaded to memory

Parameters

web:

listUrl:

xmlDoc:

CreateViewsFromXMLFile(Microsoft.SharePoint.Client.List,System.String)

Create list views based on specific xml structure in external file

Parameters

list:

filePath:

CreateViewsFromXMLString(Microsoft.SharePoint.Client.List,System.String)

Create list views based on specific xml structure in string

Parameters

list:

xmlString:

CreateViewsFromXML(Microsoft.SharePoint.Client.List,System.Xml.XmlDocument)

Actual implementation of the view creation logic based on given xml

Parameters

list:

xmlDoc:

CreateView(Microsoft.SharePoint.Client.List,System.String,Microsoft.SharePoint.Client.ViewType,System.String[],System.UInt32,System.Boolean,System.String,System.Boolean,System.Boolean)

Create view to existing list

Parameters

list:

viewName:

viewType:

viewFields:

rowLimit:

setAsDefault:

query:

personal:

paged:

GetViewById(Microsoft.SharePoint.Client.List,System.Guid)

Gets a view by Id

Parameters

list:

id:

Return value

returns null if not found

GetViewByName(Microsoft.SharePoint.Client.List,System.String)

Gets a view by Name

Parameters

list:

name:

Return value

returns null if not found

SetDefaultColumnValues(Microsoft.SharePoint.Client.List,System.Collections.Generic.IEnumerable{OfficeDevPnP.Core.Entities.IDefaultColumnValue})

Sets default values for column values. In order to for instance set the default Enterprise Metadata keyword field to a term, add the enterprise metadata keyword to a library (internal name "TaxKeyword") Column values are defined by the DefaultColumnValue class that has 3 properties: RelativeFolderPath : / to set a default value for the root of the document library, or /foldername to specify a subfolder FieldInternalName : The name of the field to set. For instance "TaxKeyword" to set the Enterprise Metadata field Terms : A collection of Taxonomy terms to set

Parameters

list:

columnValues:

ReIndexList(Microsoft.SharePoint.Client.List)

Queues a list for a full crawl the next incremental crawl

Parameters

list:

SharePoint.Client.NavigationExtensions

This class holds deprecated navigation related methods

This class holds navigation related methods

Methods

GetNavigationSettings(Microsoft.SharePoint.Client.Web)

Returns the navigation settings for the selected web

Parameters

web:

Return value

UpdateNavigationSettings(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.Entities.AreaNavigationEntity)

Updates navigation settings for the current web

Parameters

web:

navigationSettings:

GetEditableNavigationTermSet(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.ManagedNavigationKind)

Returns an editable version of the Global Navigation TermSet for a web site

Parameters

web: The target web.

navigationKind: Declares whether to look for Current or Global Navigation

Return value

The editable Global Navigation TermSet

IsManagedNavigationEnabled(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.ManagedNavigationKind)

Determines whether the current Web has the managed navigation enabled

Parameters

web: The target web.

navigationKind: The kind of navigation (Current or Global).

Return value

A boolean result of the test.

AddNavigationNode(Microsoft.SharePoint.Client.Web,System.String,System.Uri,System.String,OfficeDevPnP.Core.Enums.NavigationType,System.Boolean,System.Boolean)

Add a node to quick launch, top navigation bar or search navigation. The node will be added as the last node in the collection.

Parameters

web: Site to be processed - can be root web or sub site

nodeTitle: the title of node to add

nodeUri: the url of node to add

parentNodeTitle: if string.Empty, then will add this node as top level node

navigationType: the type of navigation, quick launch, top navigation or search navigation

isExternal: true if the link is an external link

asLastNode: true if the link should be added as the last node of the collection

DeleteNavigationNode(Microsoft.SharePoint.Client.Web,System.String,System.String,OfficeDevPnP.Core.Enums.NavigationType)

Deletes a navigation node from the quickLaunch or top navigation bar

Parameters

web: Site to be processed - can be root web or sub site

nodeTitle: the title of node to delete

parentNodeTitle: if string.Empty, then will delete this node as top level node

navigationType: the type of navigation, quick launch, top navigation or search navigation

DeleteAllNavigationNodes(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.Enums.NavigationType)

Deletes all Navigation Nodes from a given navigation

Parameters

web: Site to be processed - can be root web or sub site

navigationType: The type of navigation to support

UpdateNavigationInheritance(Microsoft.SharePoint.Client.Web,System.Boolean)

Updates the navigation inheritance setting

Parameters

web: Site to be processed - can be root web or sub site

inheritNavigation: boolean indicating if navigation inheritance is needed or not

LoadSearchNavigation(Microsoft.SharePoint.Client.Web)

Loads the search navigation nodes

Parameters

web: Site to be processed - can be root web or sub site

Return value

Collection of NavigationNode instances

AddCustomAction(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.Entities.CustomActionEntity)

Adds custom action to a web. If the CustomAction exists the item will be updated. Setting CustomActionEntity.Remove == true will delete the CustomAction.

Parameters

web: Site to be processed - can be root web or sub site

customAction: Information about the custom action be added or deleted

Return value

True if action was successfull

Example
        var editAction = new CustomActionEntity()
        {
           Title = "Edit Site Classification",
           Description = "Manage business impact information for site collection or sub sites.",
           Sequence = 1000,
           Group = "SiteActions",
           Location = "Microsoft.SharePoint.StandardMenu",
           Url = EditFormUrl,
           ImageUrl = EditFormImageUrl,
           Rights = new BasePermissions(),
        };
        editAction.Rights.Set(PermissionKind.ManageWeb);
        web.AddCustomAction(editAction);

AddCustomAction(Microsoft.SharePoint.Client.Site,OfficeDevPnP.Core.Entities.CustomActionEntity)

Adds custom action to a site collection. If the CustomAction exists the item will be updated. Setting CustomActionEntity.Remove == true will delete the CustomAction.

Parameters

site: Site collection to be processed

customAction: Information about the custom action be added or deleted

Return value

True if action was successfull

GetCustomActions(Microsoft.SharePoint.Client.Web)

Returns all custom actions in a web

Parameters

web: The web to process

Return value

GetCustomActions(Microsoft.SharePoint.Client.Site)

Returns all custom actions in a web

Parameters

site: The site to process

Return value

DeleteCustomAction(Microsoft.SharePoint.Client.Web,System.Guid)

Removes a custom action

Parameters

web: The web to process

id: The id of the action to remove. GetCustomActions

DeleteCustomAction(Microsoft.SharePoint.Client.Site,System.Guid)

Removes a custom action

Parameters

site: The site to process

id: The id of the action to remove. GetCustomActions

CustomActionExists(Microsoft.SharePoint.Client.Web,System.String)

Utility method to check particular custom action already exists on the web

Parameters

web:

name: Name of the custom action

Return value

CustomActionExists(Microsoft.SharePoint.Client.Site,System.String)

Utility method to check particular custom action already exists on the web

Parameters

site:

name: Name of the custom action

Return value

SharePoint.Client.PageExtensions

Class that holds all deprecated page and web part related operations

Class that handles all page and web part related operations

Methods

GetWikiPageContent(Microsoft.SharePoint.Client.Web,System.String)

Returns the HTML contents of a wiki page

Parameters

web: Site to be processed - can be root web or sub site

serverRelativePageUrl: Server relative url of the page, e.g. /sites/demo/SitePages/Test.aspx

Return value
Exceptions

System.ArgumentException: Thrown when serverRelativePageUrl is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when serverRelativePageUrl is null

GetWebParts(Microsoft.SharePoint.Client.Web,System.String)

List the web parts on a page

Parameters

web: Site to be processed - can be root web or sub site

serverRelativePageUrl: Server relative url of the page containing the webparts

Exceptions

System.ArgumentException: Thrown when serverRelativePageUrl is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when serverRelativePageUrl is null

AddWebPartToWebPartPage(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.Entities.WebPartEntity,System.String)

Inserts a web part on a web part page

Parameters

web: Site to be processed - can be root web or sub site

webPart: Information about the web part to insert

page: Page to add the web part on

Return value

Returns the added object

Exceptions

System.ArgumentException: Thrown when page is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when webPart or page is null

AddWebPartToWebPartPage(Microsoft.SharePoint.Client.Web,System.String,OfficeDevPnP.Core.Entities.WebPartEntity)

Inserts a web part on a web part page

Parameters

web: Site to be processed - can be root web or sub site

serverRelativePageUrl: Page to add the web part on

webPart: Information about the web part to insert

Return value

Returns the added object

Exceptions

System.ArgumentException: Thrown when serverRelativePageUrl is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when serverRelativePageUrl or webPart is null

AddWebPartToWikiPage(Microsoft.SharePoint.Client.Web,System.String,OfficeDevPnP.Core.Entities.WebPartEntity,System.String,System.Int32,System.Int32,System.Boolean)

Add web part to a wiki style page

Parameters

web: Site to be processed - can be root web or sub site

folder: System name of the wiki page library - typically sitepages

webPart: Information about the web part to insert

page: Page to add the web part on

row: Row of the wiki table that should hold the inserted web part

col: Column of the wiki table that should hold the inserted web part

addSpace: Does a blank line need to be added after the web part (to space web parts)

Return value

Returns the added object

Exceptions

System.ArgumentException: Thrown when folder or page is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when folder, webPart or page is null

AddWebPartToWikiPage(Microsoft.SharePoint.Client.Web,System.String,OfficeDevPnP.Core.Entities.WebPartEntity,System.Int32,System.Int32,System.Boolean)

Add web part to a wiki style page

Parameters

web: Site to be processed - can be root web or sub site

serverRelativePageUrl: Server relative url of the page to add the webpart to

webPart: Information about the web part to insert

row: Row of the wiki table that should hold the inserted web part

col: Column of the wiki table that should hold the inserted web part

addSpace: Does a blank line need to be added after the web part (to space web parts)

Return value

Returns the added object

Exceptions

System.ArgumentException: Thrown when serverRelativePageUrl is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when serverRelativePageUrl or webPart is null

AddLayoutToWikiPage(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.WikiPageLayout,System.String)

Applies a layout to a wiki page

Parameters

web: Site to be processed - can be root web or sub site

layout: Wiki page layout to be applied

serverRelativePageUrl:

Exceptions

System.ArgumentException: Thrown when serverRelativePageUrl is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when serverRelativePageUrl is null

AddLayoutToWikiPage(Microsoft.SharePoint.Client.Web,System.String,OfficeDevPnP.Core.WikiPageLayout,System.String)

Applies a layout to a wiki page

Parameters

web: Site to be processed - can be root web or sub site

folder: System name of the wiki page library - typically sitepages

layout: Wiki page layout to be applied

page: Name of the page that will get a new wiki page layout

Exceptions

System.ArgumentException: Thrown when folder or page is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when folder or page is null

AddHtmlToWikiPage(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String)

Add html to a wiki style page

Parameters

web: Site to be processed - can be root web or sub site

folder: System name of the wiki page library - typically sitepages

html: The html to insert

page: Page to add the html on

Exceptions

System.ArgumentException: Thrown when folder, html or page is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when folder, html or page is null

AddHtmlToWikiPage(Microsoft.SharePoint.Client.Web,System.String,System.String)

Add HTML to a wiki page

Parameters

web: Site to be processed - can be root web or sub site

serverRelativePageUrl:

html:

Exceptions

System.ArgumentException: Thrown when serverRelativePageUrl or html is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when serverRelativePageUrl or html is null

AddHtmlToWikiPage(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.Int32,System.Int32)

Add a HTML fragment to a location on a wiki style page

Parameters

web: Site to be processed - can be root web or sub site

folder: System name of the wiki page library - typically sitepages

html: html to be inserted

page: Page to add the web part on

row: Row of the wiki table that should hold the inserted web part

col: Column of the wiki table that should hold the inserted web part

Exceptions

System.ArgumentException: Thrown when folder, html or page is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when folder, html or page is null

AddHtmlToWikiPage(Microsoft.SharePoint.Client.Web,System.String,System.String,System.Int32,System.Int32)

Add a HTML fragment to a location on a wiki style page

Parameters

web: Site to be processed - can be root web or sub site

serverRelativePageUrl: server relative Url of the page to add the fragment to

html: html to be inserted

row: Row of the wiki table that should hold the inserted web part

col: Column of the wiki table that should hold the inserted web part

Exceptions

System.ArgumentException: Thrown when serverRelativePageUrl or html is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when serverRelativePageUrl or html is null

DeleteWebPart(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String)

Deletes a web part from a page

Parameters

web: Site to be processed - can be root web or sub site

folder: System name of the wiki page library - typically sitepages

title: Title of the web part that needs to be deleted

page: Page to remove the web part from

Exceptions

System.ArgumentException: Thrown when folder, title or page is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when folder, title or page is null

DeleteWebPart(Microsoft.SharePoint.Client.Web,System.String,System.String)

Deletes a web part from a page

Parameters

web: Site to be processed - can be root web or sub site

serverRelativePageUrl: Server relative URL of the page to remove

title: Title of the web part that needs to be deleted

Exceptions

System.ArgumentException: Thrown when serverRelativePageUrl or title is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when serverRelativePageUrl or title is null

AddWikiPage(Microsoft.SharePoint.Client.Web,System.String,System.String)

Adds a blank Wiki page to the site pages library

Parameters

web: Site to be processed - can be root web or sub site

wikiPageLibraryName: Name of the wiki page library

wikiPageName: Wiki page to operate on

Return value

The relative URL of the added wiki page

Exceptions

System.ArgumentException: Thrown when wikiPageLibraryName or wikiPageName is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when wikiPageLibraryName or wikiPageName is null

EnsureWikiPage(Microsoft.SharePoint.Client.Web,System.String,System.String)

Returns the Url for the requested wiki page, creates it if the pageis not yet available

Parameters

web: Site to be processed - can be root web or sub site

wikiPageLibraryName: Name of the wiki page library

wikiPageName: Wiki page to operate on

Return value

The relative URL of the added wiki page

Exceptions

System.ArgumentException: Thrown when wikiPageLibraryName or wikiPageName is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when wikiPageLibraryName or wikiPageName is null

AddWikiPageByUrl(Microsoft.SharePoint.Client.Web,System.String,System.String)

Adds a wiki page by Url

Parameters

web: The web to process

serverRelativePageUrl: Server relative URL of the wiki page to process

html: HTML to add to wiki page

Exceptions

System.ArgumentException: Thrown when serverRelativePageUrl is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when serverRelativePageUrl is null

SetWebPartProperty(Microsoft.SharePoint.Client.Web,System.String,System.String,System.Guid,System.String)

Sets a web part property

Parameters

web: The web to process

key: The key to update

value: The value to set

id: The id of the webpart

serverRelativePageUrl:

Exceptions

System.ArgumentException: Thrown when key or serverRelativePageUrl is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when key or serverRelativePageUrl is null

SetWebPartProperty(Microsoft.SharePoint.Client.Web,System.String,System.Int32,System.Guid,System.String)

Sets a web part property

Parameters

web: The web to process

key: The key to update

value: The value to set

id: The id of the webpart

serverRelativePageUrl:

Exceptions

System.ArgumentException: Thrown when key or serverRelativePageUrl is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when key or serverRelativePageUrl is null

SetWebPartProperty(Microsoft.SharePoint.Client.Web,System.String,System.Boolean,System.Guid,System.String)

Sets a web part property

Parameters

web: The web to process

key: The key to update

value: The value to set

id: The id of the webpart

serverRelativePageUrl:

Exceptions

System.ArgumentException: Thrown when key or serverRelativePageUrl is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when key or serverRelativePageUrl is null

GetWebPartProperties(Microsoft.SharePoint.Client.Web,System.Guid,System.String)

Returns web part properties

Parameters

web: The web to process

id: The id of the webpart

serverRelativePageUrl:

Exceptions

System.ArgumentException: Thrown when key or serverRelativePageUrl is a zero-length string or contains only white space

System.ArgumentNullException: Thrown when key or serverRelativePageUrl is null

AddPublishingPage(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.Boolean,Microsoft.SharePoint.Client.Folder,System.Nullable{System.DateTime},System.Nullable{System.DateTime},System.Boolean)

Adds the publishing page.

Parameters

web: The web.

pageName: Name of the page.

pageTemplateName: Name of the page template/layout excluded the .aspx file extension.

title: The title of the target publishing page.

publish: Should the page be published or not?

folder: The target folder for the page, within the Pages library.

startDate: Start date for scheduled publishing.

endDate: End date for scheduled publishing.

schedule: Defines whether to define a schedule or not.

Exceptions

System.ArgumentNullException: Thrown when key or pageName is a zero-length string or contains only white space

System.ArgumentException: Thrown when key or pageName is null

AddNavigationFriendlyUrl(Microsoft.SharePoint.Client.Publishing.PublishingPage,Microsoft.SharePoint.Client.Web,System.String,System.String,Microsoft.SharePoint.Client.Publishing.Navigation.NavigationTermSetItem,System.Boolean,System.Boolean)

Adds a user-friendly URL for a PublishingPage object.

Parameters

page: The target page to add to managed navigation.

web: The target web.

navigationTitle: The title for the navigation item.

friendlyUrlSegment: The user-friendly text to use as the URL segment.

editableParent: The parent NavigationTermSetItem object below which this new friendly URL should be created.

showInGlobalNavigation: Defines whether the navigation item has to be shown in the Global Navigation, optional and default to true.

showInCurrentNavigation: Defines whether the navigation item has to be shown in the Current Navigation, optional and default to true.

Return value

The simple link URL just created.

GetPublishingPage(Microsoft.SharePoint.Client.Web,System.String)

Gets a Publishing Page from the root folder of the Pages library.

Parameters

web: The web.

fileLeafRef: The file leaf reference.

Return value

The PublishingPage object, if any. Otherwise null.

Exceptions

System.ArgumentNullException: fileLeafRef

System.ArgumentException: fileLeafRef

GetPublishingPage(Microsoft.SharePoint.Client.Web,System.String,Microsoft.SharePoint.Client.Folder)

Gets a Publishing Page from any folder in the Pages library.

Parameters

web: The web.

fileLeafRef: The file leaf reference.

folder: The folder where to search the page.

Return value

The PublishingPage object, if any. Otherwise null.

Exceptions

System.ArgumentNullException: fileLeafRef

System.ArgumentException: fileLeafRef

SharePoint.Client.ProvisioningExtensions

File-based (CAML) deprecated provisioning extensions

File-based (CAML) provisioning extensions

Methods

ProvisionElementFile(Microsoft.SharePoint.Client.Web,System.String)

Provisions the items defined by the specified Elements (CAML) file; currently only supports modules (files).

Parameters

web: Web to provision the elements to

path: Path to the XML file containing the Elements CAML defintion

ProvisionElementXml(Microsoft.SharePoint.Client.Web,System.String,System.Xml.Linq.XElement)

Provisions the items defined by the specified Elements (CAML) XML; currently only supports modules (files).

Parameters

web: Web to provision the elements to

baseFolder: Base local folder to find any referenced items, e.g. files

elementsXml: Elements (CAML) XML element that defines the items to provision; currently only supports modules (files)

ProvisionModuleInternal(Microsoft.SharePoint.Client.Web,System.String,System.Xml.Linq.XElement)

Uploads all files defined by the moduleXml

ProvisionFileInternal(Microsoft.SharePoint.Client.Web,System.String,System.String,System.Xml.Linq.XElement,System.Boolean)

Uploads the file defined by the fileXml, creating folders as necessary.

SharePoint.Client.RecordsManagementExtensions

Class that deals with deprecated records management functionality

Class that deals with records management functionality

Fields

INPLACE_RECORDS_MANAGEMENT_FEATURE_ID

Defines the ID of the Inplace Records Management Feature

ECM_SITE_RECORD_DECLARATION_DEFAULT

Defines the name of the ECM Site Record Declaration Default propertybag value

ECM_SITE_RECORD_RESTRICTIONS

Defines the name of the ECM Site Record Restrictions propertybag value

ECM_SITE_RECORD_DECLARATION_BY

Defines the name of the ECM Site Record Declaration by propertybag value

ECM_SITE_RECORD_UNDECLARATION_BY

Defines the name of the ECM Site Record Undeclaration by propertybag value

ECM_ALLOW_MANUAL_DECLARATION

Defines the name of the ECM Allow Manual Declaration propertybag value

ECM_IPR_LIST_USE_LIST_SPECIFIC

Defines the name of the ECM IPR List use List Specific propertybag value

ECM_AUTO_DECLARE_RECORDS

Defines the name of the ECM auto declare records propertybag value

Methods

IsInPlaceRecordsManagementActive(Microsoft.SharePoint.Client.Site)

Checks if in place records management functionality is enabled for this site collection

Parameters

site: Site collection to operate on

Return value

True if in place records management is enabled, false otherwise

ActivateInPlaceRecordsManagementFeature(Microsoft.SharePoint.Client.Site)

Activate the in place records management feature

Parameters

site: Site collection to operate on

DisableInPlaceRecordsManagementFeature(Microsoft.SharePoint.Client.Site)

Deactivate the in place records management feature

Parameters

site: Site collection to operate on

EnableSiteForInPlaceRecordsManagement(Microsoft.SharePoint.Client.Site)

Enable in place records management. The in place records management feature will be enabled and the in place record management will be enabled in all locations with record declaration allowed by all contributors and undeclaration by site admins

Parameters

site: Site collection to operate on

SetManualRecordDeclarationInAllLocations(Microsoft.SharePoint.Client.Site,System.Boolean)

Defines if in place records management is allowed in all places

Parameters

site: Site collection to operate on

inAllPlaces: True if allowed in all places, false otherwise

GetManualRecordDeclarationInAllLocations(Microsoft.SharePoint.Client.Site)

Get the value of the records management is allowed in all places setting

Parameters

site: Site collection to operate on

Return value

True if records management is allowed in all places, false otherwise

SetRecordRestrictions(Microsoft.SharePoint.Client.Site,OfficeDevPnP.Core.EcmSiteRecordRestrictions)

Defines the restrictions that are placed on a document once it's declared as a record

Parameters

site: Site collection to operate on

restrictions: enum that holds the restrictions to be applied

GetRecordRestrictions(Microsoft.SharePoint.Client.Site)

Gets the current restrictions on declared records

Parameters

site: Site collection to operate on

Return value

enum that defines the current restrictions

SetRecordDeclarationBy(Microsoft.SharePoint.Client.Site,OfficeDevPnP.Core.EcmRecordDeclarationBy)

Defines who can declare records

Parameters

site: Site collection to operate on

by: enum that defines who can declare a record

GetRecordDeclarationBy(Microsoft.SharePoint.Client.Site)

Gets who can declare records

Parameters

site: Site collection to operate on

Return value

enum that defines who can declare a record

SetRecordUnDeclarationBy(Microsoft.SharePoint.Client.Site,OfficeDevPnP.Core.EcmRecordDeclarationBy)

Defines who can undeclare records

Parameters

site: Site collection to operate on

by: enum that defines who can undeclare a record

GetRecordUnDeclarationBy(Microsoft.SharePoint.Client.Site)

Gets who can undeclare records

Parameters

site: Site collection to operate on

Return value

enum that defines who can undeclare a record

IsListRecordSettingDefined(Microsoft.SharePoint.Client.List)

Checks if this list has active in place records management settings defined

Parameters

list: List to operate against

Return value

True if in place records management settings are active for this list

SetListManualRecordDeclaration(Microsoft.SharePoint.Client.List,OfficeDevPnP.Core.EcmListManualRecordDeclaration)

Defines the manual in place record declaration for this list

Parameters

list: List to operate against

settings: enum that defines the manual in place record declaration settings for this list

GetListManualRecordDeclaration(Microsoft.SharePoint.Client.List)

Gets the manual in place record declaration for this list

Parameters

list: List to operate against

Return value

enum that defines the manual in place record declaration settings for this list

SetListAutoRecordDeclaration(Microsoft.SharePoint.Client.List,System.Boolean)

Defines if auto record declaration is active for this list: all added items will be automatically declared as a record if active

Parameters

list: List to operate on

autoDeclareRecords: True to automatically declare all added items as record, false otherwise

GetListAutoRecordDeclaration(Microsoft.SharePoint.Client.List)

Returns if auto record declaration is active for this list

Parameters

list: List to operate against

Return value

True if auto record declaration is active, false otherwise

SharePoint.Client.SearchExtensions

Class for deprecated search extension methods

Class for Search extension methods

Methods

ExportSearchSettings(Microsoft.SharePoint.Client.ClientContext,System.String,Microsoft.SharePoint.Client.Search.Administration.SearchObjectLevel)

Exports the search settings to file.

Parameters

context: Context for SharePoint objects and operations

exportFilePath: Path where to export the search settings

searchSettingsExportLevel: Search settings export level Reference: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.search.administration.searchobjectlevel(v=office.15).aspx

GetSearchConfiguration(Microsoft.SharePoint.Client.Web)

Returns the current search configuration as as string

Parameters

web:

Return value

GetSearchConfiguration(Microsoft.SharePoint.Client.Site)

Returns the current search configuration as as string

Parameters

site:

Return value

GetSearchConfigurationImplementation(Microsoft.SharePoint.Client.ClientRuntimeContext,Microsoft.SharePoint.Client.Search.Administration.SearchObjectLevel)

Returns the current search configuration for the specified object level

Parameters

context:

searchSettingsObjectLevel:

Return value

ImportSearchSettings(Microsoft.SharePoint.Client.ClientContext,System.String,Microsoft.SharePoint.Client.Search.Administration.SearchObjectLevel)

Imports search settings from file.

Parameters

context: Context for SharePoint objects and operations

searchSchemaImportFilePath: Search schema xml file path

searchSettingsImportLevel: Search settings import level Reference: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.search.administration.searchobjectlevel(v=office.15).aspx

SetSearchConfiguration(Microsoft.SharePoint.Client.Web,System.String)

Sets the search configuration

Parameters

web:

searchConfiguration:

SetSearchConfiguration(Microsoft.SharePoint.Client.Site,System.String)

Sets the search configuration

Parameters

site:

searchConfiguration:

SetSearchConfigurationImplementation(Microsoft.SharePoint.Client.ClientRuntimeContext,Microsoft.SharePoint.Client.Search.Administration.SearchObjectLevel,System.String)

Sets the search configuration at the specified object level

Parameters

context:

searchObjectLevel:

searchConfiguration:

SetSiteCollectionSearchCenterUrl(Microsoft.SharePoint.Client.Web,System.String)

Sets the search center url on site collection (Site Settings -> Site collection administration --> Search Settings)

Parameters

web: SharePoint site - root web

searchCenterUrl: Search center url

GetSiteCollectionSearchCenterUrl(Microsoft.SharePoint.Client.Web)

Get the search center url for the site collection (Site Settings -> Site collection administration --> Search Settings)

Parameters

web: SharePoint site - root web

Return value

Search center url for web

SetWebSearchCenterUrl(Microsoft.SharePoint.Client.Web,System.String)

Sets the search results page url on current web (Site Settings -> Search --> Search Settings)

Parameters

web: SharePoint current web

searchCenterUrl: Search results page url

GetWebSearchCenterUrl(Microsoft.SharePoint.Client.Web)

Get the search results page url for the web (Site Settings -> Search --> Search Settings)

Parameters

web: SharePoint site - current web

Return value

Search results page url for web

SharePoint.Client.SecurityExtensions

This manager class holds deprecated security related methods

This manager class holds security related methods

Fields

MockupUserEmailCache

A dictionary to cache resolved user emails. key: user login name, value: user email. *** Don't use this cache in a real world application. *** Instead it should be replaced by a real cache with ref object to clear up intermediate records periodically.

MockupGroupCache

A dictionary to cache all user entities of a given SharePoint group. key: group login name, value: an array of user entities belongs to the group. *** Don't use this cache in a real world application. *** Instead it should be replaced by a real cache with ref object to clear up intermediate records periodically.

Methods

GetAdministrators(Microsoft.SharePoint.Client.Web)

Get a list of site collection administrators

Parameters

web: Site to operate on

Return value

List of objects

AddAdministrators(Microsoft.SharePoint.Client.Web,System.Collections.Generic.List{OfficeDevPnP.Core.Entities.UserEntity},System.Boolean)

Add a site collection administrator to a site collection

Parameters

web: Site to operate on

adminLogins: Array of admins loginnames to add

addToOwnersGroup: Optionally the added admins can also be added to the Site owners group

RemoveAdministrator(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.Entities.UserEntity)

Removes an administrators from the site collection

Parameters

web: Site to operate on

admin: that describes the admin to be removed

AddReaderAccess(Microsoft.SharePoint.Client.Web)

Add read access to the group "Everyone except external users".

Parameters

web: Site to be processed - can be root web or sub site

AddReaderAccess(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.Enums.BuiltInIdentity)

Add read access to the group "Everyone except external users".

Parameters

web: Site to be processed - can be root web or sub site

user: Built in user to add to the visitors group

GetSharingCapabilitiesTenant(Microsoft.SharePoint.Client.Web,System.Uri)

Get the external sharing settings for the provided site. Only works in Office 365 Multi-Tenant

Parameters

web: Tenant administration web

siteUrl: Site to get the sharing capabilities from

Return value

Sharing capabilities of the site collection

GetExternalUsersTenant(Microsoft.SharePoint.Client.Web)

Returns a list all external users in your tenant

Parameters

web: Tenant administration web

Return value

A list of objects

GetExternalUsersForSiteTenant(Microsoft.SharePoint.Client.Web,System.Uri)

Returns a list all external users for a given site that have at least the viewpages permission

Parameters

web: Tenant administration web

siteUrl: Url of the site fetch the external users for

Return value

A list of objects

GetGroupID(Microsoft.SharePoint.Client.Web,System.String)

Returns the integer ID for a given group name

Parameters

web: Site to be processed - can be root web or sub site

groupName: SharePoint group name

Return value

Integer group ID

AddGroup(Microsoft.SharePoint.Client.Web,System.String,System.String,System.Boolean,System.Boolean,System.Boolean)

Adds a group

Parameters

web: Site to add the group to

groupName: Name of the group

groupDescription: Description of the group

groupIsOwner: Sets the created group as group owner if true

updateAndExecuteQuery: Set to false to postpone the executequery call

onlyAllowMembersViewMembership: Set whether members are allowed to see group membership, defaults to false

Return value

The created group

AssociateDefaultGroups(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Group,Microsoft.SharePoint.Client.Group,Microsoft.SharePoint.Client.Group)

Associate the provided groups as default owners, members or visitors groups. If a group is null then the association is not done

Parameters

web: Site to operate on

owners: Owners group

members: Members group

visitors: Visitors group

AddUserToGroup(Microsoft.SharePoint.Client.Web,System.String,System.String)

Adds a user to a group

Parameters

web: web to operate against

groupName: Name of the group

userLoginName: Loginname of the user

AddUserToGroup(Microsoft.SharePoint.Client.Web,System.Int32,System.String)

Adds a user to a group

Parameters

web: web to operate against

groupId: Id of the group

userLoginName: Login name of the user

AddUserToGroup(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Group,Microsoft.SharePoint.Client.User)

Adds a user to a group

Parameters

web: Web to operate against

group: Group object representing the group

user: User object representing the user

AddUserToGroup(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Group,System.String)

Adds a user to a group

Parameters

web: Web to operate against

group: Group object representing the group

userLoginName: Login name of the user

AddPermissionLevelToUser(Microsoft.SharePoint.Client.SecurableObject,System.String,Microsoft.SharePoint.Client.RoleType,System.Boolean)

Add a permission level (e.g.Contribute, Reader,...) to a user

Parameters

securableObject: Web/List/Item to operate against

userLoginName: Loginname of the user

permissionLevel: Permission level to add

removeExistingPermissionLevels: Set to true to remove all other permission levels for that user

AddPermissionLevelToUser(Microsoft.SharePoint.Client.SecurableObject,System.String,System.String,System.Boolean)

Add a role definition (e.g.Contribute, Read, Approve) to a user

Parameters

securableObject: Web/List/Item to operate against

userLoginName: Loginname of the user

roleDefinitionName: Name of the role definition to add, Full Control|Design|Contribute|Read|Approve|Manage Hierarchy|Restricted Read. Use the correct name of the language of the root site you are using

removeExistingPermissionLevels: Set to true to remove all other permission levels for that user

AddPermissionLevelToGroup(Microsoft.SharePoint.Client.SecurableObject,System.String,Microsoft.SharePoint.Client.RoleType,System.Boolean)

Add a permission level (e.g.Contribute, Reader,...) to a group

Parameters

securableObject: Web/List/Item to operate against

groupName: Name of the group

permissionLevel: Permission level to add

removeExistingPermissionLevels: Set to true to remove all other permission levels for that group

AddPermissionLevelToPrincipal(Microsoft.SharePoint.Client.SecurableObject,Microsoft.SharePoint.Client.Principal,Microsoft.SharePoint.Client.RoleType,System.Boolean)

Add a permission level (e.g.Contribute, Reader,...) to a group

Parameters

securableObject: Web/List/Item to operate against

principal: Principal to add permission to

permissionLevel: Permission level to add

removeExistingPermissionLevels: Set to true to remove all other permission levels for that group

AddPermissionLevelToGroup(Microsoft.SharePoint.Client.SecurableObject,System.String,System.String,System.Boolean)

Add a role definition (e.g.Contribute, Read, Approve) to a group

Parameters

securableObject: Web/List/Item to operate against

groupName: Name of the group

roleDefinitionName: Name of the role definition to add, Full Control|Design|Contribute|Read|Approve|Manage Hierarchy|Restricted Read. Use the correct name of the language of the root site you are using

removeExistingPermissionLevels: Set to true to remove all other permission levels for that group

AddPermissionLevelToPrincipal(Microsoft.SharePoint.Client.SecurableObject,Microsoft.SharePoint.Client.Principal,System.String,System.Boolean)

Add a role definition (e.g.Contribute, Read, Approve) to a group

Parameters

securableObject: Web/List/Item to operate against

principal: Principal to add permission to

roleDefinitionName: Name of the role definition to add, Full Control|Design|Contribute|Read|Approve|Manage Hierarchy|Restricted Read. Use the correct name of the language of the root site you are using

removeExistingPermissionLevels: Set to true to remove all other permission levels for that group

RemovePermissionLevelFromUser(Microsoft.SharePoint.Client.SecurableObject,System.String,Microsoft.SharePoint.Client.RoleType,System.Boolean)

Removes a permission level from a user

Parameters

securableObject: Web/List/Item to operate against

userLoginName: Loginname of user

permissionLevel: Permission level to remove. If null all permission levels are removed

removeAllPermissionLevels: Set to true to remove all permission level.

RemovePermissionLevelFromPrincipal(Microsoft.SharePoint.Client.SecurableObject,Microsoft.SharePoint.Client.Principal,Microsoft.SharePoint.Client.RoleType,System.Boolean)

Removes a permission level from a user

Parameters

securableObject: Web/List/Item to operate against

principal: Principal to remove permission from

permissionLevel: Permission level to remove. If null all permission levels are removed

removeAllPermissionLevels: Set to true to remove all permission level.

RemovePermissionLevelFromUser(Microsoft.SharePoint.Client.SecurableObject,System.String,System.String,System.Boolean)

Removes a permission level from a user

Parameters

securableObject: Web/List/Item to operate against

userLoginName: Loginname of user

roleDefinitionName: Name of the role definition to add, Full Control|Design|Contribute|Read|Approve|Manage Heirarchy|Restricted Read. Use the correct name of the language of the site you are using

removeAllPermissionLevels: Set to true to remove all permission level.

RemovePermissionLevelFromPrincipal(Microsoft.SharePoint.Client.SecurableObject,Microsoft.SharePoint.Client.Principal,System.String,System.Boolean)

Removes a permission level from a user

Parameters

securableObject: Web/List/Item to operate against

principal: Principal to remove permission from

roleDefinitionName: Name of the role definition to add, Full Control|Design|Contribute|Read|Approve|Manage Heirarchy|Restricted Read. Use the correct name of the language of the site you are using

removeAllPermissionLevels: Set to true to remove all permission level.

RemovePermissionLevelFromGroup(Microsoft.SharePoint.Client.SecurableObject,System.String,Microsoft.SharePoint.Client.RoleType,System.Boolean)

Removes a permission level from a group

Parameters

securableObject: Web/List/Item to operate against

groupName: name of the group

permissionLevel: Permission level to remove. If null all permission levels are removed

removeAllPermissionLevels: Set to true to remove all permission level.

RemovePermissionLevelFromGroup(Microsoft.SharePoint.Client.SecurableObject,System.String,System.String,System.Boolean)

Removes a permission level from a group

Parameters

securableObject: Web/List/Item to operate against

groupName: name of the group

roleDefinitionName: Name of the role definition to add, Full Control|Design|Contribute|Read|Approve|Manage Heirarchy|Restricted Read. Use the correct name of the language of the site you are using

removeAllPermissionLevels: Set to true to remove all permission level.

RemoveUserFromGroup(Microsoft.SharePoint.Client.Web,System.String,System.String)

Removes a user from a group

Parameters

web: Web to operate against

groupName: Name of the group

userLoginName: Loginname of the user

RemoveUserFromGroup(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Group,Microsoft.SharePoint.Client.User)

Removes a user from a group

Parameters

web: Web to operate against

group: Group object to operate against

user: User object that needs to be removed

RemoveGroup(Microsoft.SharePoint.Client.Web,System.String)

Remove a group

Parameters

web: Web to operate against

groupName: Name of the group

RemoveGroup(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Group)

Remove a group

Parameters

web: Web to operate against

group: Group object to remove

IsUserInGroup(Microsoft.SharePoint.Client.Web,System.String,System.String)

Checks if a user is member of a group

Parameters

web: Web to operate against

groupName: Name of the group

userLoginName: Loginname of the user

Return value

True if the user is in the group, false otherwise

GroupExists(Microsoft.SharePoint.Client.Web,System.String)

Checks if a group exists

Parameters

web: Web to operate against

groupName: Name of the group

Return value

True if the group exists, false otherwise

GetAuthenticationRealm(Microsoft.SharePoint.Client.Web)

Returns the authentication realm for the current web

Parameters

web:

Return value

GetPath(Microsoft.SharePoint.Client.SecurableObject)

Get URL path of a securable object

Parameters

obj: A securable object which could be a web, a list, a list item, a document library or a document

Return value

The URL of the securable object

Preload(Microsoft.SharePoint.Client.SecurableObject,System.Int32)

Load properties of the current securable object and get child securable objects with unique role assignments if any.

Parameters

obj: The current securable object.

leafBreadthLimit: Skip further visiting on this branch if the number of child items or documents with unique role assignments exceeded leafBreadthLimit.

Return value

The child securable objects.

Visit(Microsoft.SharePoint.Client.SecurableObject,System.Int32,System.Action{Microsoft.SharePoint.Client.SecurableObject,System.String})

Traverse each descendents of a securable object with a specified action.

Parameters

obj: The current securable object.

leafBreadthLimit: Skip further visiting on this branch if the number of child items or documents with unique role assignments exceeded leafBreadthLimit.

action: The action to be executed for each securable object.

GetUserEmail(Microsoft.SharePoint.Client.Web,System.Int32)

Get user email by user id.

Parameters

web: The current web object.

userId: The user id

Return value

The email property of the specified user.

EnsureGroupCache(Microsoft.SharePoint.Client.SecurableObject,System.String)

Ensure all users of a given SharePoint group has been cached.

Parameters

obj: The current securable object.

groupLoginName: The group login name.

GetAllUniqueRoleAssignments(Microsoft.SharePoint.Client.Web,System.Int32)

Get all unique role assignments for a web object and all its descendents down to document or list item level.

Parameters

web: The current web object to be processed.

leafBreadthLimit: Skip further visiting on this branch if the number of child items or documents with unique role assignments exceeded leafBreadthLimit. When setting to 0, the process will stop at list / document library level.

Return value

SharePoint.Client.TaxonomyExtensions

Class for deprecated taxonomy extension methods

Fields

TaxonomyGuidLabelDelimiter

The default Taxonomy Guid Label Delimiter

Methods

CreateTermGroup(Microsoft.SharePoint.Client.Taxonomy.TermStore,System.String,System.Guid,System.String)

Creates a new term group, in the specified term store.

Parameters

termStore: the term store to use

groupName: Name of the term group

groupId: (Optional) ID of the group; if not provided a random GUID is used

groupDescription: (Optional) Description of the term group

Return value

The created term group

EnsureTermGroup(Microsoft.SharePoint.Client.Site,System.String,System.Guid,System.String)

Ensures the named group exists, returning a reference to the group, and creating or updating as necessary.

Parameters

site: Site connected to the term store to use

groupName: Name of the term group

groupId: (Optional) ID of the group; if not provided the parameter is ignored, a random GUID is used if necessary to create the group, otherwise if the ID differs a warning is logged

groupDescription: (Optional) Description of the term group; if null or not provided the parameter is ignored, otherwise the group is updated as necessary to match the description; passing an empty string will clear the description

Return value

The required term group

EnsureTermSet(Microsoft.SharePoint.Client.Taxonomy.TermGroup,System.String,System.Guid,System.Nullable{System.Int32},System.String,System.Nullable{System.Boolean},System.String,System.String)

Ensures the named term set exists, returning a reference to the set, and creating or updating as necessary.

Parameters

parentGroup: Group to check or create the term set in

termSetName: Name of the term set

termSetId: (Optional) ID of the term set; if not provided the parameter is ignored, a random GUID is used if necessary to create the term set, otherwise if the ID differs a warning is logged

lcid: (Optional) Default language of the term set; if not provided the default of the associate term store is used

description: (Optional) Description of the term set; if null or not provided the parameter is ignored, otherwise the term set is updated as necessary to match the description; passing an empty string will clear the description

isOpen: (Optional) Whether the term store is open for new term creation or not

termSetContact:

termSetOwner:

Return value

The required term set

GetDefaultTermStore(Microsoft.SharePoint.Client.Web)

Private method used for resolving taxonomy term set for taxonomy field

Parameters

web: Site to be processed - can be root web or sub site

Return value

GetTaxonomySession(Microsoft.SharePoint.Client.Site)

Returns a new taxonomy session for the current site

Parameters

site:

Return value

GetDefaultKeywordsTermStore(Microsoft.SharePoint.Client.Site)

Returns the default keywords termstore for the current site

Parameters

site:

Return value

GetDefaultSiteCollectionTermStore(Microsoft.SharePoint.Client.Site)

Returns the default site collection termstore

Parameters

site:

Return value

GetTermSetsByName(Microsoft.SharePoint.Client.Site,System.String,System.Int32)

Finds a termset by name

Parameters

site: The current site

name: The name of the termset

lcid: The locale ID for the termset to return, defaults to 1033

Return value

GetTermGroupByName(Microsoft.SharePoint.Client.Site,System.String)

Finds a termgroup by name

Parameters

site: The current site

name: The name of the termgroup

Return value

GetTermGroupByName(Microsoft.SharePoint.Client.Taxonomy.TermStore,System.String)

Gets the named term group, if it exists in the term store.

Parameters

termStore: The term store to use

groupName: Name of the term group

Return value

The requested term group, or null if it does not exist

GetTermGroupById(Microsoft.SharePoint.Client.Site,System.Guid)

Finds a termgroup by its ID

Parameters

site: The current site

termGroupId: The ID of the termgroup

Return value

GetTermByName(Microsoft.SharePoint.Client.Site,System.Guid,System.String)

Gets a Taxonomy Term by Name

Parameters

site: The site to process

termSetId:

term:

Return value

AddTermToTermset(Microsoft.SharePoint.Client.Site,System.Guid,System.String)

Adds a term to a given termset

Parameters

site: The current site

termSetId: The ID of the termset

term: The label of the new term to create

Return value

AddTermToTermset(Microsoft.SharePoint.Client.Site,System.Guid,System.String,System.Guid)

Adds a term to a given termset

Parameters

site: The current site

termSetId: The ID of the termset

term: The label of the new term to create

termId: The ID of the term to create

Return value

ImportTerms(Microsoft.SharePoint.Client.Site,System.String[],System.Int32,System.String,System.Boolean)

Imports an array of | delimited strings into the deafult site collection termstore. Specify strings in this format: TermGroup|TermSet|Term E.g. "Locations|Nordics|Sweden"

Parameters

site:

termLines:

lcid:

delimiter:

synchronizeDeletions: Remove tags that are not present in the import

ImportTerms(Microsoft.SharePoint.Client.Site,System.String[],System.Int32,Microsoft.SharePoint.Client.Taxonomy.TermStore,System.String,System.Boolean)

Imports an array of | delimited strings into the deafult site collection termstore. Specify strings in this format: TermGroup|TermSet|Term E.g. "Locations|Nordics|Sweden"

Parameters

site:

termLines:

lcid:

termStore: The termstore to import the terms into

delimiter:

synchronizeDeletions: Remove tags that are not present in the import

ImportTermSet(Microsoft.SharePoint.Client.Taxonomy.TermGroup,System.String,System.Guid,System.Boolean,System.Nullable{System.Boolean},System.String,System.String)

The format of the file is the same as that used by the import function in the web interface. A sample file can be obtained from the web interface. This is a CSV file, with the following headings: Term Set Name,Term Set Description,LCID,Available for Tagging,Term Description,Level 1 Term,Level 2 Term,Level 3 Term,Level 4 Term,Level 5 Term,Level 6 Term,Level 7 Term The first data row must contain the Term Set Name, Term Set Description, and LCID, and should also contain the first term. It is recommended that a fixed GUID be used as the termSetId, to allow the term set to be easily updated (so do not pass Guid.Empty). In contrast to the web interface import, this is not a one-off import but runs synchronisation logic allowing updating of an existing Term Set. When synchronising, any existing terms are matched (with Term Description and Available for Tagging updated as necessary), any new terms are added in the correct place in the hierarchy, and (if synchroniseDeletions is set) any terms not in the imported file are removed. The import file also supports an expanded syntax for the Term Set Name and term names (Level 1 Term, Level 2 Term, etc). These columns support values with the format "Name|GUID", with the name and GUID separated by a pipe character (note that the pipe character is invalid to use within a taxomony item name). This expanded syntax is not required, but can be used to ensure all terms have fixed IDs. Imports terms from a term set file, updating with any new terms, in the same format at that used by the web interface import ability.

Parameters

termGroup: Group to create the term set within

filePath: Local path to the file to import

termSetId: GUID to use for the term set; if Guid.Empty is passed then a random GUID is generated and used

synchroniseDeletions: (Optional) Whether to also synchronise deletions; that is, remove any terms not in the import file; default is no (false)

termSetIsOpen: (Optional) Whether the term set should be marked open; if not passed, then the existing setting is not changed

termSetContact: (Optional) Contact for the term set; if not provided, the existing setting is retained

termSetOwner: (Optional) Owner for the term set; if not provided, the existing setting is retained

Return value

The created, or updated, term set

ImportTermSet(Microsoft.SharePoint.Client.Taxonomy.TermGroup,System.IO.Stream,System.Guid,System.Boolean,System.Nullable{System.Boolean},System.String,System.String)

The format of the file is the same as that used by the import function in the web interface. A sample file can be obtained from the web interface. This is a CSV file, with the following headings: Term Set Name,Term Set Description,LCID,Available for Tagging,Term Description,Level 1 Term,Level 2 Term,Level 3 Term,Level 4 Term,Level 5 Term,Level 6 Term,Level 7 Term The first data row must contain the Term Set Name, Term Set Description, and LCID, and should also contain the first term. It is recommended that a fixed GUID be used as the termSetId, to allow the term set to be easily updated (so do not pass Guid.Empty). In contrast to the web interface import, this is not a one-off import but runs synchronisation logic allowing updating of an existing Term Set. When synchronising, any existing terms are matched (with Term Description and Available for Tagging updated as necessary), any new terms are added in the correct place in the hierarchy, and (if synchroniseDeletions is set) any terms not in the imported file are removed. The import file also supports an expanded syntax for the Term Set Name and term names (Level 1 Term, Level 2 Term, etc). These columns support values with the format "Name|GUID", with the name and GUID separated by a pipe character (note that the pipe character is invalid to use within a taxomony item name). This expanded syntax is not required, but can be used to ensure all terms have fixed IDs. Imports terms from a term set stream, updating with any new terms, in the same format at that used by the web interface import ability.

Parameters

termGroup: Group to create the term set within

termSetData: Stream containing the data to import

termSetId: GUID to use for the term set; if Guid.Empty is passed then a random GUID is generated and used

synchroniseDeletions: (Optional) Whether to also synchronise deletions; that is, remove any terms not in the import file; default is no (false)

termSetIsOpen: (Optional) Whether the term set should be marked open; if not passed, then the existing setting is not changed

termSetContact: (Optional) Contact for the term set; if not provided, the existing setting is retained

termSetOwner: (Optional) Owner for the term set; if not provided, the existing setting is retained

Return value

The created, or updated, term set

ExportTermSet(Microsoft.SharePoint.Client.Site,System.Guid,System.Boolean,System.String)

Exports the full list of terms from all termsets in all termstores.

Parameters

site: The site to process

termSetId: The ID of the termset to export

includeId: if true, Ids of the the taxonomy items will be included

delimiter: if specified, this delimiter will be used. Notice that IDs will be delimited with ;# from the label

Return value

ExportTermSet(Microsoft.SharePoint.Client.Site,System.Guid,System.Boolean,Microsoft.SharePoint.Client.Taxonomy.TermStore,System.String)

Exports the full list of terms from all termsets in all termstores.

Parameters

site: The site to export the termsets from

termSetId: The ID of the termset to export

includeId: if true, Ids of the the taxonomy items will be included

termStore: The term store to export the termset from

delimiter: if specified, this delimiter will be used. Notice that IDs will be delimited with ;# from the label

Return value

ExportAllTerms(Microsoft.SharePoint.Client.Site,System.Boolean,System.String)

Exports the full list of terms from all termsets in all termstores.

Parameters

site: The site to process

includeId: if true, Ids of the the taxonomy items will be included

delimiter: if specified, this delimiter will be used. Notice that IDs will be delimited with ;# from the label

Return value

GetTaxonomyItemByPath(Microsoft.SharePoint.Client.Site,System.String,System.String)

Returns a taxonomy item by it's path, e.g. Group|Set|Term

Parameters

site: The current site

path: The path of the item to return

delimiter: The delimeter separating groups, sets and term in the path. Defaults to |

Return value

SetTaxonomyFieldValueByTermPath(Microsoft.SharePoint.Client.ListItem,System.String,System.Guid)

Sets a value in a taxonomy field

Parameters

item: The item to set the value to

TermPath: The path of the term in the shape of "TermGroupName|TermSetName|TermName"

fieldId: The id of the field

Exceptions

System.Collections.Generic.KeyNotFoundException:

SetTaxonomyFieldValue(Microsoft.SharePoint.Client.ListItem,System.Guid,System.String,System.Guid)

Sets a value of a taxonomy field

Parameters

item: The item to process

fieldId: The ID of the field to set

label: The label of the term to set

termGuid: The id of the term to set

SetTaxonomyFieldValues(Microsoft.SharePoint.Client.ListItem,System.Guid,System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.Guid,System.String}})

Sets a value of a taxonomy field that supports multiple values

Parameters

item: The item to process

fieldId: The ID of the field to set

termValues: The key and values of terms to set

CreateTaxonomyField(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.Entities.TaxonomyFieldCreationInformation)

Can be used to create taxonomy field remotely to web.

Parameters

web: Site to be processed - can be root web or sub site

fieldCreationInformation: Creation Information of the field

Return value

New taxonomy field

RemoveTaxonomyFieldByInternalName(Microsoft.SharePoint.Client.Web,System.String)

Removes a taxonomy field (site column) and its associated hidden field by internal name

Parameters

web: Web object were the field (site column) exists

internalName: Internal name of the taxonomy field (site column) to be removed

RemoveTaxonomyFieldById(Microsoft.SharePoint.Client.Web,System.Guid)

Removes a taxonomy field (site column) and its associated hidden field by id

Parameters

web: Web object were the field (site column) exists

id: Guid representing the id of the taxonomy field (site column) to be removed

CreateTaxonomyField(Microsoft.SharePoint.Client.List,OfficeDevPnP.Core.Entities.TaxonomyFieldCreationInformation)

Can be used to create taxonomy field remotely in a list.

Parameters

list: List to be processed

fieldCreationInformation: Creation information of the field

Return value

New taxonomy field

WireUpTaxonomyField(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Field,System.String,System.String,System.Boolean)

Wires up MMS field to the specified term set.

Parameters

web: Site to be processed - can be root web or sub site

field: Field to be wired up

mmsGroupName: Taxonomy group

mmsTermSetName: Term set name

multiValue: If true, create a multivalue field

WireUpTaxonomyField(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Field,Microsoft.SharePoint.Client.Taxonomy.TermSet,System.Boolean)

Wires up MMS field to the specified term set.

Parameters

web: Site to be processed - can be root web or sub site

field: Field to be wired up

termSet: Taxonomy TermSet

multiValue: If true, create a multivalue field

WireUpTaxonomyField(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Field,Microsoft.SharePoint.Client.Taxonomy.Term,System.Boolean)

Wires up MMS field to the specified term.

Parameters

web: Site to be processed - can be root web or sub site

field: Field to be wired up

anchorTerm: Taxonomy Term

multiValue: If true, create a multivalue field

WireUpTaxonomyField(Microsoft.SharePoint.Client.Web,System.Guid,System.String,System.String,System.Boolean)

Wires up MMS field to the specified term set.

Parameters

web: Site to be processed - can be root web or sub site

id: Field ID to be wired up

mmsGroupName: Taxonomy group

mmsTermSetName: Term set name

multiValue: If true, create a multivalue field

WireUpTaxonomyField(Microsoft.SharePoint.Client.List,Microsoft.SharePoint.Client.Field,Microsoft.SharePoint.Client.Taxonomy.TermSet,System.Boolean)

Wires up MMS field to the specified term set.

Parameters

list: List to be processed

field: Field to be wired up

termSet: Taxonomy TermSet

multiValue: Term set name

WireUpTaxonomyField(Microsoft.SharePoint.Client.List,Microsoft.SharePoint.Client.Field,Microsoft.SharePoint.Client.Taxonomy.Term,System.Boolean)

Wires up MMS field to the specified term.

Parameters

list: List to be processed

field: Field to be wired up

anchorTerm: Taxonomy Term

multiValue: Allow multiple selection

WireUpTaxonomyField(Microsoft.SharePoint.Client.List,Microsoft.SharePoint.Client.Field,System.String,System.String,System.Boolean)

Wires up MMS field to the specified term set.

Parameters

list: List to be processed

field: Field to be wired up

mmsGroupName: Taxonomy group

mmsTermSetName: Term set name

multiValue: Allow multiple selection

WireUpTaxonomyField(Microsoft.SharePoint.Client.List,System.Guid,System.String,System.String,System.Boolean)

Wires up MMS field to the specified term set.

Parameters

list: List to be processed

id: Field ID to be wired up

mmsGroupName: Taxonomy group

mmsTermSetName: Term set name

multiValue: Allow multiple selection

WireUpTaxonomyFieldInternal(Microsoft.SharePoint.Client.Field,Microsoft.SharePoint.Client.Taxonomy.TaxonomyItem,System.Boolean)

Wires up MMS field to the specified term set or term.

Parameters

field: Field to be wired up

taxonomyItem: Taxonomy TermSet or Term

multiValue: Allow multiple selection

GetWssIdForTerm(Microsoft.SharePoint.Client.Web,Microsoft.SharePoint.Client.Taxonomy.Term)

Returns the Id for a term if present in the TaxonomyHiddenList. Otherwise returns -1;

Parameters

web:

term:

Return value

SetTaxonomyFieldDefaultValue(Microsoft.SharePoint.Client.Field,Microsoft.SharePoint.Client.Taxonomy.TaxonomyItem,System.String)

Sets the default value for a managed metadata field

Parameters

field: Field to be wired up

taxonomyItem: Taxonomy TermSet or Term

defaultValue: default value for the field

SharePoint.Client.TenantExtensions

Class for deprecated tenant extension methods

Methods

CreateSiteCollection(Microsoft.Online.SharePoint.TenantAdministration.Tenant,OfficeDevPnP.Core.Entities.SiteEntity,System.Boolean,System.Boolean)

Adds a SiteEntity by launching site collection creation and waits for the creation to finish

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

properties: Describes the site collection to be created

removeFromRecycleBin: It true and site is present in recycle bin, it will be removed first from the recycle bin

wait: If true, processing will halt until the site collection has been created

Return value

Guid of the created site collection and Guid.Empty is the wait parameter is specified as false

CreateSiteCollection(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.String,System.String,System.String,System.String,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.UInt32,System.Boolean,System.Boolean)

Launches a site collection creation and waits for the creation to finish

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

siteFullUrl: The SPO url

title: The site title

siteOwnerLogin: Owner account

template: Site template being used

storageMaximumLevel: Site quota in MB

storageWarningLevel: Site quota warning level in MB

timeZoneId: TimeZoneID for the site. "(UTC+01:00) Brussels, Copenhagen, Madrid, Paris" = 3

userCodeMaximumLevel: The user code quota in points

userCodeWarningLevel: The user code quota warning level in points

lcid: The site locale. See http://technet.microsoft.com/en-us/library/ff463597.aspx for a complete list of Lcid's

removeFromRecycleBin: If true, any existing site with the same URL will be removed from the recycle bin

wait: Wait for the site to be created before continuing processing

Return value

CheckIfSiteExists(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.String,System.String)

Returns if a site collection is in a particular status. If the url contains a sub site then returns true is the sub site exists, false if not. Status is irrelevant for sub sites

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

siteFullUrl: Url to the site collection

status: Status to check (Active, Creating, Recycled)

Return value

True if in status, false if not in status

IsSiteActive(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.String)

Checks if a site collection is Active

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

siteFullUrl: URL to the site collection

Return value

True if active, false if not

SiteExists(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.String)

Checks if a site collection exists, relies on tenant admin API. Sites that are recycled also return as existing sites

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

siteFullUrl: URL to the site collection

Return value

True if existing, false if not

SubSiteExists(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.String)

Checks if a sub site exists

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

siteFullUrl: URL to the sub site

Return value

True if existing, false if not

DeleteSiteCollection(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.String,System.Boolean)

Deletes a site collection

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

siteFullUrl: Url of the site collection to delete

useRecycleBin: Leave the deleted site collection in the site collection recycle bin

Return value

True if deleted

DeleteSiteCollectionFromRecycleBin(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.String,System.Boolean)

Deletes a site collection from the site collection recycle bin

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

siteFullUrl: URL of the site collection to delete

wait: If true, processing will halt until the site collection has been deleted from the recycle bin

Return value

True if deleted

GetSiteGuidByUrl(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.String)

Gets the ID of site collection with specified URL

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

siteFullUrl: A URL that specifies a site collection to get ID.

Return value

The Guid of a site collection

GetSiteGuidByUrl(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.Uri)

Gets the ID of site collection with specified URL

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

siteFullUrl: A URL that specifies a site collection to get ID.

Return value

The Guid of a site collection or an Guid.Empty if the Site does not exist

GetWebTemplates(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.UInt32,System.Int32)

Returns available webtemplates/site definitions

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

lcid:

compatibilityLevel: 14 for SharePoint 2010, 15 for SharePoint 2013/SharePoint Online

Return value

SetSiteProperties(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.String,System.String,System.Nullable{System.Boolean},System.Nullable{Microsoft.Online.SharePoint.TenantManagement.SharingCapabilities},System.Nullable{System.Int64},System.Nullable{System.Int64},System.Nullable{System.Double},System.Nullable{System.Double},System.Nullable{System.Boolean})

Sets tenant site Properties

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

siteFullUrl:

title:

allowSelfServiceUpgrade:

sharingCapability:

storageMaximumLevel:

storageWarningLevel:

userCodeMaximumLevel:

userCodeWarningLevel:

noScriptSite:

SetSiteLockState(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.String,OfficeDevPnP.Core.SiteLockState,System.Boolean)

Sets a site to Unlock access or NoAccess. This operation may occur immediately, but the site lock may take a short while before it goes into effect.

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site (i.e. https://[tenant]-admin.sharepoint.com)

siteFullUrl: The target site to change the lock state.

lockState: The target state the site should be changed to.

wait: If true, processing will halt until the site collection lock state has been implemented

AddAdministrators(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.Collections.Generic.IEnumerable{OfficeDevPnP.Core.Entities.UserEntity},System.Uri,System.Boolean)

Add a site collection administrator to a site collection

Parameters

tenant: A tenant object pointing to the context of a Tenant Administration site

adminLogins: Array of admins loginnames to add

siteUrl: Url of the site to operate on

addToOwnersGroup: Optionally the added admins can also be added to the Site owners group

GetSiteCollections(Microsoft.Online.SharePoint.TenantAdministration.Tenant,System.Int32,System.Int32,System.Boolean,System.Boolean)

Returns all site collections in the current Tenant based on a startIndex. IncludeDetail adds additional properties to the SPSite object.

Parameters

tenant: Tenant object to operate against

startIndex: Not relevant anymore

endIndex: Not relevant anymore

includeDetail: Option to return a limited set of data

Return value

An IList of SiteEntity objects

GetOneDriveSiteCollections(Microsoft.Online.SharePoint.TenantAdministration.Tenant)

Get OneDrive site collections by iterating through all user profiles.

Parameters

tenant:

Return value

List of objects containing site collection info.

GetUserProfileServiceClient(Microsoft.Online.SharePoint.TenantAdministration.Tenant)

Gets the UserProfileService proxy to enable calls to the UPA web service.

Parameters

tenant:

Return value

UserProfileService web service client

SharePoint.Client.WebExtensions

Class that holds deprecated methods for site (both site collection and web site) creation, status, retrieval and settings

Class that deals with site (both site collection and web site) creation, status, retrieval and settings

Methods

GetBaseTemplateId(Microsoft.SharePoint.Client.Web)

Returns the Base Template ID for the current web

Parameters

parentWeb: The parent Web (site) to get the base template from

Return value

The Base Template ID for the current web

CreateWeb(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.Entities.SiteEntity,System.Boolean,System.Boolean)

Adds a new child Web (site) to a parent Web.

Parameters

parentWeb: The parent Web (site) to create under

subsite: Details of the Web (site) to add. Only Title, Url (as the leaf URL), Description, Template and Language are used.

inheritPermissions: Specifies whether the new site will inherit permissions from its parent site.

inheritNavigation: Specifies whether the site inherits navigation.

Return value

CreateWeb(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String,System.String,System.Int32,System.Boolean,System.Boolean)

Adds a new child Web (site) to a parent Web.

Parameters

parentWeb: The parent Web (site) to create under

title: The title of the new site.

leafUrl: A string that represents the URL leaf name.

description: The description of the new site.

template: The name of the site template to be used for creating the new site.

language: The locale ID that specifies the language of the new site.

inheritPermissions: Specifies whether the new site will inherit permissions from its parent site.

inheritNavigation: Specifies whether the site inherits navigation.

DeleteWeb(Microsoft.SharePoint.Client.Web,System.String)

Deletes the child website with the specified leaf URL, from a parent Web, if it exists.

Parameters

parentWeb: The parent Web (site) to delete from

leafUrl: A string that represents the URL leaf name.

Return value

true if the web was deleted; otherwise false if nothing was done

GetAllWebUrls(Microsoft.SharePoint.Client.Site)

This is analagous to the SPSite.AllWebs property and can be used to get a collection of all web site URLs to loop through, e.g. for branding. Gets the collection of the URLs of all Web sites that are contained within the site collection, including the top-level site and its subsites.

Parameters

site: Site collection to retrieve the URLs for.

Return value

An enumeration containing the full URLs as strings.

GetWeb(Microsoft.SharePoint.Client.Web,System.String)

The ServerRelativeUrl property of the retrieved Web is instantiated. Returns the child Web site with the specified leaf URL.

Parameters

parentWeb: The Web site to check under

leafUrl: A string that represents the URL leaf name.

Return value

The requested Web, if it exists, otherwise null.

WebExists(Microsoft.SharePoint.Client.Web,System.String)

Determines if a child Web site with the specified leaf URL exists.

Parameters

parentWeb: The Web site to check under

leafUrl: A string that represents the URL leaf name.

Return value

true if the Web (site) exists; otherwise false

WebExistsFullUrl(Microsoft.SharePoint.Client.ClientRuntimeContext,System.String)

Determines if a Web (site) exists at the specified full URL, either accessible or that returns an access error.

Parameters

context: Existing context, used to provide credentials.

webFullUrl: Full URL of the site to check.

Return value

true if the Web (site) exists; otherwise false

WebExistsByTitle(Microsoft.SharePoint.Client.Web,System.String)

Determines if a web exists by title.

Parameters

title: Title of the web to check.

parentWeb: Parent web to check under.

Return value

True if a web with the given title exists.

IsSubSite(Microsoft.SharePoint.Client.Web)

Checks if the current web is a sub site or not

Parameters

web: Web to check

Return value

True is sub site, false otherwise

IsNoScriptSite(Microsoft.SharePoint.Client.Site)

Detects if the site in question has no script enabled or not. Detection is done by verifying if the AddAndCustomizePages permission is missing. See https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f for the effects of NoScript

Parameters

site: site to verify

Return value

True if noscript, false otherwise

IsNoScriptSite(Microsoft.SharePoint.Client.Web)

Detects if the site in question has no script enabled or not. Detection is done by verifying if the AddAndCustomizePages permission is missing. See https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f for the effects of NoScript

Parameters

web: Web to verify

Return value

True if noscript, false otherwise

GetAppInstances(Microsoft.SharePoint.Client.Web)

Returns all app instances

Parameters

web: The site to process

Return value

RemoveAppInstanceByTitle(Microsoft.SharePoint.Client.Web,System.String)

Removes the app instance with the specified title.

Parameters

web: Web to remove the app instance from

appTitle: Title of the app instance to remove

Return value

true if the the app instance was removed; false if it does not exist

InstallSolution(Microsoft.SharePoint.Client.Site,System.Guid,System.String,System.Int32,System.Int32)

Uploads and installs a sandbox solution package (.WSP) file, replacing existing solution if necessary.

Parameters

site: Site collection to install to

packageGuid: ID of the solution, from the solution manifest (required for the remove step)

sourceFilePath: Path to the sandbox solution package (.WSP) file

majorVersion: Optional major version of the solution, defaults to 1

minorVersion: Optional minor version of the solution, defaults to 0

UninstallSolution(Microsoft.SharePoint.Client.Site,System.Guid,System.String,System.Int32,System.Int32)

Uninstalls a sandbox solution package (.WSP) file

Parameters

site: Site collection to install to

packageGuid: ID of the solution, from the solution manifest

fileName: filename of the WSP file to uninstall

majorVersion: Optional major version of the solution, defaults to 1

minorVersion: Optional minor version of the solution, defaults to 0

MySiteSearch(Microsoft.SharePoint.Client.Web)

Returns all my site site collections

Parameters

web: Site to be processed - can be root web or sub site

Return value

All my site site collections

SiteSearch(Microsoft.SharePoint.Client.Web)

Returns all site collections that are indexed. In MT the search center, mysite host and contenttype hub are defined as non indexable by default and thus are not returned

Parameters

web: Site to be processed - can be root web or sub site

Return value

All site collections

SiteSearch(Microsoft.SharePoint.Client.Web,System.String,System.Boolean)

Returns the site collections that comply with the passed keyword query

Parameters

web: Site to be processed - can be root web or sub site

keywordQueryValue: Keyword query

trimDublicates: Indicates if dublicates should be trimmed or not

Return value

All found site collections

SiteSearchScopedByUrl(Microsoft.SharePoint.Client.Web,System.String)

Returns all site collection that start with the provided URL

Parameters

web: Site to be processed - can be root web or sub site

siteUrl: Base URL for which sites can be returned

Return value

All found site collections

SiteSearchScopedByTitle(Microsoft.SharePoint.Client.Web,System.String)

Returns all site collection that match with the provided title

Parameters

web: Site to be processed - can be root web or sub site

siteTitle: Title of the site to search for

Return value

All found site collections

ProcessQuery(Microsoft.SharePoint.Client.Web,System.String,System.Collections.Generic.List{OfficeDevPnP.Core.Entities.SiteEntity},Microsoft.SharePoint.Client.Search.Query.KeywordQuery,System.Int32)

Runs a query

Parameters

web: Site to be processed - can be root web or sub site

keywordQueryValue: keyword query

sites: sites variable that hold the resulting sites

keywordQuery: KeywordQuery object

startRow: Start row of the resultset to be returned

Return value

Total number of rows for the query

SetPropertyBagValue(Microsoft.SharePoint.Client.Web,System.String,System.Int32)

Sets a key/value pair in the web property bag

Parameters

web: Web that will hold the property bag entry

key: Key for the property bag entry

value: Integer value for the property bag entry

SetPropertyBagValue(Microsoft.SharePoint.Client.Web,System.String,System.String)

Sets a key/value pair in the web property bag

Parameters

web: Web that will hold the property bag entry

key: Key for the property bag entry

value: String value for the property bag entry

SetPropertyBagValue(Microsoft.SharePoint.Client.Web,System.String,System.DateTime)

Sets a key/value pair in the web property bag

Parameters

web: Web that will hold the property bag entry

key: Key for the property bag entry

value: Datetime value for the property bag entry

SetPropertyBagValueInternal(Microsoft.SharePoint.Client.Web,System.String,System.Object)

Sets a key/value pair in the web property bag

Parameters

web: Web that will hold the property bag entry

key: Key for the property bag entry

value: Value for the property bag entry

RemovePropertyBagValue(Microsoft.SharePoint.Client.Web,System.String)

Removes a property bag value from the property bag

Parameters

web: The site to process

key: The key to remove

RemovePropertyBagValueInternal(Microsoft.SharePoint.Client.Web,System.String,System.Boolean)

Removes a property bag value

Parameters

web: The web to process

key: They key to remove

checkIndexed:

GetPropertyBagValueInt(Microsoft.SharePoint.Client.Web,System.String,System.Int32)

Get int typed property bag value. If does not contain, returns default value.

Parameters

web: Web to read the property bag value from

key: Key of the property bag entry to return

defaultValue:

Return value

Value of the property bag entry as integer

GetPropertyBagValueDateTime(Microsoft.SharePoint.Client.Web,System.String,System.DateTime)

Get DateTime typed property bag value. If does not contain, returns default value.

Parameters

web: Web to read the property bag value from

key: Key of the property bag entry to return

defaultValue:

Return value

Value of the property bag entry as integer

GetPropertyBagValueString(Microsoft.SharePoint.Client.Web,System.String,System.String)

Get string typed property bag value. If does not contain, returns given default value.

Parameters

web: Web to read the property bag value from

key: Key of the property bag entry to return

defaultValue:

Return value

Value of the property bag entry as string

GetPropertyBagValueInternal(Microsoft.SharePoint.Client.Web,System.String)

Type independent implementation of the property getter.

Parameters

web: Web to read the property bag value from

key: Key of the property bag entry to return

Return value

Value of the property bag entry

PropertyBagContainsKey(Microsoft.SharePoint.Client.Web,System.String)

Checks if the given property bag entry exists

Parameters

web: Site to be processed - can be root web or sub site

key: Key of the property bag entry to check

Return value

True if the entry exists, false otherwise

GetEncodedValueForSearchIndexProperty(System.Collections.Generic.IEnumerable{System.String})

Used to convert the list of property keys is required format for listing keys to be index

Parameters

keys: list of keys to set to be searchable

Return value

string formatted list of keys in proper format

GetIndexedPropertyBagKeys(Microsoft.SharePoint.Client.Web)

Returns all keys in the property bag that have been marked for indexing

Parameters

web: The site to process

Return value

AddIndexedPropertyBagKey(Microsoft.SharePoint.Client.Web,System.String)

Marks a property bag key for indexing

Parameters

web: The web to process

key: The key to mark for indexing

Return value

Returns True if succeeded

RemoveIndexedPropertyBagKey(Microsoft.SharePoint.Client.Web,System.String)

Unmarks a property bag key for indexing

Parameters

web: The site to process

key: The key to unmark for indexed. Case-sensitive

Return value

Returns True if succeeded

ReIndexWeb(Microsoft.SharePoint.Client.Web)

Queues a web for a full crawl the next incremental crawl

Parameters

web: Site to be processed

AddRemoteEventReceiver(Microsoft.SharePoint.Client.Web,System.String,System.String,Microsoft.SharePoint.Client.EventReceiverType,Microsoft.SharePoint.Client.EventReceiverSynchronization,System.Boolean)

Registers a remote event receiver

Parameters

web: The web to process

name: The name of the event receiver (needs to be unique among the event receivers registered on this list)

url: The URL of the remote WCF service that handles the event

eventReceiverType:

synchronization:

force: If True any event already registered with the same name will be removed first.

Return value

Returns an EventReceiverDefinition if succeeded. Returns null if failed.

AddRemoteEventReceiver(Microsoft.SharePoint.Client.Web,System.String,System.String,Microsoft.SharePoint.Client.EventReceiverType,Microsoft.SharePoint.Client.EventReceiverSynchronization,System.Int32,System.Boolean)

Registers a remote event receiver

Parameters

web: The web to process

name: The name of the event receiver (needs to be unique among the event receivers registered on this list)

url: The URL of the remote WCF service that handles the event

eventReceiverType:

synchronization:

sequenceNumber:

force: If True any event already registered with the same name will be removed first.

Return value

Returns an EventReceiverDefinition if succeeded. Returns null if failed.

GetEventReceiverById(Microsoft.SharePoint.Client.Web,System.Guid)

Returns an event receiver definition

Parameters

web: Web to process

id:

Return value

GetEventReceiverByName(Microsoft.SharePoint.Client.Web,System.String)

Returns an event receiver definition

Parameters

web:

name:

Return value

SetLocalizationLabels(Microsoft.SharePoint.Client.Web,System.String,System.String,System.String)

Can be used to set translations for different cultures.

Parameters

web: Site to be processed - can be root web or sub site

cultureName: Culture name like en-us or fi-fi

titleResource: Localized Title string

descriptionResource: Localized Description string

Example
            web.SetLocalizationForSiteLabels("fi-fi", "Name of the site in Finnish", "Description in Finnish");

ApplyProvisioningTemplate(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.Framework.Provisioning.Model.ProvisioningTemplate,OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ProvisioningTemplateApplyingInformation)

Can be used to apply custom remote provisioning template on top of existing site.

Parameters

web:

template: ProvisioningTemplate with the settings to be applied

applyingInformation: Specified additional settings and or properties

GetProvisioningTemplate(Microsoft.SharePoint.Client.Web)

Can be used to extract custom provisioning template from existing site. The extracted template will be compared with the default base template.

Parameters

web: Web to get template from

Return value

ProvisioningTemplate object with generated values from existing site

GetProvisioningTemplate(Microsoft.SharePoint.Client.Web,OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers.ProvisioningTemplateCreationInformation)

Can be used to extract custom provisioning template from existing site. The extracted template will be compared with the default base template.

Parameters

web: Web to get template from

creationInfo: Specifies additional settings and/or properties

Return value

ProvisioningTemplate object with generated values from existing site

SetPageOutputCache(Microsoft.SharePoint.Client.Web,System.Boolean,System.Int32,System.Int32,System.Boolean)

Sets output cache on publishing web. The settings can be maintained from UI by visiting url /_layouts/15/sitecachesettings.aspx

Parameters

web: SharePoint web

enableOutputCache: Specify true to enable output cache. False otherwise.

anonymousCacheProfileId: Applies for anonymous users access for a site in Site Collection. Id of the profile specified in "Cache Profiles" list.

authenticatedCacheProfileId: Applies for authenticated users access for a site in the Site Collection. Id of the profile specified in "Cache Profiles" list.

debugCacheInformation: Specify true to enable the display of additional cache information on pages in this site collection. False otherwise.

DisableRequestAccess(Microsoft.SharePoint.Client.Web)

Disables the request access on the web.

Parameters

web: The web to disable request access.

EnableRequestAccess(Microsoft.SharePoint.Client.Web,System.String[])

En