Mathias Osterkamp

Specialist – focus development Microsoft technology stack

PnP Powershell 2019 Documentation

Backup of old PnP Documentation

PnP Powershell 2019 Documentation

Microsoft’s Patterns and Practices (PnP) initiative is a set of community-driven guidelines, practices, and libraries that aim to help developers build better solutions on the Microsoft 365 and SharePoint platforms. As part of the PnP initiative, PowerShell commands have been developed to simplify the management and automation of tasks within these ecosystems. This collection of PowerShell cmdlets is known as Microsoft PnP PowerShell. In this article, we’ll explore the documentation resources available for Microsoft PnP PowerShell, providing developers with a valuable guide to mastering this powerful toolset.

Here is a backup of the earlier documentation pertaining to SharePoint 2019. No warranty!

Refered to:

https://www.powershellgallery.com/packages/SharePointPnPPowerShell2019/3.6.1902.2

Sections
Add-PnPAlert
Add-PnPApp
Add-PnPApplicationCustomizer
Add-PnPClientSidePage
Add-PnPClientSidePageSection
Add-PnPClientSideText
Add-PnPClientSideWebPart
Add-PnPContentType
Add-PnPContentTypeToDocumentSet
Add-PnPContentTypeToList
Add-PnPCustomAction
Add-PnPDataRowsToProvisioningTemplate
Add-PnPDocumentSet
Add-PnPEventReceiver
Add-PnPField
Add-PnPFieldFromXml
Add-PnPFieldToContentType
Add-PnPFile
Add-PnPFileToProvisioningTemplate
Add-PnPFolder
Add-PnPHtmlPublishingPageLayout
Add-PnPHubSiteAssociation
Add-PnPIndexedProperty
Add-PnPJavaScriptBlock
Add-PnPJavaScriptLink
Add-PnPListFoldersToProvisioningTemplate
Add-PnPListItem
Add-PnPMasterPage
Add-PnPMicrosoft365GroupMember
Add-PnPMicrosoft365GroupToSite
Add-PnPNavigationNode
Add-PnPOffice365GroupToSite
Add-PnPOrgAssetsLibrary
Add-PnPOrgNewsSite
Add-PnPProvisioningTemplate
Add-PnPPublishingImageRendition
Add-PnPPublishingPage
Add-PnPPublishingPageLayout
Add-PnPRoleDefinition
Add-PnPSiteClassification
Add-PnPSiteCollectionAdmin
Add-PnPSiteCollectionAppCatalog
Add-PnPSiteDesign
Add-PnPSiteDesignTask
Add-PnPSiteScript
Add-PnPStoredCredential
Add-PnPTaxonomyField
Add-PnPTeamsChannel
Add-PnPTeamsTab
Add-PnPTeamsTeam
Add-PnPTeamsUser
Add-PnPTenantCdnOrigin
Add-PnPTenantSequence
Add-PnPTenantSequenceSite
Add-PnPTenantSequenceSubSite
Add-PnPTenantTheme
Add-PnPUserToGroup
Add-PnPView
Add-PnPWebhookSubscription
Add-PnPWebPartToWebPartPage
Add-PnPWebPartToWikiPage
Add-PnPWikiPage
Add-PnPWorkflowDefinition
Add-PnPWorkflowSubscription
Apply-PnPProvisioningTemplate
Apply-PnPTenantTemplate
Approve-PnPTenantServicePrincipalPermissionRequest
Clear-PnPDefaultColumnValues
Clear-PnPListItemAsRecord
Clear-PnPMicrosoft365GroupMember
Clear-PnPMicrosoft365GroupOwner
Clear-PnpRecycleBinItem
Clear-PnPTenantAppCatalogUrl
Clear-PnPTenantRecycleBinItem
Connect-PnPMicrosoftGraph
Connect-PnPOnline
Convert-PnPFolderToProvisioningTemplate
Convert-PnPProvisioningTemplate
ConvertTo-PnPClientSidePage
Copy-PnPFile
Copy-PnPItemProxy
Deny-PnPTenantServicePrincipalPermissionRequest
Disable-PnPFeature
Disable-PnPInPlaceRecordsManagementForSite
Disable-PnPPowerShellTelemetry
Disable-PnPResponsiveUI
Disable-PnPSharingForNonOwnersOfSite
Disable-PnPSiteClassification
Disable-PnPTenantServicePrincipal
Disconnect-PnPOnline
Enable-PnPCommSite
Enable-PnPFeature
Enable-PnPInPlaceRecordsManagementForSite
Enable-PnPPowerShellTelemetry
Enable-PnPResponsiveUI
Enable-PnPSiteClassification
Enable-PnPTenantServicePrincipal
Export-PnPClientSidePage
Export-PnPClientSidePageMapping
Export-PnPListToProvisioningTemplate
Export-PnPTaxonomy
Export-PnPTermGroupToXml
Find-PnPFile
Get-PnPAADUser
Get-PnPAccessToken
Get-PnPAlert
Get-PnPApp
Get-PnPAppAuthAccessToken
Get-PnPAppInstance
Get-PnPApplicationCustomizer
Get-PnPAuditing
Get-PnPAuthenticationRealm
Get-PnPAvailableClientSideComponents
Get-PnPAvailableLanguage
Get-PnPAzureADManifestKeyCredentials
Get-PnPAzureCertificate
Get-PnPClientSideComponent
Get-PnPClientSidePage
Get-PnPConnection
Get-PnPContentType
Get-PnPContentTypePublishingHubUrl
Get-PnPContext
Get-PnPCustomAction
Get-PnPDefaultColumnValues
Get-PnPDeletedMicrosoft365Group
Get-PnPDeletedUnifiedGroup
Get-PnPDocumentSetTemplate
Get-PnPEventReceiver
Get-PnPException
Get-PnPFeature
Get-PnPField
Get-PnPFile
Get-PnPFileVersion
Get-PnPFolder
Get-PnPFolderItem
Get-PnPFooter
Get-PnPGraphAccessToken
Get-PnPGraphSubscription
Get-PnPGroup
Get-PnPGroupMembers
Get-PnPGroupPermissions
Get-PnPHealthScore
Get-PnPHideDefaultThemes
Get-PnPHomePage
Get-PnPHomeSite
Get-PnPHubSite
Get-PnPHubSiteChild
Get-PnPIndexedPropertyKeys
Get-PnPInPlaceRecordsManagement
Get-PnPIsSiteAliasAvailable
Get-PnPJavaScriptLink
Get-PnPKnowledgeHubSite
Get-PnPLabel
Get-PnPList
Get-PnPListInformationRightsManagement
Get-PnPListItem
Get-PnPListRecordDeclaration
Get-PnPManagementApiAccessToken
Get-PnPMasterPage
Get-PnPMicrosoft365Group
Get-PnPMicrosoft365GroupMembers
Get-PnPMicrosoft365GroupOwners
Get-PnPNavigationNode
Get-PnPOffice365CurrentServiceStatus
Get-PnPOffice365HistoricalServiceStatus
Get-PnPOffice365ServiceMessage
Get-PnPOffice365Services
Get-PnPOfficeManagementApiAccessToken
Get-PnPOrgAssetsLibrary
Get-PnPOrgNewsSite
Get-PnPPowerShellTelemetryEnabled
Get-PnPProperty
Get-PnPPropertyBag
Get-PnPProvisioningTemplate
Get-PnPProvisioningTemplateFromGallery
Get-PnPPublishingImageRendition
Get-PnPRecycleBinItem
Get-PnPRequestAccessEmails
Get-PnPRoleDefinition
Get-PnPSearchConfiguration
Get-PnPSearchCrawlLog
Get-PnPSearchSettings
Get-PnPSharingForNonOwnersOfSite
Get-PnPSite
Get-PnPSiteClassification
Get-PnPSiteClosure
Get-PnPSiteCollectionAdmin
Get-PnPSiteCollectionTermStore
Get-PnPSiteDesign
Get-PnPSiteDesignRights
Get-PnPSiteDesignRun
Get-PnPSiteDesignRunStatus
Get-PnPSiteDesignTask
Get-PnPSitePolicy
Get-PnPSiteScript
Get-PnPSiteScriptFromList
Get-PnPSiteScriptFromWeb
Get-PnPSiteSearchQueryResults
Get-PnPStorageEntity
Get-PnPStoredCredential
Get-PnPSubWebs
Get-PnPTaxonomyItem
Get-PnPTaxonomySession
Get-PnPTeamsApp
Get-PnPTeamsChannel
Get-PnPTeamsChannelMessage
Get-PnPTeamsTab
Get-PnPTeamsTeam
Get-PnPTeamsUser
Get-PnPTenant
Get-PnPTenantAppCatalogUrl
Get-PnPTenantCdnEnabled
Get-PnPTenantCdnOrigin
Get-PnPTenantCdnPolicies
Get-PnPTenantId
Get-PnPTenantRecycleBinItem
Get-PnPTenantSequence
Get-PnPTenantSequenceSite
Get-PnPTenantServicePrincipal
Get-PnPTenantServicePrincipalPermissionGrants
Get-PnPTenantServicePrincipalPermissionRequests
Get-PnPTenantSite
Get-PnPTenantSyncClientRestriction
Get-PnPTenantTemplate
Get-PnPTenantTheme
Get-PnPTerm
Get-PnPTermGroup
Get-PnPTermSet
Get-PnPTheme
Get-PnPTimeZoneId
Get-PnPUnifiedAuditLog
Get-PnPUnifiedGroup
Get-PnPUnifiedGroupMembers
Get-PnPUnifiedGroupOwners
Get-PnPUPABulkImportStatus
Get-PnPUser
Get-PnPUserOneDriveQuota
Get-PnPUserProfileProperty
Get-PnPView
Get-PnPWeb
Get-PnPWebhookSubscriptions
Get-PnPWebPart
Get-PnPWebPartProperty
Get-PnPWebPartXml
Get-PnPWebTemplates
Get-PnPWikiPageContent
Get-PnPWorkflowDefinition
Get-PnPWorkflowInstance
Get-PnPWorkflowSubscription
Grant-PnPHubSiteRights
Grant-PnPSiteDesignRights
Grant-PnPTenantServicePrincipalPermission
header.png
Import-PnPAppPackage
Import-PnPTaxonomy
Import-PnPTermGroupFromXml
Import-PnPTermSet
Initialize-PnPPowerShellAuthentication
Install-PnPApp
Install-PnPSolution
Invoke-PnPQuery
Invoke-PnPSiteDesign
Invoke-PnPSPRestMethod
Invoke-PnPWebAction
Measure-PnPList
Measure-PnPResponseTime
Measure-PnPWeb
Move-PnPClientSideComponent
Move-PnPFile
Move-PnPFolder
Move-PnPItemProxy
Move-PnPListItemToRecycleBin
Move-PnpRecycleBinItem
New-PnPAzureCertificate
New-PnPExtensibilityHandlerObject
New-PnPGraphSubscription
New-PnPGroup
New-PnPList
New-PnPMicrosoft365Group
New-PnPPersonalSite
New-PnPProvisioningTemplate
New-PnPProvisioningTemplateFromFolder
New-PnPSite
New-PnPTeamsApp
New-PnPTeamsTeam
New-PnPTenantSequence
New-PnPTenantSequenceCommunicationSite
New-PnPTenantSequenceTeamNoGroupSite
New-PnPTenantSequenceTeamNoGroupSubSite
New-PnPTenantSequenceTeamSite
New-PnPTenantSite
New-PnPTenantTemplate
New-PnPTerm
New-PnPTermGroup
New-PnPTermLabel
New-PnPTermSet
New-PnPUnifiedGroup
New-PnPUPABulkImportJob
New-PnPUser
New-PnPWeb
Publish-PnPApp
Read-PnPProvisioningTemplate
Read-PnPTenantTemplate
Register-PnPAppCatalogSite
Register-PnPHubSite
Remove-PnPAlert
Remove-PnPApp
Remove-PnPApplicationCustomizer
Remove-PnPClientSideComponent
Remove-PnPClientSidePage
Remove-PnPContentType
Remove-PnPContentTypeFromDocumentSet
Remove-PnPContentTypeFromList
Remove-PnPCustomAction
Remove-PnPDeletedMicrosoft365Group
Remove-PnPDeletedUnifiedGroup
Remove-PnPEventReceiver
Remove-PnPField
Remove-PnPFieldFromContentType
Remove-PnPFile
Remove-PnPFileFromProvisioningTemplate
Remove-PnPFileVersion
Remove-PnPFolder
Remove-PnPGraphSubscription
Remove-PnPGroup
Remove-PnPHomeSite
Remove-PnPHubSiteAssociation
Remove-PnPIndexedProperty
Remove-PnPJavaScriptLink
Remove-PnPKnowledgeHubSite
Remove-PnPList
Remove-PnPListItem
Remove-PnPMicrosoft365Group
Remove-PnPMicrosoft365GroupMember
Remove-PnPMicrosoft365GroupOwner
Remove-PnPNavigationNode
Remove-PnPOrgAssetsLibrary
Remove-PnPOrgNewsSite
Remove-PnPPropertyBagValue
Remove-PnPPublishingImageRendition
Remove-PnPRoleDefinition
Remove-PnPSearchConfiguration
Remove-PnPSiteClassification
Remove-PnPSiteCollectionAdmin
Remove-PnPSiteCollectionAppCatalog
Remove-PnPSiteDesign
Remove-PnPSiteDesignTask
Remove-PnPSiteScript
Remove-PnPStorageEntity
Remove-PnPStoredCredential
Remove-PnPTaxonomyItem
Remove-PnPTeamsApp
Remove-PnPTeamsChannel
Remove-PnPTeamsTab
Remove-PnPTeamsTeam
Remove-PnPTeamsUser
Remove-PnPTenantCdnOrigin
Remove-PnPTenantSite
Remove-PnPTenantTheme
Remove-PnPTermGroup
Remove-PnPUnifiedGroup
Remove-PnPUser
Remove-PnPUserFromGroup
Remove-PnPView
Remove-PnPWeb
Remove-PnPWebhookSubscription
Remove-PnPWebPart
Remove-PnPWikiPage
Remove-PnPWorkflowDefinition
Remove-PnPWorkflowSubscription
Rename-PnPFile
Rename-PnPFolder
Request-PnPAccessToken
Request-PnPReIndexList
Request-PnPReIndexWeb
Reset-PnPFileVersion
Reset-PnPLabel
Reset-PnPMicrosoft365GroupExpiration
Reset-PnPUserOneDriveQuotaToDefault
Resolve-PnPFolder
Restore-PnPDeletedMicrosoft365Group
Restore-PnPDeletedUnifiedGroup
Restore-PnPFileVersion
Restore-PnpRecycleBinItem
Restore-PnPTenantRecycleBinItem
Resume-PnPWorkflowInstance
Revoke-PnPHubSiteRights
Revoke-PnPSiteDesignRights
Revoke-PnPTenantServicePrincipalPermission
Save-PnPClientSidePageConversionLog
Save-PnPProvisioningTemplate
Save-PnPTenantTemplate
Send-PnPMail
Set-PnPApplicationCustomizer
Set-PnPAppSideLoading
Set-PnPAuditing
Set-PnPAvailablePageLayouts
Set-PnPClientSidePage
Set-PnPClientSideText
Set-PnPClientSideWebPart
Set-PnPContext
Set-PnPDefaultColumnValues
Set-PnPDefaultContentTypeToList
Set-PnPDefaultPageLayout
Set-PnPDocumentSetField
Set-PnPField
Set-PnPFileCheckedIn
Set-PnPFileCheckedOut
Set-PnPFolderPermission
Set-PnPFooter
Set-PnPGraphSubscription
Set-PnPGroup
Set-PnPGroupPermissions
Set-PnPHideDefaultThemes
Set-PnPHomePage
Set-PnPHomeSite
Set-PnPHubSite
Set-PnPIndexedProperties
Set-PnPInPlaceRecordsManagement
Set-PnPKnowledgeHubSite
Set-PnPLabel
Set-PnPList
Set-PnPListInformationRightsManagement
Set-PnPListItem
Set-PnPListItemAsRecord
Set-PnPListItemPermission
Set-PnPListPermission
Set-PnPListRecordDeclaration
Set-PnPMasterPage
Set-PnPMicrosoft365Group
Set-PnPMinimalDownloadStrategy
Set-PnPPropertyBagValue
Set-PnPProvisioningTemplateMetadata
Set-PnPRequestAccessEmails
Set-PnPSearchConfiguration
Set-PnPSearchSettings
Set-PnPSite
Set-PnPSiteClosure
Set-PnPSiteDesign
Set-PnPSitePolicy
Set-PnPSiteScript
Set-PnPStorageEntity
Set-PnPTaxonomyFieldValue
Set-PnPTeamsChannel
Set-PnPTeamsTab
Set-PnPTeamsTeam
Set-PnPTeamsTeamArchivedState
Set-PnPTeamsTeamPicture
Set-PnPTenant
Set-PnPTenantAppCatalogUrl
Set-PnPTenantCdnEnabled
Set-PnPTenantCdnPolicy
Set-PnPTenantSite
Set-PnPTenantSyncClientRestriction
Set-PnPTheme
Set-PnPTraceLog
Set-PnPUnifiedGroup
Set-PnPUserOneDriveQuota
Set-PnPUserProfileProperty
Set-PnPView
Set-PnPWeb
Set-PnPWebhookSubscription
Set-PnPWebPartProperty
Set-PnPWebPermission
Set-PnPWebTheme
Set-PnPWikiPageContent
Start-PnPWorkflowInstance
Stop-PnPWorkflowInstance
Submit-PnPSearchQuery
Submit-PnPTeamsChannelMessage
Sync-PnPAppToTeams
Test-PnPListItemIsRecord
Test-PnPOffice365GroupAliasIsUsed
Test-PnPTenantTemplate
Uninstall-PnPApp
Uninstall-PnPAppInstance
Uninstall-PnPSolution
Unpublish-PnPApp
Unregister-PnPHubSite
Update-PnPApp
Update-PnPSiteClassification
Update-PnPTeamsApp

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Add-PnPAlert

SYNOPSIS

Adds an alert for a user to a list

SYNTAX

Add-PnPAlert -List <ListPipeBind>
             [-Title <String>]
             [-User <UserPipeBind>]
             [-DeliveryMethod <AlertDeliveryChannel>]
             [-ChangeType <AlertEventType>]
             [-Frequency <AlertFrequency>]
             [-Filter <AlertFilter>]
             [-Time <DateTime>]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPAlert -List "Demo List"

Adds a new alert to the “Demo List” for the current user.

——————EXAMPLE 2——————

Add-PnPAlert -Title "Daily summary" -List "Demo List" -Frequency Daily -ChangeType All -Time (Get-Date -Hour 11 -Minute 00 -Second 00)

Adds a daily alert for the current user at the given time to the “Demo List”. Note: a timezone offset might be applied so please verify on your tenant that the alert indeed got the right time.

——————EXAMPLE 3——————

Add-PnPAlert -Title "Alert for user" -List "Demo List" -User "i:0#.f|membership|Alice@contoso.onmicrosoft.com"

Adds a new alert for user “Alice” to the “Demo List”. Note: Only site owners and admins are permitted to set alerts for other users.

PARAMETERS

-ChangeType

Alert change type

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AlertEventType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DeliveryMethod

Alert delivery method

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AlertDeliveryChannel
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Filter

Alert filter

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AlertFilter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Frequency

Alert frequency

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AlertFrequency
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

The ID, Title or Url of the list.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Time

Alert time (if frequency is not immediate)

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: DateTime
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

Alert title

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-User

User to create the alert for (User ID, login name or actual User object). Skip this parameter to create an alert for the current user. Note: Only site owners can create alerts for other users.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: UserPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.AlertCreationInformation

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Add-PnPApp

SYNOPSIS

Add/uploads an available app to the app catalog

SYNTAX

Add only

Add-PnPApp -Path <String>
           [-Scope <AppCatalogScope>]
           [-Overwrite [<SwitchParameter>]]
           [-Timeout <Int>]
           [-Connection <PnPConnection>]

Add and Publish

Add-PnPApp -Path <String>
           -Publish [<SwitchParameter>]
           [-SkipFeatureDeployment [<SwitchParameter>]]
           [-Scope <AppCatalogScope>]
           [-Overwrite [<SwitchParameter>]]
           [-Timeout <Int>]
           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPApp -Path ./myapp.sppkg

This will upload the specified app package to the app catalog

——————EXAMPLE 2——————

Add-PnPApp -Path ./myapp.sppkg -Publish

This will upload the specified app package to the app catalog and deploy/trust it at the same time.

——————EXAMPLE 3——————

Add-PnPApp -Path ./myapp.sppkg -Scope Site -Publish

This will upload the specified app package to the site collection app catalog and deploy/trust it at the same time.

PARAMETERS

-Overwrite

Overwrites the existing app package if it already exists

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Path

Specifies the Id or an actual app metadata instance

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: Add only, Add and Publish

Required: True
Position: 0
Accept pipeline input: True

-Publish

This will deploy/trust an app into the app catalog

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: Add and Publish

Required: True
Position: Named
Accept pipeline input: False

-Scope

Defines which app catalog to use. Defaults to Tenant

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppCatalogScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SkipFeatureDeployment

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: Add and Publish

Required: False
Position: Named
Accept pipeline input: False

-Timeout

Specifies the timeout in seconds. Defaults to 200.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

OfficeDevPnP.Core.ALM.AppMetadata

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Add-PnPApplicationCustomizer

SYNOPSIS

Adds a SharePoint Framework client side extension application customizer

SYNTAX

Add-PnPApplicationCustomizer -ClientSideComponentId <GuidPipeBind>
                             [-Title <String>]
                             [-Description <String>]
                             [-Sequence <Int>]
                             [-Scope <CustomActionScope>]
                             [-ClientSideComponentProperties <String>]
                             [-ClientSideHostProperties <String>]
                             [-Web <WebPipeBind>]
                             [-Connection <PnPConnection>]

DESCRIPTION

Adds a SharePoint Framework client side extension application customizer by registering a user custom action to a web or sitecollection

EXAMPLES

——————EXAMPLE 1——————

Add-PnPApplicationCustomizer -Title "CollabFooter" -ClientSideComponentId c0ab3b94-8609-40cf-861e-2a1759170b43 -ClientSideComponentProperties "{`"sourceTermSet`":`"PnP-CollabFooter-SharedLinks`",`"personalItemsStorageProperty`":`"PnP-CollabFooter-MyLinks`"}

Adds a new application customizer to the current web. This requires that a SharePoint Framework solution has been deployed containing the application customizer specified in its manifest. Be sure to run Install-PnPApp before trying this cmdlet on a site.

PARAMETERS

-ClientSideComponentId

The Client Side Component Id of the SharePoint Framework client side extension application customizer found in the manifest

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: GuidPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ClientSideComponentProperties

The Client Side Component Properties of the application customizer. Specify values as a json string : “{Property1 : ‘Value1’, Property2: ‘Value2’}”

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ClientSideHostProperties

The Client Side Host Properties of the application customizer. Specify values as a json string : “{‘preAllocatedApplicationCustomizerTopHeight’: ‘50’, ‘preAllocatedApplicationCustomizerBottomHeight’: ‘50’}”

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The description of the application customizer

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Scope

The scope of the CustomAction to add to. Either Web or Site; defaults to Web. ‘All’ is not valid for this command.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: CustomActionScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Sequence

Sequence of this application customizer being injected. Use when you have a specific sequence with which to have multiple application customizers being added to the page.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

The title of the application customizer

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Add-PnPClientSidePage

SYNOPSIS

Adds a Client-Side Page

SYNTAX

Add-PnPClientSidePage -Name <String>
                      [-LayoutType <ClientSidePageLayoutType>]
                      [-PromoteAs <ClientSidePagePromoteType>]
                      [-ContentType <ContentTypePipeBind>]
                      [-CommentsEnabled [<SwitchParameter>]]
                      [-Publish [<SwitchParameter>]]
                      [-HeaderLayoutType <ClientSidePageHeaderLayoutType>]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPClientSidePage -Name "NewPage"

Creates a new Client-Side page named ‘NewPage’

——————EXAMPLE 2——————

Add-PnPClientSidePage -Name "NewPage" -ContentType "MyPageContentType"

Creates a new Client-Side page named ‘NewPage’ and sets the content type to the content type specified

——————EXAMPLE 3——————

Add-PnPClientSidePage -Name "NewPageTemplate" -PromoteAs Template

Creates a new Client-Side page named ‘NewPage’ and saves as a template to the site.

——————EXAMPLE 4——————

Add-PnPClientSidePage -Name "Folder/NewPage"

Creates a new Client-Side page named ‘NewPage’ under ‘Folder’ folder and saves as a template to the site.

——————EXAMPLE 5——————

Add-PnPClientSidePage -Name "NewPage" -HeaderLayoutType ColorBlock

Creates a new Client-Side page named ‘NewPage’ using the ColorBlock header layout

PARAMETERS

-CommentsEnabled

Enables or Disables the comments on the page

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ContentType

Specify either the name, ID or an actual content type.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-HeaderLayoutType

Type of layout used for the header

Only applicable to: SharePoint Online

Type: ClientSidePageHeaderLayoutType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LayoutType

Specifies the layout type of the page.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePageLayoutType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Name

Specifies the name of the page.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-PromoteAs

Allows to promote the page for a specific purpose (HomePage | NewsPage)

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePromoteType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Publish

Publishes the page once it is saved. Applicable to libraries set to create major and minor versions.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Add-PnPClientSidePageSection

SYNOPSIS

Adds a new section to a Client-Side page

SYNTAX

Add-PnPClientSidePageSection -Page <ClientSidePagePipeBind>
                             -SectionTemplate <CanvasSectionTemplate>
                             [-Order <Int>]
                             [-ZoneEmphasis <Int>]
                             [-Web <WebPipeBind>]
                             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPClientSidePageSection -Page "MyPage" -SectionTemplate OneColumn

Adds a new one-column section to the Client-Side page ‘MyPage’

——————EXAMPLE 2——————

Add-PnPClientSidePageSection -Page "MyPage" -SectionTemplate ThreeColumn -Order 10

Adds a new Three columns section to the Client-Side page ‘MyPage’ with an order index of 10

——————EXAMPLE 3——————

$page = Add-PnPClientSidePage -Name "MyPage"
PS> Add-PnPClientSidePageSection -Page $page -SectionTemplate OneColumn

Adds a new one column section to the Client-Side page ‘MyPage’

——————EXAMPLE 4——————

$page = Add-PnPClientSidePage -Name "MyPage"
PS> Add-PnPClientSidePageSection -Page $page -SectionTemplate OneColumn -ZoneEmphasis 2

Adds a new one column section to the Client-Side page ‘MyPage’ and sets the background to 2 (0 is no background, 3 is highest emphasis)

PARAMETERS

-Order

Sets the order of the section. (Default = 1)

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Page

The name of the page

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-SectionTemplate

Specifies the columns template to use for the section.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: CanvasSectionTemplate
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ZoneEmphasis

Sets the background of the section (default = 0)

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Add-PnPClientSideText

SYNOPSIS

Adds a text element to a client-side page.

SYNTAX

Default

Add-PnPClientSideText -Page <ClientSidePagePipeBind>
                      -Text <String>
                      [-Order <Int>]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

Positioned

Add-PnPClientSideText -Page <ClientSidePagePipeBind>
                      -Text <String>
                      -Section <Int>
                      -Column <Int>
                      [-Order <Int>]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

DESCRIPTION

Adds a new text element to a section on a client-side page.

EXAMPLES

——————EXAMPLE 1——————

Add-PnPClientSideText -Page "MyPage" -Text "Hello World!"

Adds the text ‘Hello World!’ to the Client-Side Page ‘MyPage’

PARAMETERS

-Column

Sets the column where to insert the text control.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: Positioned

Required: True
Position: Named
Accept pipeline input: False

-Order

Sets the order of the text control. (Default = 1)

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: Default, Positioned

Required: False
Position: Named
Accept pipeline input: False

-Page

The name of the page.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePipeBind
Parameter Sets: Default, Positioned

Required: True
Position: 0
Accept pipeline input: True

-Section

Sets the section where to insert the text control.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: Positioned

Required: True
Position: Named
Accept pipeline input: False

-Text

Specifies the text to display in the text area.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: Default, Positioned

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Add-PnPClientSideWebPart

SYNOPSIS

Adds a Client-Side Web Part to a client-side page

SYNTAX

Default with built-in web part

Add-PnPClientSideWebPart -Page <ClientSidePagePipeBind>
                         -DefaultWebPartType <DefaultClientSideWebParts>
                         [-WebPartProperties <PropertyBagPipeBind>]
                         [-Order <Int>]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

Default with 3rd party web part

Add-PnPClientSideWebPart -Page <ClientSidePagePipeBind>
                         -Component <ClientSideComponentPipeBind>
                         [-WebPartProperties <PropertyBagPipeBind>]
                         [-Order <Int>]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

Positioned with built-in web part

Add-PnPClientSideWebPart -Page <ClientSidePagePipeBind>
                         -DefaultWebPartType <DefaultClientSideWebParts>
                         -Section <Int>
                         -Column <Int>
                         [-WebPartProperties <PropertyBagPipeBind>]
                         [-Order <Int>]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

Positioned with 3rd party web part

Add-PnPClientSideWebPart -Page <ClientSidePagePipeBind>
                         -Component <ClientSideComponentPipeBind>
                         -Section <Int>
                         -Column <Int>
                         [-WebPartProperties <PropertyBagPipeBind>]
                         [-Order <Int>]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

DESCRIPTION

Adds a client-side web part to an existing client-side page.

EXAMPLES

——————EXAMPLE 1——————

Add-PnPClientSideWebPart -Page "MyPage" -DefaultWebPartType BingMap

Adds a built-in Client-Side component ‘BingMap’ to the page called ‘MyPage’

——————EXAMPLE 2——————

Add-PnPClientSideWebPart -Page "MyPage" -Component "HelloWorld"

Adds a Client-Side component ‘HelloWorld’ to the page called ‘MyPage’

——————EXAMPLE 3——————

Add-PnPClientSideWebPart  -Page "MyPage" -Component "HelloWorld" -Section 1 -Column 2

Adds a Client-Side component ‘HelloWorld’ to the page called ‘MyPage’ in section 1 and column 2

PARAMETERS

-Column

Sets the column where to insert the web part control.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: Positioned with built-in web part, Positioned with 3rd party web part

Required: True
Position: Named
Accept pipeline input: False

-Component

Specifies the component instance or Id to add.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSideComponentPipeBind
Parameter Sets: Default with 3rd party web part, Positioned with 3rd party web part

Required: True
Position: Named
Accept pipeline input: False

-DefaultWebPartType

Defines a default web part type to insert.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: DefaultClientSideWebParts
Parameter Sets: Default with built-in web part, Positioned with built-in web part

Required: True
Position: Named
Accept pipeline input: False

-Order

Sets the order of the web part control. (Default = 1)

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: Default with built-in web part, Default with 3rd party web part, Positioned with built-in web part, Positioned with 3rd party web part

Required: False
Position: Named
Accept pipeline input: False

-Page

The name of the page.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePipeBind
Parameter Sets: Default with built-in web part, Default with 3rd party web part, Positioned with built-in web part, Positioned with 3rd party web part

Required: True
Position: 0
Accept pipeline input: True

-Section

Sets the section where to insert the web part control.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: Positioned with built-in web part, Positioned with 3rd party web part

Required: True
Position: Named
Accept pipeline input: False

-WebPartProperties

The properties of the web part

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PropertyBagPipeBind
Parameter Sets: Default with built-in web part, Default with 3rd party web part, Positioned with built-in web part, Positioned with 3rd party web part

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPContentType

SYNOPSIS

Adds a new content type

SYNTAX

Add-PnPContentType -Name <String>
                   [-ContentTypeId <String>]
                   [-Description <String>]
                   [-Group <String>]
                   [-ParentContentType <ContentType>]
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPContentType -Name "Project Document" -Description "Use for Contoso projects" -Group "Contoso Content Types" -ParentContentType $ct

This will add a new content type based on the parent content type stored in the $ct variable.

PARAMETERS

-ContentTypeId

If specified, in the format of 0x0100233af432334r434343f32f3, will create a content type with the specific ID

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

Specifies the description of the new content type

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Group

Specifies the group of the new content type

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Name

Specify the name of the new content type

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ParentContentType

Specifies the parent of the new content type

Type: ContentType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.ContentType

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPContentTypeToDocumentSet

SYNOPSIS

Adds a content type to a document set

SYNTAX

Add-PnPContentTypeToDocumentSet -ContentType <ContentTypePipeBind[]>
                                -DocumentSet <DocumentSetPipeBind>
                                [-Web <WebPipeBind>]
                                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPContentTypeToDocumentSet -ContentType "Test CT" -DocumentSet "Test Document Set"

This will add the content type called ‘Test CT’ to the document set called ‘‘Test Document Set’

——————EXAMPLE 2——————

$docset = Get-PnPDocumentSetTemplate -Identity "Test Document Set"
$ct = Get-PnPContentType -Identity "Test CT"
Add-PnPContentTypeToDocumentSet -ContentType $ct -DocumentSet $docset

This will add the content type called ‘Test CT’ to the document set called ‘‘Test Document Set’

——————EXAMPLE 3——————

Add-PnPContentTypeToDocumentSet -ContentType 0x0101001F1CEFF1D4126E4CAD10F00B6137E969 -DocumentSet 0x0120D520005DB65D094035A241BAC9AF083F825F3B

This will add the content type called ‘Test CT’ to the document set called ‘‘Test Document Set’

PARAMETERS

-ContentType

The content type object, name or id to add. Either specify name, an id, or a content type object.

Type: ContentTypePipeBind[]
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-DocumentSet

The document set object or id to add the content type to. Either specify a name, a document set template object, an id, or a content type object

Type: DocumentSetPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPContentTypeToList

SYNOPSIS

Adds a new content type to a list

SYNTAX

Add-PnPContentTypeToList -List <ListPipeBind>
                         -ContentType <ContentTypePipeBind>
                         [-DefaultContentType [<SwitchParameter>]]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPContentTypeToList -List "Documents" -ContentType "Project Document" -DefaultContentType

This will add an existing content type to a list and sets it as the default content type

PARAMETERS

-ContentType

Specifies the content type that needs to be added to the list

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-DefaultContentType

Specify if the content type needs to be the default content type or not

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

Specifies the list to which the content type needs to be added

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPCustomAction

SYNOPSIS

Adds a custom action

SYNTAX

Client Side Component Id

Add-PnPCustomAction -Name <String>
                    -Title <String>
                    -Location <String>
                    -ClientSideComponentId <GuidPipeBind>
                    [-Sequence <Int>]
                    [-RegistrationId <String>]
                    [-RegistrationType <UserCustomActionRegistrationType>]
                    [-Scope <CustomActionScope>]
                    [-ClientSideComponentProperties <String>]
                    [-ClientSideHostProperties <String>]
                    [-Web <WebPipeBind>]
                    [-Connection <PnPConnection>]

Default

Add-PnPCustomAction -Name <String>
                    -Title <String>
                    -Description <String>
                    -Group <String>
                    -Location <String>
                    [-Sequence <Int>]
                    [-Url <String>]
                    [-ImageUrl <String>]
                    [-CommandUIExtension <String>]
                    [-RegistrationId <String>]
                    [-Rights <PermissionKind[]>]
                    [-RegistrationType <UserCustomActionRegistrationType>]
                    [-Scope <CustomActionScope>]
                    [-Web <WebPipeBind>]
                    [-Connection <PnPConnection>]

DESCRIPTION

Adds a user custom action to a web or sitecollection.

EXAMPLES

——————EXAMPLE 1——————

$cUIExtn = "<CommandUIExtension><CommandUIDefinitions><CommandUIDefinition Location=""Ribbon.List.Share.Controls._children""><Button Id=""Ribbon.List.Share.GetItemsCountButton"" Alt=""Get list items count"" Sequence=""11"" Command=""Invoke_GetItemsCountButtonRequest"" LabelText=""Get Items Count"" TemplateAlias=""o1"" Image32by32=""_layouts/15/images/placeholder32x32.png"" Image16by16=""_layouts/15/images/placeholder16x16.png"" /></CommandUIDefinition></CommandUIDefinitions><CommandUIHandlers><CommandUIHandler Command=""Invoke_GetItemsCountButtonRequest"" CommandAction=""javascript: alert('Total items in this list: '+ ctx.TotalListItems);"" EnabledScript=""javascript: function checkEnable() { return (true);} checkEnable();""/></CommandUIHandlers></CommandUIExtension>"

Add-PnPCustomAction -Name 'GetItemsCount' -Title 'Invoke GetItemsCount Action' -Description 'Adds custom action to custom list ribbon' -Group 'SiteActions' -Location 'CommandUI.Ribbon' -CommandUIExtension $cUIExtn

Adds a new custom action to the custom list template, and sets the Title, Name and other fields with the specified values. On click it shows the number of items in that list. Notice: escape quotes in CommandUIExtension.

——————EXAMPLE 2——————

Add-PnPCustomAction -Title "CollabFooter" -Name "CollabFooter" -Location "ClientSideExtension.ApplicationCustomizer" -ClientSideComponentId c0ab3b94-8609-40cf-861e-2a1759170b43 -ClientSideComponentProperties "{`"sourceTermSet`":`"PnP-CollabFooter-SharedLinks`",`"personalItemsStorageProperty`":`"PnP-CollabFooter-MyLinks`"}

Adds a new application customizer to the site. This requires that an SPFX solution has been deployed containing the application customizer specified. Be sure to run Install-PnPApp before trying this cmdlet on a site.

PARAMETERS

-ClientSideComponentId

The Client Side Component Id of the custom action

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: GuidPipeBind
Parameter Sets: Client Side Component Id

Required: True
Position: Named
Accept pipeline input: False

-ClientSideComponentProperties

The Client Side Component Properties of the custom action. Specify values as a json string : “{Property1 : ‘Value1’, Property2: ‘Value2’}”

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: Client Side Component Id

Required: False
Position: Named
Accept pipeline input: False

-ClientSideHostProperties

The Client Side Host Properties of the custom action. Specify values as a json string : “{‘preAllocatedApplicationCustomizerTopHeight’: ‘50’, ‘preAllocatedApplicationCustomizerBottomHeight’: ‘50’}”

Only applicable to: SharePoint Online

Type: String
Parameter Sets: Client Side Component Id

Required: False
Position: Named
Accept pipeline input: False

-CommandUIExtension

XML fragment that determines user interface properties of the custom action

Type: String
Parameter Sets: Default

Required: False
Position: Named
Accept pipeline input: False

-Description

The description of the custom action

Type: String
Parameter Sets: Default

Required: True
Position: Named
Accept pipeline input: False

-Group

The group where this custom action needs to be added like ‘SiteActions’

Type: String
Parameter Sets: Default

Required: True
Position: Named
Accept pipeline input: False

-ImageUrl

The URL of the image associated with the custom action

Type: String
Parameter Sets: Default

Required: False
Position: Named
Accept pipeline input: False

-Location

The actual location where this custom action need to be added like ‘CommandUI.Ribbon’

Type: String
Parameter Sets: Default, Client Side Component Id

Required: True
Position: Named
Accept pipeline input: False

-Name

The name of the custom action

Type: String
Parameter Sets: Default, Client Side Component Id

Required: True
Position: Named
Accept pipeline input: False

-RegistrationId

The identifier of the object associated with the custom action.

Type: String
Parameter Sets: Default, Client Side Component Id

Required: False
Position: Named
Accept pipeline input: False

-RegistrationType

Specifies the type of object associated with the custom action

Type: UserCustomActionRegistrationType
Parameter Sets: Default, Client Side Component Id

Required: False
Position: Named
Accept pipeline input: False

-Rights

A string array that contain the permissions needed for the custom action

Type: PermissionKind[]
Parameter Sets: Default

Required: False
Position: Named
Accept pipeline input: False

-Scope

The scope of the CustomAction to add to. Either Web or Site; defaults to Web. ‘All’ is not valid for this command.

Type: CustomActionScope
Parameter Sets: Default, Client Side Component Id

Required: False
Position: Named
Accept pipeline input: False

-Sequence

Sequence of this CustomAction being injected. Use when you have a specific sequence with which to have multiple CustomActions being added to the page.

Type: Int
Parameter Sets: Default, Client Side Component Id

Required: False
Position: Named
Accept pipeline input: False

-Title

The title of the custom action

Type: String
Parameter Sets: Default, Client Side Component Id

Required: True
Position: Named
Accept pipeline input: False

-Url

The URL, URI or ECMAScript (JScript, JavaScript) function associated with the action

Type: String
Parameter Sets: Default

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and PracticesUserCustomActionBasePermissions

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPDataRowsToProvisioningTemplate

SYNOPSIS

Adds datarows to a list inside a PnP Provisioning Template

SYNTAX

Add-PnPDataRowsToProvisioningTemplate -Path <String>
                                      -List <ListPipeBind>
                                      [-Query <String>]
                                      [-Fields <String[]>]
                                      [-TokenizeUrls [<SwitchParameter>]]
                                      [-TemplateProviderExtensions <ITemplateProviderExtension[]>]
                                      [-IncludeSecurity [<SwitchParameter>]]
                                      [-Web <WebPipeBind>]
                                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPDataRowsToProvisioningTemplate -Path template.pnp -List 'PnPTestList' -Query '<View></View>' -Fields 'Title','Choice'

Adds datarows from the provided list to the PnP Provisioning Template at the provided location

——————EXAMPLE 2——————

Add-PnPDataRowsToProvisioningTemplate -Path template.pnp -List 'PnPTestList' -Query '<View></View>' -Fields 'Title','Choice' -IncludeSecurity

Adds datarows from the provided list to the PnP Provisioning Template at the provided location

PARAMETERS

-Fields

The fields to retrieve. If not specified all fields will be loaded in the returned list object.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeSecurity

A switch to include ObjectSecurity information.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: 5
Accept pipeline input: False

-List

The list to query

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Path

Filename of the .PNP Open XML site template to read from, optionally including full path.

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Query

The CAML query to execute against the list. Defaults to all items.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateProviderExtensions

Allows you to specify ITemplateProviderExtension to execute while loading the template.

Type: ITemplateProviderExtension[]
Parameter Sets: (All)

Required: False
Position: 4
Accept pipeline input: False

-TokenizeUrls

If set, this switch will try to tokenize the values with web and site related tokens

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPDocumentSet

SYNOPSIS

Creates a new document set in a library.

SYNTAX

Add-PnPDocumentSet -List <ListPipeBind>
                   -Name <String>
                   -ContentType <ContentTypePipeBind>
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPDocumentSet -List "Documents" -ContentType "Test Document Set" -Name "Test"

This will add a new document set based upon the ‘Test Document Set’ content type to a list called ‘Documents’. The document set will be named ‘Test’

PARAMETERS

-ContentType

The name of the content type, its ID or an actual content object referencing to the document set

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-List

The name of the list, its ID or an actual list object from where the document set needs to be added

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Name

The name of the document set

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

System.String

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPEventReceiver

SYNOPSIS

Adds a new remote event receiver

SYNTAX

Add-PnPEventReceiver -Name <String>
                     -Url <String>
                     -EventReceiverType <EventReceiverType>
                     -Synchronization <EventReceiverSynchronization>
                     [-List <ListPipeBind>]
                     [-SequenceNumber <Int>]
                     [-Force [<SwitchParameter>]]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPEventReceiver -List "ProjectList" -Name "TestEventReceiver" -Url https://yourserver.azurewebsites.net/eventreceiver.svc -EventReceiverType ItemAdded -Synchronization Asynchronous

This will add a new remote event receiver that is executed after an item has been added to the ProjectList list

——————EXAMPLE 2——————

Add-PnPEventReceiver -Name "TestEventReceiver" -Url https://yourserver.azurewebsites.net/eventreceiver.svc -EventReceiverType WebAdding -Synchronization Synchronous

This will add a new remote event receiver that is executed while a new subsite is being created

PARAMETERS

-EventReceiverType

The type of the event receiver like ItemAdded, ItemAdding. See https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.eventreceivertype.aspx for the full list of available types.

Type: EventReceiverType
Parameter Sets: (All)
Aliases: Type

Required: True
Position: Named
Accept pipeline input: False

-Force

Overwrites the output file if it exists.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

The list object or name where the remote event receiver needs to be added. If omitted, the remote event receiver will be added to the web.

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Name

The name of the remote event receiver

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-SequenceNumber

The sequence number where this remote event receiver should be placed

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Synchronization

The synchronization type: Asynchronous or Synchronous

Type: EventReceiverSynchronization
Parameter Sets: (All)
Aliases: Sync

Required: True
Position: Named
Accept pipeline input: False

-Url

The URL of the remote event receiver web service

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.EventReceiverDefinition

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPField

SYNOPSIS

Add a field

SYNTAX

Add field by XML to list

Add-PnPField [-AddToDefaultView [<SwitchParameter>]]
             [-Required [<SwitchParameter>]]
             [-Group <String>]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

Add field reference to list

Add-PnPField -List <ListPipeBind>
             -Field <FieldPipeBind>
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

Add field to list

Add-PnPField -DisplayName <String>
             -InternalName <String>
             -Type <FieldType>
             [-List <ListPipeBind>]
             [-Id <GuidPipeBind>]
             [-AddToDefaultView [<SwitchParameter>]]
             [-Required [<SwitchParameter>]]
             [-Group <String>]
             [-ClientSideComponentId <GuidPipeBind>]
             [-ClientSideComponentProperties <String>]
             [-Choices <String[]>]
             [-Formula <String>]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

Add field to web

Add-PnPField -DisplayName <String>
             -InternalName <String>
             -Type <FieldType>
             [-Id <GuidPipeBind>]
             [-ClientSideComponentId <GuidPipeBind>]
             [-ClientSideComponentProperties <String>]
             [-Choices <String[]>]
             [-Formula <String>]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

DESCRIPTION

Adds a field to a list or as a site column

EXAMPLES

——————EXAMPLE 1——————

Add-PnPField -Type Calculated -InternalName "C1" -DisplayName "C1" -Formula ="[Title]"

Adds a new calculated site column with the formula specified

——————EXAMPLE 2——————

Add-PnPField -List "Demo list" -DisplayName "Location" -InternalName "SPSLocation" -Type Choice -Group "Demo Group" -AddToDefaultView -Choices "Stockholm","Helsinki","Oslo"

This will add a field of type Choice to the list “Demo List”.

——————EXAMPLE 3——————

PS:>Add-PnPField -List "Demo list" -DisplayName "Speakers" -InternalName "SPSSpeakers" -Type MultiChoice -Group "Demo Group" -AddToDefaultView -Choices "Obiwan Kenobi","Darth Vader", "Anakin Skywalker"

This will add a field of type Multiple Choice to the list “Demo List”. (you can pick several choices for the same item)

PARAMETERS

-AddToDefaultView

Switch Parameter if this field must be added to the default view

Type: SwitchParameter
Parameter Sets: Add field to list, Add field by XML to list

Required: False
Position: Named
Accept pipeline input: False

-Choices

Specify choices, only valid if the field type is Choice

Type: String[]
Parameter Sets: Add field to list

Required: False
Position: 0
Accept pipeline input: False

-ClientSideComponentId

The Client Side Component Id to set to the field

Only applicable to: SharePoint Online

Type: GuidPipeBind
Parameter Sets: Add field to list, Add field to web

Required: False
Position: Named
Accept pipeline input: False

-ClientSideComponentProperties

The Client Side Component Properties to set to the field

Only applicable to: SharePoint Online

Type: String
Parameter Sets: Add field to list, Add field to web

Required: False
Position: Named
Accept pipeline input: False

-DisplayName

The display name of the field

Type: String
Parameter Sets: Add field to list, Add field to web

Required: True
Position: Named
Accept pipeline input: False

-Field

The name of the field, its ID or an actual field object that needs to be added

Type: FieldPipeBind
Parameter Sets: Add field reference to list

Required: True
Position: Named
Accept pipeline input: False

-Formula

Specify the formula. Only available if the field type is Calculated

Type: String
Parameter Sets: Add field to list

Required: False
Position: 0
Accept pipeline input: False

-Group

The group name to where this field belongs to

Type: String
Parameter Sets: Add field to list, Add field by XML to list

Required: False
Position: Named
Accept pipeline input: False

-Id

The ID of the field, must be unique

Type: GuidPipeBind
Parameter Sets: Add field to list, Add field to web

Required: False
Position: Named
Accept pipeline input: False

-InternalName

The internal name of the field

Type: String
Parameter Sets: Add field to list, Add field to web

Required: True
Position: Named
Accept pipeline input: False

-List

The name of the list, its ID or an actual list object where this field needs to be added

Type: ListPipeBind
Parameter Sets: Add field to list, Add field reference to list

Required: False
Position: Named
Accept pipeline input: True

-Required

Switch Parameter if the field is a required field

Type: SwitchParameter
Parameter Sets: Add field to list, Add field by XML to list

Required: False
Position: Named
Accept pipeline input: False

-Type

The type of the field like Choice, Note, MultiChoice. For a complete list of field types visit https://docs.microsoft.com/dotnet/api/microsoft.sharepoint.client.fieldtype

Type: FieldType
Parameter Sets: Add field to list, Add field to web

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Field

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPFieldFromXml

SYNOPSIS

Adds a field to a list or as a site column based upon a CAML/XML field definition

SYNTAX

Add-PnPFieldFromXml -FieldXml <String>
                    [-List <ListPipeBind>]
                    [-Web <WebPipeBind>]
                    [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

$xml = '<Field Type="Text" Name="PSCmdletTest" DisplayName="PSCmdletTest" ID="{27d81055-f208-41c9-a976-61c5473eed4a}" Group="Test" Required="FALSE" StaticName="PSCmdletTest" />'
Add-PnPFieldFromXml -FieldXml $xml

Adds a field with the specified field CAML code to the site.

——————EXAMPLE 2——————

$xml = '<Field Type="Text" Name="PSCmdletTest" DisplayName="PSCmdletTest" ID="{27d81055-f208-41c9-a976-61c5473eed4a}" Group="Test" Required="FALSE" StaticName="PSCmdletTest" />'
Add-PnPFieldFromXml -List "Demo List" -FieldXml $xml

Adds a field with the specified field CAML code to the list “Demo List”.

PARAMETERS

-FieldXml

CAML snippet containing the field definition. See http://msdn.microsoft.com/en-us/library/office/ms437580(v=office.15).aspx

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-List

The name of the list, its ID or an actual list object where this field needs to be added

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Field

SharePoint Developer Patterns and PracticesField CAML

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPFieldToContentType

SYNOPSIS

Adds an existing site column to a content type

SYNTAX

Add-PnPFieldToContentType -Field <FieldPipeBind>
                          -ContentType <ContentTypePipeBind>
                          [-Required [<SwitchParameter>]]
                          [-Hidden [<SwitchParameter>]]
                          [-Web <WebPipeBind>]
                          [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPFieldToContentType -Field "Project_Name" -ContentType "Project Document"

This will add an existing site column with an internal name of “Project_Name” to a content type called “Project Document”

PARAMETERS

-ContentType

Specifies which content type a field needs to be added to

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Field

Specifies the field that needs to be added to the content type

Type: FieldPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Hidden

Specifies whether the field should be hidden or not

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Required

Specifies whether the field is required or not

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPFile

SYNOPSIS

Uploads a file to Web

SYNTAX

Upload file

Add-PnPFile -Path <String>
            -Folder <String>
            [-NewFileName <String>]
            [-Checkout [<SwitchParameter>]]
            [-CheckInComment <String>]
            [-Approve [<SwitchParameter>]]
            [-ApproveComment <String>]
            [-Publish [<SwitchParameter>]]
            [-PublishComment <String>]
            [-UseWebDav [<SwitchParameter>]]
            [-Values <Hashtable>]
            [-ContentType <ContentTypePipeBind>]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

Upload file from stream

Add-PnPFile -FileName <String>
            -Stream <Stream>
            -Folder <String>
            [-Checkout [<SwitchParameter>]]
            [-CheckInComment <String>]
            [-Approve [<SwitchParameter>]]
            [-ApproveComment <String>]
            [-Publish [<SwitchParameter>]]
            [-PublishComment <String>]
            [-UseWebDav [<SwitchParameter>]]
            [-Values <Hashtable>]
            [-ContentType <ContentTypePipeBind>]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPFile -Path c:\temp\company.master -Folder "_catalogs/masterpage"

This will upload the file company.master to the masterpage catalog

——————EXAMPLE 2——————

Add-PnPFile -Path .\displaytemplate.html -Folder "_catalogs/masterpage/display templates/test"

This will upload the file displaytemplate.html to the test folder in the display templates folder. If the test folder does not exist it will create it.

——————EXAMPLE 3——————

Add-PnPFile -Path .\sample.doc -Folder "Shared Documents" -Values @{Modified="1/1/2016"}

This will upload the file sample.doc to the Shared Documents folder. After uploading it will set the Modified date to 1/1/2016.

——————EXAMPLE 4——————

Add-PnPFile -FileName sample.doc -Folder "Shared Documents" -Stream $fileStream -Values @{Modified="1/1/2016"}

This will add a file sample.doc with the contents of the stream into the Shared Documents folder. After adding it will set the Modified date to 1/1/2016.

——————EXAMPLE 5——————

Add-PnPFile -Path sample.doc -Folder "Shared Documents" -ContentType "Document" -Values @{Modified="1/1/2016"}

This will add a file sample.doc to the Shared Documents folder, with a ContentType of ‘Documents’. After adding it will set the Modified date to 1/1/2016.

——————EXAMPLE 6——————

Add-PnPFile -Path sample.docx -Folder "Documents" -Values @{Modified="1/1/2016"; Created="1/1/2017"; Editor=23}

This will add a file sample.docx to the Documents folder and will set the Modified date to 1/1/2016, Created date to 1/1/2017 and the Modified By field to the user with ID 23. To find out about the proper user ID to relate to a specific user, use Get-PnPUser.

——————EXAMPLE 7——————

Add-PnPFile -Path sample.docx -Folder "Documents" -NewFileName "differentname.docx"

This will upload a local file sample.docx to the Documents folder giving it the filename differentname.docx on SharePoint

PARAMETERS

-Approve

Will auto approve the uploaded file

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ApproveComment

The comment added to the approval

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CheckInComment

The comment added to the checkin

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Checkout

If versioning is enabled, this will check out the file first if it exists, upload the file, then check it in again

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ContentType

Use to assign a ContentType to the file

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-FileName

Name for file

Type: String
Parameter Sets: Upload file from stream

Required: True
Position: Named
Accept pipeline input: False

-Folder

The destination folder in the site

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-NewFileName

Filename to give the file on SharePoint

Type: String
Parameter Sets: Upload file

Required: False
Position: Named
Accept pipeline input: False

-Path

The local file path

Type: String
Parameter Sets: Upload file

Required: True
Position: Named
Accept pipeline input: False

-Publish

Will auto publish the file

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PublishComment

The comment added to the publish action

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Stream

Stream with the file contents

Type: Stream
Parameter Sets: Upload file from stream

Required: True
Position: Named
Accept pipeline input: False

-UseWebDav

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Values

Use the internal names of the fields when specifying field names.

Single line of text: -Values @{“Title” = “Title New”}

Multiple lines of text: -Values @{“MultiText” = “New text\n\nMore text”}

Rich text: -Values @{“MultiText” = “<strong>New</strong> text”}

Choice: -Values @{“Choice” = “Value 1”}

Number: -Values @{“Number” = “10”}

Currency: -Values @{“Number” = “10”}

Currency: -Values @{“Currency” = “10”}

Date and Time: -Values @{“DateAndTime” = “03/10/2015 14:16”}

Lookup (id of lookup value): -Values @{“Lookup” = “2”}

Multi value lookup (id of lookup values as array 1): -Values @{“MultiLookupField” = “1”,“2”}

Multi value lookup (id of lookup values as array 2): -Values @{“MultiLookupField” = 1,2}

Multi value lookup (id of lookup values as string): -Values @{“MultiLookupField” = “1,2”}

Yes/No: -Values @{“YesNo” = $false}

Person/Group (id of user/group in Site User Info List or email of the user, separate multiple values with a comma): -Values @{“Person” = “user1@domain.com”,“21”}

Managed Metadata (single value with path to term): -Values @{“MetadataField” = “CORPORATE|DEPARTMENTS|FINANCE”}

Managed Metadata (single value with id of term): -Values @{“MetadataField” = “fe40a95b-2144-4fa2-b82a-0b3d0299d818”} with Id of term

Managed Metadata (multiple values with paths to terms): -Values @{“MetadataField” = “CORPORATE|DEPARTMENTS|FINANCE”,“CORPORATE|DEPARTMENTS|HR”}

Managed Metadata (multiple values with ids of terms): -Values @{“MetadataField” = “fe40a95b-2144-4fa2-b82a-0b3d0299d818”,“52d88107-c2a8-4bf0-adfa-04bc2305b593”}

Hyperlink or Picture: -Values @{“Hyperlink” = “https://github.com/OfficeDev/, OfficePnp”}

Type: Hashtable
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.File

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPFileToProvisioningTemplate

SYNOPSIS

Adds a file to a PnP Provisioning Template

SYNTAX

Remove File

Add-PnPFileToProvisioningTemplate -Path <String>
                                  -SourceUrl <String>
                                  [-Container <String>]
                                  [-FileLevel <FileLevel>]
                                  [-TemplateProviderExtensions <ITemplateProviderExtension[]>]
                                  [-FileOverwrite [<SwitchParameter>]]
                                  [-Web <WebPipeBind>]
                                  [-Connection <PnPConnection>]

Local File

Add-PnPFileToProvisioningTemplate -Path <String>
                                  -Source <String>
                                  -Folder <String>
                                  [-Container <String>]
                                  [-FileLevel <FileLevel>]
                                  [-TemplateProviderExtensions <ITemplateProviderExtension[]>]
                                  [-FileOverwrite [<SwitchParameter>]]
                                  [-Web <WebPipeBind>]
                                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPFileToProvisioningTemplate -Path template.pnp -Source $sourceFilePath -Folder $targetFolder

Adds a file to a PnP Site Template

——————EXAMPLE 2——————

Add-PnPFileToProvisioningTemplate -Path template.xml -Source $sourceFilePath -Folder $targetFolder

Adds a file reference to a PnP Site XML Template

——————EXAMPLE 3——————

Add-PnPFileToProvisioningTemplate -Path template.pnp -Source "./myfile.png" -Folder "folderinsite" -FileLevel Published -FileOverwrite:$false

Adds a file to a PnP Site Template, specifies the level as Published and defines to not overwrite the file if it exists in the site.

——————EXAMPLE 4——————

Add-PnPFileToProvisioningTemplate -Path template.pnp -Source $sourceFilePath -Folder $targetFolder -Container $container

Adds a file to a PnP Site Template with a custom container for the file

——————EXAMPLE 5——————

Add-PnPFileToProvisioningTemplate -Path template.pnp -SourceUrl "Shared%20Documents/ProjectStatus.docs"

Adds a file to a PnP Provisioning Template retrieved from the currently connected site. The url can be server relative or web relative. If specifying a server relative url has to start with the current site url.

PARAMETERS

-Container

The target Container for the file to add to the in-memory template, optional argument.

Type: String
Parameter Sets: (All)

Required: False
Position: 3
Accept pipeline input: False

-FileLevel

The level of the files to add. Defaults to Published

Type: FileLevel
Parameter Sets: (All)

Required: False
Position: 4
Accept pipeline input: False

-FileOverwrite

Set to overwrite in site, Defaults to true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: 5
Accept pipeline input: False

-Folder

The target Folder for the file to add to the in-memory template.

Type: String
Parameter Sets: Local File

Required: True
Position: 2
Accept pipeline input: False

-Path

Filename of the .PNP Open XML site template to read from, optionally including full path.

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Source

The file to add to the in-memory template, optionally including full path.

Type: String
Parameter Sets: Local File

Required: True
Position: 1
Accept pipeline input: False

-SourceUrl

The file to add to the in-memory template, specifying its url in the current connected Web.

Type: String
Parameter Sets: Remove File

Required: True
Position: 1
Accept pipeline input: False

-TemplateProviderExtensions

Allows you to specify ITemplateProviderExtension to execute while loading the template.

Type: ITemplateProviderExtension[]
Parameter Sets: (All)

Required: False
Position: 4
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPFolder

SYNOPSIS

Creates a folder within a parent folder

SYNTAX

Add-PnPFolder -Name <String>
              -Folder <String>
              [-Web <WebPipeBind>]
              [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPFolder -Name NewFolder -Folder _catalogs/masterpage

This will create the folder NewFolder in the masterpage catalog

PARAMETERS

-Folder

The parent folder in the site

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Name

The folder name

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPHtmlPublishingPageLayout

SYNOPSIS

Adds a HTML based publishing page layout

SYNTAX

Add-PnPHtmlPublishingPageLayout -SourceFilePath <String>
                                -Title <String>
                                -Description <String>
                                -AssociatedContentTypeID <String>
                                [-DestinationFolderHierarchy <String>]
                                [-Web <WebPipeBind>]
                                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPHtmlPublishingPageLayout -Title 'Our custom page layout' -SourceFilePath 'customlayout.aspx' -Description 'A custom page layout' -AssociatedContentTypeID 0x01010901

Uploads the pagelayout ‘customlayout.aspx’ from the current location to the current site as a ‘web part page’ pagelayout

PARAMETERS

-AssociatedContentTypeID

Associated content type ID

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Description

Description for the page layout

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-DestinationFolderHierarchy

Folder hierarchy where the HTML page layouts will be deployed

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SourceFilePath

Path to the file which will be uploaded

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Title

Title for the page layout

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPHubSiteAssociation

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Connects a site to a hubsite.

SYNTAX

Add-PnPHubSiteAssociation -Site <SitePipeBind>
                          -HubSite <SitePipeBind>
                          [-Connection <PnPConnection>]

DESCRIPTION

Connects an existing site to a hubsite

EXAMPLES

——————EXAMPLE 1——————

Add-PnPHubSiteAssociation -Site https://tenant.sharepoint.com/sites/mysite -HubSite https://tenant.sharepoint.com/sites/hubsite

This example adds the specified site to the hubsite.

PARAMETERS

-HubSite

The hubsite to connect the site to

Type: SitePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Site

The site to connect to the hubsite

Type: SitePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPIndexedProperty

SYNOPSIS

Marks the value of the propertybag key specified to be indexed by search.

SYNTAX

Add-PnPIndexedProperty -Key <String>
                       [-List <ListPipeBind>]
                       [-Web <WebPipeBind>]
                       [-Connection <PnPConnection>]

PARAMETERS

-Key

Key of the property bag value to be indexed

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-List

The list object or name where to set the indexed property

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPJavaScriptBlock

SYNOPSIS

Adds a link to a JavaScript snippet/block to a web or site collection

SYNTAX

Add-PnPJavaScriptBlock -Name <String>
                       -Script <String>
                       [-Sequence <Int>]
                       [-Scope <CustomActionScope>]
                       [-Web <WebPipeBind>]
                       [-Connection <PnPConnection>]

DESCRIPTION

Specify a scope as ‘Site’ to add the custom action to all sites in a site collection.

EXAMPLES

——————EXAMPLE 1——————

Add-PnPJavaScriptBlock -Name myAction -script '<script>Alert("This is my Script block");</script>' -Sequence 9999 -Scope Site

Add a JavaScript code block to all pages within the current site collection under the name myAction and at order 9999

——————EXAMPLE 2——————

Add-PnPJavaScriptBlock -Name myAction -script '<script>Alert("This is my Script block");</script>'

Add a JavaScript code block to all pages within the current web under the name myAction

PARAMETERS

-Name

The name of the script block. Can be used to identify the script with other cmdlets or coded solutions

Type: String
Parameter Sets: (All)
Aliases: Key

Required: True
Position: Named
Accept pipeline input: False

-Scope

The scope of the script to add to. Either Web or Site, defaults to Web. ‘All’ is not valid for this command.

Type: CustomActionScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Script

The javascript block to add to the specified scope

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Sequence

A sequence number that defines the order on the page

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPJavaScriptLink

SYNOPSIS

Adds a link to a JavaScript file to a web or sitecollection, valid only for SharePoint classic site experience.

SYNTAX

Add-PnPJavaScriptLink -Name <String>
                      -Url <String[]>
                      [-Sequence <Int>]
                      [-Scope <CustomActionScope>]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

DESCRIPTION

Creates a custom action that refers to a JavaScript file

EXAMPLES

——————EXAMPLE 1——————

Add-PnPJavaScriptLink -Name jQuery -Url https://code.jquery.com/jquery.min.js -Sequence 9999 -Scope Site

Injects a reference to the latest v1 series jQuery library to all pages within the current site collection under the name jQuery and at order 9999

——————EXAMPLE 2——————

Add-PnPJavaScriptLink -Name jQuery -Url https://code.jquery.com/jquery.min.js

Injects a reference to the latest v1 series jQuery library to all pages within the current web under the name jQuery

PARAMETERS

-Name

Name under which to register the JavaScriptLink

Type: String
Parameter Sets: (All)
Aliases: Key

Required: True
Position: Named
Accept pipeline input: False

-Scope

Defines if this JavaScript file will be injected to every page within the current site collection or web. All is not allowed in for this command. Default is web.

Type: CustomActionScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Sequence

Sequence of this JavaScript being injected. Use when you have a specific sequence with which to have JavaScript files being added to the page. I.e. jQuery library first and then jQueryUI.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Url

URL to the JavaScript file to inject

Type: String[]
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPListFoldersToProvisioningTemplate

SYNOPSIS

Adds folders to a list in a PnP Provisioning Template

SYNTAX

Add-PnPListFoldersToProvisioningTemplate -Path <String>
                                         -List <ListPipeBind>
                                         [-Recursive [<SwitchParameter>]]
                                         [-IncludeSecurity [<SwitchParameter>]]
                                         [-TemplateProviderExtensions <ITemplateProviderExtension[]>]
                                         [-Web <WebPipeBind>]
                                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPListFoldersToProvisioningTemplate -Path template.pnp -List 'PnPTestList'

Adds top level folders from a list to an existing template and returns an in-memory PnP Site Template

——————EXAMPLE 2——————

Add-PnPListFoldersToProvisioningTemplate -Path template.pnp -List 'PnPTestList' -Recursive

Adds all folders from a list to an existing template and returns an in-memory PnP Site Template

——————EXAMPLE 3——————

Add-PnPListFoldersToProvisioningTemplate -Path template.pnp -List 'PnPTestList' -Recursive -IncludeSecurity

Adds all folders from a list with unique permissions to an in-memory PnP Site Template

PARAMETERS

-IncludeSecurity

A switch to include ObjectSecurity information.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: 5
Accept pipeline input: False

-List

The list to query

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 2
Accept pipeline input: False

-Path

Filename of the .PNP Open XML site template to read from, optionally including full path.

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Recursive

A switch parameter to include all folders in the list, or just top level folders.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: 4
Accept pipeline input: False

-TemplateProviderExtensions

Allows you to specify ITemplateProviderExtension to execute while loading the template.

Type: ITemplateProviderExtension[]
Parameter Sets: (All)

Required: False
Position: 6
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPListItem

SYNOPSIS

Adds an item to the list and sets the creation time to the current date and time. The author is set to the current authenticated user executing the cmdlet. In order to set the author to a different user, please refer to Set-PnPListItem.

SYNTAX

Add-PnPListItem -List <ListPipeBind>
                [-ContentType <ContentTypePipeBind>]
                [-Values <Hashtable>]
                [-Folder <String>]
                [-Label <String>]
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPListItem -List "Demo List" -Values @{"Title" = "Test Title"; "Category"="Test Category"}

Adds a new list item to the “Demo List”, and sets both the Title and Category fields with the specified values. Notice, use the internal names of fields.

——————EXAMPLE 2——————

Add-PnPListItem -List "Demo List" -ContentType "Company" -Values @{"Title" = "Test Title"; "Category"="Test Category"}

Adds a new list item to the “Demo List”, sets the content type to “Company” and sets both the Title and Category fields with the specified values. Notice, use the internal names of fields.

——————EXAMPLE 3——————

Add-PnPListItem -List "Demo List" -Values @{"MultiUserField"="user1@domain.com","user2@domain.com"}

Adds a new list item to the “Demo List” and sets the user field called MultiUserField to 2 users. Separate multiple users with a comma.

——————EXAMPLE 4——————

Add-PnPListItem -List "Demo List" -Values @{"Title"="Sales Report"} -Folder "projects/europe"

Adds a new list item to the “Demo List”. It will add the list item to the europe folder which is located in the projects folder. Folders will be created if needed.

——————EXAMPLE 5——————

Add-PnPListItem -List "Demo List" -Values @{"Title"="Sales Report"} -Label "Public"

Adds a new list item to the “Demo List”. Sets the retention label to “Public” if it exists on the site.

PARAMETERS

-ContentType

Specify either the name, ID or an actual content type.

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Folder

The list relative URL of a folder. E.g. “MyFolder” for a folder located in the root of the list, or “MyFolder/SubFolder” for a folder located in the MyFolder folder which is located in the root of the list.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Label

The name of the retention label.

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

The ID, Title or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Values

Use the internal names of the fields when specifying field names.

Single line of text: -Values @{“Title” = “Title New”}

Multiple lines of text: -Values @{“MultiText” = “New text\n\nMore text”}

Rich text: -Values @{“MultiText” = “<strong>New</strong> text”}

Choice: -Values @{“Choice” = “Value 1”}

Number: -Values @{“Number” = “10”}

Currency: -Values @{“Number” = “10”}

Currency: -Values @{“Currency” = “10”}

Date and Time: -Values @{“DateAndTime” = “03/13/2015 14:16”}

Lookup (id of lookup value): -Values @{“Lookup” = “2”}

Multi value lookup (id of lookup values as array 1): -Values @{“MultiLookupField” = “1”,“2”}

Multi value lookup (id of lookup values as array 2): -Values @{“MultiLookupField” = 1,2}

Multi value lookup (id of lookup values as string): -Values @{“MultiLookupField” = “1,2”}

Yes/No: -Values @{“YesNo” = $false}

Person/Group (id of user/group in Site User Info List or email of the user, separate multiple values with a comma): -Values @{“Person” = “user1@domain.com”,“21”}

Managed Metadata (single value with path to term): -Values @{“MetadataField” = “CORPORATE|DEPARTMENTS|FINANCE”}

Managed Metadata (single value with id of term): -Values @{“MetadataField” = “fe40a95b-2144-4fa2-b82a-0b3d0299d818”} with Id of term

Managed Metadata (multiple values with paths to terms): -Values @{“MetadataField” = “CORPORATE|DEPARTMENTS|FINANCE”,“CORPORATE|DEPARTMENTS|HR”}

Managed Metadata (multiple values with ids of terms): -Values @{“MetadataField” = “fe40a95b-2144-4fa2-b82a-0b3d0299d818”,“52d88107-c2a8-4bf0-adfa-04bc2305b593”}

Hyperlink or Picture: -Values @{“Hyperlink” = “https://github.com/OfficeDev/, OfficePnp”}

Type: Hashtable
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.ListItem

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPMasterPage

SYNOPSIS

Adds a Masterpage

SYNTAX

Add-PnPMasterPage -SourceFilePath <String>
                  -Title <String>
                  -Description <String>
                  [-DestinationFolderHierarchy <String>]
                  [-UIVersion <String>]
                  [-DefaultCssFile <String>]
                  [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPMasterPage -SourceFilePath "page.master" -Title "MasterPage" -Description "MasterPage for Web" -DestinationFolderHierarchy "SubFolder"

Adds a MasterPage from the local file “page.master” to the folder “SubFolder” in the Masterpage gallery.

PARAMETERS

-DefaultCssFile

Default CSS file for the MasterPage, this Url is SiteRelative

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

Description for the Masterpage

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-DestinationFolderHierarchy

Folder hierarchy where the MasterPage will be deployed

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SourceFilePath

Path to the file which will be uploaded

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Title

Title for the Masterpage

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-UIVersion

UIVersion of the Masterpage. Default = 15

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.File

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPMicrosoft365GroupMember

SYNOPSIS

Required Permissions

  • Microsoft Graph API: All of Group.ReadWrite.All, User.ReadWrite.All

Adds members to a particular Microsoft 365 Group

SYNTAX

Add-PnPMicrosoft365GroupMember -Identity <Microsoft365GroupPipeBind>
                               -Users <String[]>
                               [-RemoveExisting [<SwitchParameter>]]
                               [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPMicrosoft365GroupMember -Identity "Project Team" -Users "john@contoso.onmicrosoft.com","jane@contoso.onmicrosoft.com"

Adds the provided two users as additional members to the Microsoft 365 Group named “Project Team”

——————EXAMPLE 2——————

Add-PnPMicrosoft365GroupMember -Identity "Project Team" -Users "john@contoso.onmicrosoft.com","jane@contoso.onmicrosoft.com" -RemoveExisting

Sets the provided two users as the only members of the Microsoft 365 Group named “Project Team” by removing any current existing members first

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Microsoft 365 Group to add members to

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-RemoveExisting

If provided, all existing members will be removed and only those provided through Users will become members

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Users

The UPN(s) of the user(s) to add to the Microsoft 365 Group as a member

Type: String[]
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and PracticesDocumentation

Add-PnPMicrosoft365GroupToSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Groupifies a classic team site by creating a Microsoft 365 group for it and connecting the site with the newly created group

SYNTAX

Add-PnPMicrosoft365GroupToSite -Url <String>
                               -Alias <String>
                               -DisplayName <String>
                               [-Description <String>]
                               [-Classification <String>]
                               [-IsPublic [<SwitchParameter>]]
                               [-KeepOldHomePage [<SwitchParameter>]]
                               [-HubSiteId <GuidPipeBind>]
                               [-Owners <String[]>]
                               [-Connection <PnPConnection>]

DESCRIPTION

This command allows you to add a Microsoft 365 Unified group to an existing classic site collection, also known as groupifying.

EXAMPLES

——————EXAMPLE 1——————

Add-PnPOffice365GroupToSite -Url "https://contoso.sharepoint.com/sites/FinanceTeamsite" -Alias "FinanceTeamsite" -DisplayName = "My finance team site group"

This will groupify the FinanceTeamsite

PARAMETERS

-Alias

Specifies the alias of the group. Cannot contain spaces.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Classification

Specifies the classification of the group

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The optional description of the group

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisplayName

The display name of the group

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-HubSiteId

If specified the site will be associated to the hubsite as identified by this id

Type: GuidPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IsPublic

Specifies if the group is public. Defaults to false.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-KeepOldHomePage

Specifies if the current site home page is kept. Defaults to false.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owners

The array UPN values of the group’s owners

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Url

Url of the site to be connected to an Microsoft 365 Group

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPNavigationNode

SYNOPSIS

Adds an item to a navigation element

SYNTAX

Add-PnPNavigationNode -Location <NavigationType>
                      -Title <String>
                      [-Url <String>]
                      [-Parent <Int>]
                      [-First [<SwitchParameter>]]
                      [-External [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

DESCRIPTION

Adds a menu item to either the quicklaunch, top navigation, search navigation or the footer

EXAMPLES

——————EXAMPLE 1——————

Add-PnPNavigationNode -Title "Contoso" -Url "http://contoso.sharepoint.com/sites/contoso/" -Location "QuickLaunch"

Adds a navigation node to the quicklaunch. The navigation node will have the title “Contoso” and will link to the url “http://contoso.sharepoint.com/sites/contoso/"

——————EXAMPLE 2——————

Add-PnPNavigationNode -Title "Contoso USA" -Url "http://contoso.sharepoint.com/sites/contoso/usa/" -Location "QuickLaunch" -Parent 2012

Adds a navigation node to the quicklaunch. The navigation node will have the title “Contoso USA”, will link to the url “http://contoso.sharepoint.com/sites/contoso/usa/" and will have the node with id 2012 as a parent navigation node.

——————EXAMPLE 3——————

Add-PnPNavigationNode -Title "Contoso" -Url "http://contoso.sharepoint.com/sites/contoso/" -Location "QuickLaunch" -First

Adds a navigation node to the quicklaunch, as the first item. The navigation node will have the title “Contoso” and will link to the url “http://contoso.sharepoint.com/sites/contoso/"

——————EXAMPLE 4——————

Add-PnPNavigationNode -Title "Contoso Pharmaceuticals" -Url "http://contoso.sharepoint.com/sites/contosopharma/" -Location "QuickLaunch" -External

Adds a navigation node to the quicklaunch. The navigation node will have the title “Contoso Pharmaceuticals” and will link to the external url “http://contoso.sharepoint.com/sites/contosopharma/"

——————EXAMPLE 5——————

Add-PnPNavigationNode -Title "Wiki" -Location "QuickLaunch" -Url "wiki/"

Adds a navigation node to the quicklaunch. The navigation node will have the title “Wiki” and will link to Wiki library on the selected Web.

PARAMETERS

-External

Indicates the destination URL is outside of the site collection

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-First

Add the new menu item to beginning of the collection

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Location

The location where to add the navigation node to. Either TopNavigationBar, QuickLaunch, SearchNav or Footer.

Type: NavigationType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Parent

The key of the parent. Leave empty to add to the top level

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

The title of the node to add

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Url

The url to navigate to when clicking the new menu item. This can either be absolute or relative to the Web. Fragments are not supported.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.NavigationNode

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPOffice365GroupToSite

SYNOPSIS

Groupifies a classic team site by creating an Office 365 group for it and connecting the site with the newly created group

SYNTAX

Add-PnPOffice365GroupToSite -Url <String>
                            -Alias <String>
                            -DisplayName <String>
                            [-Description <String>]
                            [-Classification <String>]
                            [-IsPublic [<SwitchParameter>]]
                            [-KeepOldHomePage [<SwitchParameter>]]
                            [-HubSiteId <GuidPipeBind>]
                            [-Owners <String[]>]
                            [-Connection <SPOnlineConnection>]

DESCRIPTION

This command allows you to add an Office 365 Unified group to an existing classic site collection.

EXAMPLES

——————EXAMPLE 1——————

Add-PnPOffice365GroupToSite -Url "https://contoso.sharepoint.com/sites/FinanceTeamsite" -Alias "FinanceTeamsite" -DisplayName = "My finance team site group"

This will add a group called MyGroup to the current site collection

PARAMETERS

-Alias

Specifies the alias of the group. Cannot contain spaces.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Classification

Specifies the classification of the group.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The optional description of the group.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisplayName

The display name of the group.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-HubSiteId

If specified the site will be associated to the hubsite as identified by this id

Type: GuidPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IsPublic

Specifies if the group is public. Defaults to false.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-KeepOldHomePage

Specifies if the current site home page is kept. Defaults to false.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owners

The array UPN values of the group’s owners.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Url

Url of the site to be connected to an Office 365 Group.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: SPOnlineConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPOrgAssetsLibrary

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Adds a given document library as a organizational asset source

SYNTAX

Add-PnPOrgAssetsLibrary -LibraryUrl <String>
                        [-ThumbnailUrl <String>]
                        [-CdnType <SPOTenantCdnType>]
                        [-Connection <PnPConnection>]

DESCRIPTION

Adds a given document library as an organizational asset source in your Sharepoint Online Tenant. All organizational asset sources you add must reside in the same site collection. Document libraries specified as organizational asset must be enabled as an Office 365 CDN source, either as private or public. It may take some time before this change will be reflected in the webinterface.

EXAMPLES

——————EXAMPLE 1——————

Add-PnPOrgAssetsLibrary -LibraryUrl https://yourtenant.sharepoint.com/sites/branding/logos

Adds the document library with the url “logos” located in the sitecollection at “https://yourtenant.sharepoint.com/sites/branding" as an organizational asset not specifying a thumbnail image for it and enabling the document library as a public Office 365 CDN source

——————EXAMPLE 2——————

Add-PnPOrgAssetsLibrary -LibraryUrl https://yourtenant.sharepoint.com/sites/branding/logos -ThumbnailUrl https://yourtenant.sharepoint.com/sites/branding/logos/thumbnail.jpg

Adds the document library with the url “logos” located in the sitecollection at “https://yourtenant.sharepoint.com/sites/branding" as an organizational asset specifying the thumbnail image “thumbnail.jpg” residing in the same document library for it and enabling the document library as a public Office 365 CDN source

——————EXAMPLE 3——————

Add-PnPOrgAssetsLibrary -LibraryUrl https://yourtenant.sharepoint.com/sites/branding/logos -CdnType Private

Adds the document library with the url “logos” located in the sitecollection at “https://yourtenant.sharepoint.com/sites/branding" as an organizational asset not specifying a thumbnail image for it and enabling the document library as a private Office 365 CDN source

PARAMETERS

-CdnType

Indicates what type of Office 365 CDN source the document library will be added to

Type: SPOTenantCdnType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LibraryUrl

The full url of the document library to be marked as one of organization’s assets sources

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ThumbnailUrl

The full url to an image that should be used as a thumbnail for showing this source. The image must reside in the same site as the document library you specify.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPOrgNewsSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Adds the site as an organization news source in your tenant

SYNTAX

Add-PnPOrgNewsSite -OrgNewsSiteUrl <SitePipeBind>
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPOrgNewsSite -OrgNewsSiteUrl https://yourtenant.sharepoint.com/sites/news

Adds the site as one of multiple possible tenant’s organizational news sites

PARAMETERS

-OrgNewsSiteUrl

The url of the site to be marked as one of organization’s news sites

Type: SitePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPProvisioningTemplate

SYNOPSIS

Adds a PnP Provisioning Template object to a tenant template

SYNTAX

Add-PnPProvisioningTemplate -SiteTemplate <ProvisioningTemplate>
                            -TenantTemplate <ProvisioningHierarchy>

EXAMPLES

——————EXAMPLE 1——————

Add-PnpProvisioningTemplate -TenantTemplate $tenanttemplate -SiteTemplate $sitetemplate

Adds an existing site template to an existing tenant template object

PARAMETERS

-SiteTemplate

The template to add to the tenant template

Type: ProvisioningTemplate
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-TenantTemplate

The tenant template to add the template to

Type: ProvisioningHierarchy
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPPublishingImageRendition

SYNOPSIS

Adds an Image Rendition if the Name of the Image Rendition does not already exist. This prevents creating two Image Renditions that share the same name.

SYNTAX

Add-PnPPublishingImageRendition -Name <String>
                                -Width <Int>
                                -Height <Int>
                                [-Web <WebPipeBind>]
                                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPPublishingImageRendition -Name "MyImageRendition" -Width 800 -Height 600

PARAMETERS

-Height

The height of the Image Rendition.

Type: Int
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Name

The display name of the Image Rendition.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Width

The width of the Image Rendition.

Type: Int
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPPublishingPage

SYNOPSIS

Adds a publishing page

SYNTAX

WithTitle

Add-PnPPublishingPage -PageName <String>
                      -PageTemplateName <String>
                      [-Title <String>]
                      [-FolderPath <String>]
                      [-Publish [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPPublishingPage -PageName 'OurNewPage' -Title 'Our new page' -PageTemplateName 'ArticleLeft'

Creates a new page based on the pagelayout ‘ArticleLeft’

——————EXAMPLE 2——————

Add-PnPPublishingPage -PageName 'OurNewPage' -Title 'Our new page' -PageTemplateName 'ArticleLeft' -Folder '/Pages/folder'

Creates a new page based on the pagelayout ‘ArticleLeft’ with a site relative folder path

PARAMETERS

-FolderPath

The site relative folder path of the page to be added

Type: String
Parameter Sets: (All)
Aliases: Folder

Required: False
Position: Named
Accept pipeline input: False

-PageName

The name of the page to be added as an aspx file

Type: String
Parameter Sets: (All)
Aliases: Name

Required: True
Position: Named
Accept pipeline input: False

-PageTemplateName

The name of the page layout you want to use. Specify without the .aspx extension. So ‘ArticleLeft’ or ‘BlankWebPartPage’

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Publish

Publishes the page. Also Approves it if moderation is enabled on the Pages library.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

The title of the page

Type: String
Parameter Sets: WithTitle

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPPublishingPageLayout

SYNOPSIS

Adds a publishing page layout

SYNTAX

Add-PnPPublishingPageLayout -SourceFilePath <String>
                            -Title <String>
                            -Description <String>
                            -AssociatedContentTypeID <String>
                            [-DestinationFolderHierarchy <String>]
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPPublishingPageLayout -Title 'Our custom page layout' -SourceFilePath 'customlayout.aspx' -Description 'A custom page layout' -AssociatedContentTypeID 0x01010901

Uploads the pagelayout ‘customlayout.aspx’ to the current site as a ‘web part page’ pagelayout

PARAMETERS

-AssociatedContentTypeID

Associated content type ID

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Description

Description for the page layout

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-DestinationFolderHierarchy

Folder hierarchy where the html page layouts will be deployed

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SourceFilePath

Path to the file which will be uploaded

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Title

Title for the page layout

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPRoleDefinition

SYNOPSIS

Adds a Role Defintion (Permission Level) to the site collection in the current context

SYNTAX

Add-PnPRoleDefinition -RoleName <String>
                      [-Clone <RoleDefinitionPipeBind>]
                      [-Include <PermissionKind[]>]
                      [-Exclude <PermissionKind[]>]
                      [-Description <String>]
                      [-Connection <PnPConnection>]

DESCRIPTION

This command allows adding a custom Role Defintion (Permission Level) to the site collection in the current context. It does not replace or remove existing Role Definitions.

EXAMPLES

——————EXAMPLE 1——————

Add-PnPRoleDefinition -RoleName "CustomPerm"

Creates additional permission level with no permission flags enabled.

——————EXAMPLE 2——————

Add-PnPRoleDefinition -RoleName "NoDelete" -Clone "Contribute" -Exclude DeleteListItems

Creates additional permission level by cloning “Contribute” and removes flags DeleteListItems

——————EXAMPLE 3——————

Add-PnPRoleDefinition -RoleName "AddOnly" -Clone "Contribute" -Exclude DeleteListItems, EditListItems

Creates additional permission level by cloning “Contribute” and removes flags DeleteListItems and EditListItems

——————EXAMPLE 4——————

$roleDefinition = Get-PnPRoleDefinition -Identity "Contribute"
Add-PnPRoleDefinition -RoleName "AddOnly" -Clone $roleDefinition -Exclude DeleteListItems, EditListItems

Creates additional permission level by cloning “Contribute” and removes flags DeleteListItems and EditListItems

PARAMETERS

-Clone

An existing permission level or the name of an permission level to clone as base template.

Type: RoleDefinitionPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

Optional description for the new permission level.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Exclude

Specifies permission flags(s) to disable. Please visit https://docs.microsoft.com/previous-versions/office/sharepoint-csom/ee536458(v%3Doffice.15) for the PermissionKind enum

Type: PermissionKind[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Include

Specifies permission flags(s) to enable. Please visit https://docs.microsoft.com/previous-versions/office/sharepoint-csom/ee536458(v%3Doffice.15) for the PermissionKind enum

Type: PermissionKind[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RoleName

Name of new permission level.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPSiteClassification

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Directory.ReadWrite.All

Adds one ore more site classification values to the list of possible values

SYNTAX

Add-PnPSiteClassification -Classifications <String>
                          [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPSiteClassification -Classifications "Top Secret"

Adds the “Top Secret” classification to the already existing classification values.

——————EXAMPLE 2——————

Add-PnPSiteClassification -Classifications "Top Secret","HBI"

Adds the “Top Secret” and the “For Your Eyes Only” classification to the already existing classification values.

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Classifications

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPSiteCollectionAdmin

SYNOPSIS

Adds one or more users as site collection administrators to the site collection in the current context

SYNTAX

Add-PnPSiteCollectionAdmin -Owners <UserPipeBind>
                           [-Connection <PnPConnection>]

DESCRIPTION

This command allows adding one to many users as site collection administrators to the site collection in the current context. It does not replace or remove existing site collection administrators.

EXAMPLES

——————EXAMPLE 1——————

Add-PnPSiteCollectionAdmin -Owners "user@contoso.onmicrosoft.com"

This will add user@contoso.onmicrosoft.com as an additional site collection owner to the site collection in the current context

——————EXAMPLE 2——————

Add-PnPSiteCollectionAdmin -Owners @("user1@contoso.onmicrosoft.com", "user2@contoso.onmicrosoft.com")

This will add user1@contoso.onmicrosoft.com and user2@contoso.onmicrosoft.com as additional site collection owners to the site collection in the current context

——————EXAMPLE 3——————

Get-PnPUser | ? Title -Like "*Doe" | Add-PnPSiteCollectionAdmin

This will add all users with their title ending with “Doe” as additional site collection owners to the site collection in the current context

PARAMETERS

-Owners

Specifies owner(s) to add as site collection administrators. They will be added as additional site collection administrators to the site in the current context. Existing administrators will stay. Can be both users and groups.

Type: UserPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPSiteCollectionAppCatalog

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Adds a Site Collection scoped App Catalog to a site

SYNTAX

Add-PnPSiteCollectionAppCatalog -Site <SitePipeBind>
                                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPSiteCollectionAppCatalog -Site "https://contoso.sharepoint.com/sites/FinanceTeamsite"

This will add a SiteCollection app catalog to the specified site

PARAMETERS

-Site

Url of the site to add the app catalog to.

Type: SitePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and PracticesDocumentation

applicable: SharePoint Online schema: 2.0.0

Add-PnPSiteDesign

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Creates a new Site Design on the current tenant.

SYNTAX

Add-PnPSiteDesign -Title <String>
                  -SiteScriptIds <GuidPipeBind[]>
                  -WebTemplate <SiteWebTemplate>
                  [-Description <String>]
                  [-IsDefault [<SwitchParameter>]]
                  [-PreviewImageAltText <String>]
                  [-PreviewImageUrl <String>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPSiteDesign -Title "My Company Design" -SiteScriptIds "e84dcb46-3ab9-4456-a136-66fc6ae3d3c5","6def687f-0e08-4f1e-999c-791f3af9a600" -Description "My description" -WebTemplate TeamSite

Adds a new Site Design, with the specified title and description. When applied it will run the scripts as referenced by the IDs. Use Get-PnPSiteScript to receive Site Scripts. The WebTemplate parameter specifies that this design applies to Team Sites.

PARAMETERS

-Description

The description of the site design

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IsDefault

Specifies if the site design is a default site design

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PreviewImageAltText

Sets the text for the preview image

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PreviewImageUrl

Sets the url to the preview image

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SiteScriptIds

An array of guids of site scripts

Type: GuidPipeBind[]
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Title

The title of the site design

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-WebTemplate

Specifies the type of site to which this design applies

Type: SiteWebTemplate
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPSiteDesignTask

SYNOPSIS

This command is used to apply a published site design to a specified site collection target. It schedules the operation, allowing for the application of larger site scripts (Invoke-PnPSiteDesign is limited to 30 actions and subactions). This command is intended to replace Invoke-PnPSiteDesign and is useful when you need to apply a large number of actions or multiple site scripts.

SYNTAX

Add-PnPSiteDesignTask -SiteDesignId <GuidPipeBind>
                      [-WebUrl <String>]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPSiteDesignTask -SiteDesignId 501z8c32-4147-44d4-8607-26c2f67cae82

This example applies a site design the currently connected to site. Executing the commands will schedule the site design to be queued and run against the designated site collection.

——————EXAMPLE 2——————

Add-PnPSiteDesignTask -SiteDesignId 501z8c32-4147-44d4-8607-26c2f67cae82 -WebUrl "https://contoso.sharepoint.com/sites/project"

This example applies a site design to the designated site. Executing the commands will schedule the site design to be queued and run against the designated site collection.

PARAMETERS

-SiteDesignId

The ID of the site design to apply.

Type: GuidPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-WebUrl

The URL of the site collection where the site design will be applied. If not specified the design will be applied to the site you connected to with Connect-PnPOnline.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPSiteScript

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Creates a new Site Script on the current tenant.

SYNTAX

Add-PnPSiteScript -Title <String>
                  -Content <String>
                  [-Description <String>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPSiteScript -Title "My Site Script" -Description "A more detailed description" -Content $script

Adds a new Site Script, where $script variable contains the script.

PARAMETERS

-Content

A JSON string containing the site script

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Description

The description of the site script

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

The title of the site script

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPStoredCredential

SYNOPSIS

Adds a credential to the Windows Credential Manager

SYNTAX

Add-PnPStoredCredential -Name <String>
                        -Username <String>
                        [-Password <SecureString>]

DESCRIPTION

Adds an entry to the Windows Credential Manager. If you add an entry in the form of the URL of your tenant/server PnP PowerShell will check if that entry is available when you connect using Connect-PnPOnline. If it finds a matching URL it will use the associated credentials.

If you add a Credential with a name of “https://yourtenant.sharepoint.com” it will find a match when you connect to “https://yourtenant.sharepoint.com” but also when you connect to “https://yourtenant.sharepoint.com/sites/demo1". Of course you can specify more granular entries, allow you to automatically provide credentials for different URLs.

EXAMPLES

——————EXAMPLE 1——————

Add-PnPStoredCredential -Name https://tenant.sharepoint.com -Username yourname@tenant.onmicrosoft.com

You will be prompted to specify the password and a new entry will be added with the specified values

——————EXAMPLE 2——————

Add-PnPStoredCredential -Name https://tenant.sharepoint.com -Username yourname@tenant.onmicrosoft.com -Password (ConvertTo-SecureString -String "YourPassword" -AsPlainText -Force)

A new entry will be added with the specified values

——————EXAMPLE 3——————

Add-PnPStoredCredential -Name https://tenant.sharepoint.com -Username yourname@tenant.onmicrosoft.com -Password (ConvertTo-SecureString -String "YourPassword" -AsPlainText -Force)
Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/mydemosite

A new entry will be added with the specified values, and a subsequent connection to a sitecollection starting with the entry name will be made. Notice that no password prompt will occur.

PARAMETERS

-Name

The credential to set

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Password

If not specified you will be prompted to enter your password. If you want to specify this value use ConvertTo-SecureString -String ‘YourPassword’ -AsPlainText -Force

Type: SecureString
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Username

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPTaxonomyField

SYNOPSIS

Add a taxonomy field

SYNTAX

Id

Add-PnPTaxonomyField -DisplayName <String>
                     -InternalName <String>
                     [-TaxonomyItemId <GuidPipeBind>]
                     [-List <ListPipeBind>]
                     [-Group <String>]
                     [-Id <GuidPipeBind>]
                     [-AddToDefaultView [<SwitchParameter>]]
                     [-MultiValue [<SwitchParameter>]]
                     [-Required [<SwitchParameter>]]
                     [-FieldOptions <AddFieldOptions>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

Path

Add-PnPTaxonomyField -TermSetPath <String>
                     -DisplayName <String>
                     -InternalName <String>
                     [-TermPathDelimiter <String>]
                     [-List <ListPipeBind>]
                     [-Group <String>]
                     [-Id <GuidPipeBind>]
                     [-AddToDefaultView [<SwitchParameter>]]
                     [-MultiValue [<SwitchParameter>]]
                     [-Required [<SwitchParameter>]]
                     [-FieldOptions <AddFieldOptions>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

DESCRIPTION

Adds a taxonomy/managed metadata field to a list or as a site column.

EXAMPLES

——————EXAMPLE 1——————

Add-PnPTaxonomyField -DisplayName "Test" -InternalName "Test" -TermSetPath "TestTermGroup|TestTermSet"

Adds a new taxonomy field called “Test” that points to the TestTermSet which is located in the TestTermGroup

PARAMETERS

-AddToDefaultView

Switch Parameter if this field must be added to the default view

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-DisplayName

The display name of the field

Type: String
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

-FieldOptions

Specifies the control settings while adding a field. See https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.addfieldoptions.aspx for details

Type: AddFieldOptions
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Group

The group name to where this field belongs to

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Id

The ID for the field, must be unique

Type: GuidPipeBind
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-InternalName

The internal name of the field

Type: String
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

-List

The list object or name where this field needs to be added

Type: ListPipeBind
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-MultiValue

Switch Parameter if this Taxonomy field can hold multiple values

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Required

Switch Parameter if the field is a required field

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-TaxonomyItemId

The ID of the Taxonomy item

Type: GuidPipeBind
Parameter Sets: Id

Required: False
Position: Named
Accept pipeline input: False

-TermPathDelimiter

The path delimiter to be used, by default this is ‘|’

Type: String
Parameter Sets: Path

Required: False
Position: Named
Accept pipeline input: False

-TermSetPath

The path to the term that this needs to be bound

Type: String
Parameter Sets: Path

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Field

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPTeamsChannel

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Adds a channel to an existing Microsoft Teams instance.

SYNTAX

Add-PnPTeamsChannel -Team <TeamsTeamPipeBind>
                    -DisplayName <String>
                    [-Description <String>]
                    [-Private [<SwitchParameter>]]
                    [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPTeamsChannel -Team 4efdf392-8225-4763-9e7f-4edeb7f721aa -DisplayName "My Channel"

Adds a new channel to the specified Teams instance

——————EXAMPLE 2——————

Add-PnPTeamsChannel -Team MyTeam -DisplayName "My Channel"

Adds a new channel to the specified Teams instance

——————EXAMPLE 3——————

Add-PnPTeamsChannel -Team MyTeam -DisplayName "My Channel" -Private

Adds a new private channel to the specified Teams instance

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

An optional description of the channel.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisplayName

The display name of the new channel. Letters, numbers and spaces are allowed.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Private

Specify to mark the channel as private.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Team

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPTeamsTab

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Adds a tab to an existing Channel

SYNTAX

Add-PnPTeamsTab -TeamsAppId <String>
                -EntityId <String>
                -ContentUrl <String>
                -RemoveUrl <String>
                -WebSiteUrl <String>
                -Team <TeamsTeamPipeBind>
                -Channel <TeamsChannelPipeBind>
                -DisplayName <String>
                -Type <TeamTabType>
                [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPTeamsTab -Team "My Team" -Channel "My Channel" -DisplayName "My Channel" -Type WebSite -ContentUrl "https://aka.ms/sppnp

Adds a web site tab to the specified channel.

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Channel

Specify the channel id of the team to retrieve.

Type: TeamsChannelPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-ContentUrl

Specifies the title of the new site collection

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-DisplayName

Specify the tab type

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-EntityId

Specifies the title of the new site collection

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-RemoveUrl

Specifies the title of the new site collection

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Team

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-TeamsAppId

Specifies the title of the new site collection

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Type

Specify the tab type

Type: TeamTabType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-WebSiteUrl

Specifies the title of the new site collection

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPTeamsTeam

SYNOPSIS

Adds a Teams team to an existing, group connected, site collection

SYNTAX

Add-PnPTeamsTeam [-Connection <PnPConnection>]

DESCRIPTION

This command allows you to add a Teams team to an existing, Microsoft 365 group connected, site collection.

EXAMPLES

——————EXAMPLE 1——————

Add-PnPTeamsTeam

This create a teams team for the connected site collection

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPTeamsUser

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Adds a channel to an existing Microsoft Teams instance.

SYNTAX

Add-PnPTeamsUser -Team <TeamsTeamPipeBind>
                 -User <String>
                 -Role <String>
                 [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPTeamsUser -Team MyTeam -User john@doe.com -Role Owner

Adds a user as an owner to the team

——————EXAMPLE 2——————

Add-PnPTeamsUser -Team MyTeam -User john@doe.com -Role Member

Adds a user as a member to the team

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Role

Specify the role of the user

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Team

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-User

Specify the UPN (e.g. john@doe.com)

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPTenantCdnOrigin

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Adds a new origin to the public or private content delivery network (CDN).

SYNTAX

Add-PnPTenantCdnOrigin -OriginUrl <String>
                       -CdnType <SPOTenantCdnType>
                       [-Connection <PnPConnection>]

DESCRIPTION

Add a new origin to the public or private CDN, on either Tenant level or on a single Site level. Effectively, a tenant admin points out to a document library, or a folder in the document library and requests that content in that library should be retrievable by using a CDN.

You must be a SharePoint Online global administrator and a site collection administrator to run the cmdlet.

EXAMPLES

——————EXAMPLE 1——————

Add-PnPTenantCdnOrigin -OriginUrl /sites/site/subfolder -CdnType Public

This example configures a public CDN on site level.

PARAMETERS

-CdnType

Specifies the CDN type. The valid values are: public or private.

Type: SPOTenantCdnType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-OriginUrl

Specifies a path to the doc library to be configured. It can be provided in two ways: relative path, or a mask.

Relative-Relative path depends on the OriginScope. If the originScope is Tenant, a path must be a relative path under the tenant root. If the originScope is Site, a path must be a relative path under the given Site. The path must point to the valid Document Library or a folder with a document library.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPTenantSequence

SYNOPSIS

Adds a tenant sequence object to a tenant template

SYNTAX

Add-PnPTenantSequence -Template <ProvisioningHierarchy>
                      -Sequence <ProvisioningSequence>

EXAMPLES

——————EXAMPLE 1——————

Add-PnPTenantSequence -Template $mytemplate -Sequence $mysequence

Adds an existing sequence object to an existing template object

——————EXAMPLE 2——————

New-PnPTenantSequence -Id "MySequence" | Add-PnPTenantSequence -Template $template

Creates a new instance of a provisioning sequence object and sets the Id to the value specified, then the sequence is added to an existing template object

PARAMETERS

-Sequence

Optional Id of the sequence

Type: ProvisioningSequence
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: True

-Template

The template to add the sequence to

Type: ProvisioningHierarchy
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPTenantSequenceSite

SYNOPSIS

Adds a existing tenant sequence site object to a tenant template

SYNTAX

Add-PnPTenantSequenceSite -Site <ProvisioningSitePipeBind>
                          -Sequence <ProvisioningSequence>

EXAMPLES

——————EXAMPLE 1——————

Add-PnPTenantSequenceSite -Site $myteamsite -Sequence $mysequence

Adds an existing site object to an existing template sequence

PARAMETERS

-Sequence

The sequence to add the site to

Type: ProvisioningSequence
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Site

Type: ProvisioningSitePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPTenantSequenceSubSite

SYNOPSIS

Adds a tenant sequence sub site object to a tenant sequence site object

SYNTAX

Add-PnPTenantSequenceSubSite -SubSite <TeamNoGroupSubSite>
                             -Site <SiteCollection>

EXAMPLES

——————EXAMPLE 1——————

Add-PnPTenantSequenceSubSite -Site $mysite -SubSite $mysubsite

Adds an existing subsite object to an existing sequence site object

PARAMETERS

-Site

The site to add the subsite to

Type: SiteCollection
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-SubSite

The subsite to add

Type: TeamNoGroupSubSite
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPTenantTheme

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Adds or updates a theme to the tenant.

SYNTAX

Add-PnPTenantTheme -Identity <ThemePipeBind>
                   -Palette <ThemePalettePipeBind>
                   -IsInverted <Boolean>
                   [-Connection <PnPConnection>]

DESCRIPTION

Adds or updates a theme to the tenant.

EXAMPLES

——————EXAMPLE 1——————

$themepalette = @{
  "themePrimary" = "#00ffff";
  "themeLighterAlt" = "#f3fcfc";
  "themeLighter" = "#daffff";
  "themeLight" = "#affefe";
  "themeTertiary" = "#76ffff";
  "themeSecondary" = "#39ffff";
  "themeDarkAlt" = "#00c4c4";
  "themeDark" = "#009090";
  "themeDarker" = "#005252";
  "neutralLighterAlt" = "#f8f8f8";
  "neutralLighter" = "#f4f4f4";
  "neutralLight" = "#eaeaea";
  "neutralQuaternaryAlt" = "#dadada";
  "neutralQuaternary" = "#d0d0d0";
  "neutralTertiaryAlt" = "#c8c8c8";
  "neutralTertiary" = "#a6a6a6";
  "neutralSecondaryAlt" = "#767676";
  "neutralSecondary" = "#666666";
  "neutralPrimary" = "#333";
  "neutralPrimaryAlt" = "#3c3c3c";
  "neutralDark" = "#212121";
  "black" = "#000000";
  "white" = "#fff";
  "primaryBackground" = "#fff";
  "primaryText" = "#333"
 }
PS:>Add-PnPTenantTheme -Identity "MyCompanyTheme" -Palette $themepalette -IsInverted $false

This example adds a theme to the current tenant.

PARAMETERS

-Identity

The name of the theme to add or update

Type: ThemePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-IsInverted

If the theme is inverted or not

Type: Boolean
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Palette

The palette to add. See examples for more information.

Type: ThemePalettePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPUserToGroup

SYNOPSIS

Adds a user to a SharePoint group

SYNTAX

Internal

Add-PnPUserToGroup -LoginName <String>
                   -Identity <GroupPipeBind>
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

External

Add-PnPUserToGroup -Identity <GroupPipeBind>
                   -EmailAddress <String>
                   [-SendEmail [<SwitchParameter>]]
                   [-EmailBody <String>]
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPUserToGroup -LoginName user@company.com -Identity 'Marketing Site Members'

Add the specified user to the SharePoint group “Marketing Site Members”

——————EXAMPLE 2——————

Add-PnPUserToGroup -LoginName user@company.com -Identity 5

Add the specified user to the SharePoint group with Id 5

PARAMETERS

-EmailAddress

The email address of the user

Only applicable to: SharePoint Online

Type: String
Parameter Sets: External

Required: True
Position: Named
Accept pipeline input: False

-EmailBody

Only applicable to: SharePoint Online

Type: String
Parameter Sets: External

Required: False
Position: Named
Accept pipeline input: False

-Identity

The SharePoint group id, SharePoint group name or SharePoint group object to add the user to

Type: GroupPipeBind
Parameter Sets: Internal, External

Required: True
Position: Named
Accept pipeline input: True

-LoginName

The login name of the user

Type: String
Parameter Sets: Internal

Required: True
Position: Named
Accept pipeline input: False

-SendEmail

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: External

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPView

SYNOPSIS

Adds a view to a list

SYNTAX

Add-PnPView -List <ListPipeBind>
            -Title <String>
            -Fields <String[]>
            [-Query <String>]
            [-ViewType <ViewType>]
            [-RowLimit <UInt32>]
            [-Personal [<SwitchParameter>]]
            [-SetAsDefault [<SwitchParameter>]]
            [-Paged [<SwitchParameter>]]
            [-Aggregations <String>]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPView -List "Demo List" -Title "Demo View" -Fields "Title","Address"

Adds a view named “Demo view” to the “Demo List” list.

——————EXAMPLE 2——————

Add-PnPView -List "Demo List" -Title "Demo View" -Fields "Title","Address" -Paged

Adds a view named “Demo view” to the “Demo List” list and makes sure there’s paging on this view.

——————EXAMPLE 3——————

Add-PnPView -List "Demo List" -Title "Demo View" -Fields "Title","Address" -Aggregations "<FieldRef Name='Title' Type='COUNT'/>"

Adds a view named “Demo view” to the “Demo List” list and sets the totals (aggregations) to Count on the Title field.

PARAMETERS

-Aggregations

A valid XML fragment containing one or more Aggregations

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Fields

A list of fields to add.

Type: String[]
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-List

The ID or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Paged

If specified, the view will have paging.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Personal

If specified, a personal view will be created.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Query

A valid CAML Query.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RowLimit

The row limit for the view. Defaults to 30.

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SetAsDefault

If specified, the view will be set as the default view for the list.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

The title of the view.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ViewType

The type of view to add.

Type: ViewType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.View

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Add-PnPWebhookSubscription

SYNOPSIS

Adds a new Webhook subscription

SYNTAX

Add-PnPWebhookSubscription -NotificationUrl <String>
                           [-List <ListPipeBind>]
                           [-ExpirationDate <DateTime>]
                           [-ClientState <String>]
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPWebhookSubscription -List MyList -NotificationUrl https://my-func.azurewebsites.net/webhook

Add a Webhook subscription for the specified notification Url on the list MyList

——————EXAMPLE 2——————

Add-PnPWebhookSubscription -List MyList -NotificationUrl https://my-func.azurewebsites.net/webhook -ExpirationDate "2017-09-01"

Add a Webhook subscription for the specified notification Url on the list MyList with an expiration date set on September 1st, 2017

——————EXAMPLE 3——————

Add-PnPWebhookSubscription -List MyList -NotificationUrl https://my-func.azurewebsites.net/webhook -ExpirationDate "2017-09-01" -ClientState "Hello State!"

Add a Webhook subscription for the specified notification Url on the list MyList with an expiration date set on September 1st, 2017 with a specific client state

PARAMETERS

-ClientState

A client state information that will be passed through notifications

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ExpirationDate

The date at which the Webhook subscription will expire. (Default: 6 months from today)

Type: DateTime
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

The list object or name where the Webhook subscription will be added to

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-NotificationUrl

The URL of the Webhook endpoint that will be notified of the change

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

OfficeDevPnP.Core.Entities.WebhookSubscription

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPWebPartToWebPartPage

SYNOPSIS

Adds a web part to a web part page in a specified zone

SYNTAX

XML

Add-PnPWebPartToWebPartPage -Xml <String>
                            -ServerRelativePageUrl <String>
                            -ZoneId <String>
                            -ZoneIndex <Int>
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

FILE

Add-PnPWebPartToWebPartPage -Path <String>
                            -ServerRelativePageUrl <String>
                            -ZoneId <String>
                            -ZoneIndex <Int>
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPWebPartToWebPartPage -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Path "c:\myfiles\listview.webpart" -ZoneId "Header" -ZoneIndex 1 

This will add the web part as defined by the XML in the listview.webpart file to the specified page in the specified zone and with the order index of 1

——————EXAMPLE 2——————

Add-PnPWebPartToWebPartPage -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -XML $webpart -ZoneId "Header" -ZoneIndex 1 

This will add the web part as defined by the XML in the $webpart variable to the specified page in the specified zone and with the order index of 1

PARAMETERS

-Path

A path to a web part file on a the file system.

Type: String
Parameter Sets: FILE

Required: True
Position: Named
Accept pipeline input: False

-ServerRelativePageUrl

Server Relative Url of the page to add the web part to.

Type: String
Parameter Sets: (All)
Aliases: PageUrl

Required: True
Position: Named
Accept pipeline input: False

-Xml

A string containing the XML for the web part.

Type: String
Parameter Sets: XML

Required: True
Position: Named
Accept pipeline input: False

-ZoneId

The Zone Id where the web part must be placed

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ZoneIndex

The Zone Index where the web part must be placed

Type: Int
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPWebPartToWikiPage

SYNOPSIS

Adds a web part to a wiki page in a specified table row and column

SYNTAX

XML

Add-PnPWebPartToWikiPage -Xml <String>
                         -ServerRelativePageUrl <String>
                         -Row <Int>
                         -Column <Int>
                         [-AddSpace [<SwitchParameter>]]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

FILE

Add-PnPWebPartToWikiPage -Path <String>
                         -ServerRelativePageUrl <String>
                         -Row <Int>
                         -Column <Int>
                         [-AddSpace [<SwitchParameter>]]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPWebPartToWikiPage -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Path "c:\myfiles\listview.webpart" -Row 1 -Column 1

This will add the web part as defined by the XML in the listview.webpart file to the specified page in the first row and the first column of the HTML table present on the page

——————EXAMPLE 2——————

Add-PnPWebPartToWikiPage -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -XML $webpart -Row 1 -Column 1

This will add the web part as defined by the XML in the $webpart variable to the specified page in the first row and the first column of the HTML table present on the page

PARAMETERS

-AddSpace

Must there be a extra space between the web part

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Column

Column number where the web part must be placed

Type: Int
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Path

A path to a web part file on a the file system.

Type: String
Parameter Sets: FILE

Required: True
Position: Named
Accept pipeline input: False

-Row

Row number where the web part must be placed

Type: Int
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ServerRelativePageUrl

Full server relative url of the web part page, e.g. /sites/demo/sitepages/home.aspx

Type: String
Parameter Sets: (All)
Aliases: PageUrl

Required: True
Position: Named
Accept pipeline input: False

-Xml

A string containing the XML for the web part.

Type: String
Parameter Sets: XML

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPWikiPage

SYNOPSIS

Adds a wiki page

SYNTAX

WithContent

Add-PnPWikiPage -Content <String>
                -ServerRelativePageUrl <String>
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

WithLayout

Add-PnPWikiPage -Layout <WikiPageLayout>
                -ServerRelativePageUrl <String>
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPWikiPage -PageUrl '/sites/demo1/pages/wikipage.aspx' -Content 'New WikiPage'

Creates a new wiki page ‘/sites/demo1/pages/wikipage.aspx’ and sets the content to ‘New WikiPage’

PARAMETERS

-Content

Type: String
Parameter Sets: WithContent

Required: True
Position: Named
Accept pipeline input: False

-Layout

Type: WikiPageLayout
Parameter Sets: WithLayout

Required: True
Position: Named
Accept pipeline input: False

-ServerRelativePageUrl

The server relative page URL

Type: String
Parameter Sets: (All)
Aliases: PageUrl

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPWorkflowDefinition

SYNOPSIS

Adds a workflow definition

SYNTAX

Add-PnPWorkflowDefinition -Definition <WorkflowDefinition>
                          [-DoNotPublish [<SwitchParameter>]]
                          [-Web <WebPipeBind>]
                          [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPWorkflowDefinition -Definition $wfdef

Adds an existing workflow definition, retrieved by Get-PnPWorkflowDefinition, to a site.

PARAMETERS

-Definition

The workflow definition to add.

Type: WorkflowDefinition
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-DoNotPublish

Overrides the default behavior, which is to publish workflow definitions.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

System.Guid

Returns the Id of the workflow definition

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Add-PnPWorkflowSubscription

SYNOPSIS

Adds a workflow subscription to a list

SYNTAX

Add-PnPWorkflowSubscription -Name <String>
                            -DefinitionName <String>
                            -List <ListPipeBind>
                            -HistoryListName <String>
                            -TaskListName <String>
                            [-StartManually [<SwitchParameter>]]
                            [-StartOnCreated [<SwitchParameter>]]
                            [-StartOnChanged [<SwitchParameter>]]
                            [-AssociationValues <String>]
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Add-PnPWorkflowSubscription -Name MyWorkflow -DefinitionName SendMessageWf -list $list

Adds an Workflow with the name ‘SendMessageWf’ to the list $list.

——————EXAMPLE 2——————

$list | Add-PnPWorkflowSubscription -Name MyWorkflow -DefinitionName SendMessageWf

Adds an Workflow with the name “SendMessageWf” to the list $list.

——————EXAMPLE 3——————

Get-PnPList -Identity "MyCustomList" | Add-PnPWorkflowSubscription -Name MyWorkflow -DefinitionName SendMessageWf

Adds an Workflow with the name “SendMessageWf” to the list “MyCustomList”.

PARAMETERS

-AssociationValues

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DefinitionName

The name of the workflow definition

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-HistoryListName

The name of the History list

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-List

The list to add the workflow to

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Name

The name of the subscription

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-StartManually

Switch if the workflow should be started manually, default value is ‘true’

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-StartOnChanged

Should the workflow run when an item is changed

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-StartOnCreated

Should the workflow run when an new item is created

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TaskListName

The name of the task list

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Apply-PnPProvisioningTemplate

SYNOPSIS

Applies a site template to a web

SYNTAX

Instance

Apply-PnPProvisioningTemplate [-InputInstance <ProvisioningTemplate>]
                              [-TemplateId <String>]
                              [-ResourceFolder <String>]
                              [-OverwriteSystemPropertyBagValues [<SwitchParameter>]]
                              [-IgnoreDuplicateDataRowErrors [<SwitchParameter>]]
                              [-ProvisionContentTypesToSubWebs [<SwitchParameter>]]
                              [-ProvisionFieldsToSubWebs [<SwitchParameter>]]
                              [-ClearNavigation [<SwitchParameter>]]
                              [-Parameters <Hashtable>]
                              [-Handlers <Handlers>]
                              [-ExcludeHandlers <Handlers>]
                              [-ExtensibilityHandlers <ExtensibilityHandler[]>]
                              [-TemplateProviderExtensions <ITemplateProviderExtension[]>]
                              [-Web <WebPipeBind>]
                              [-Connection <PnPConnection>]

Path

Apply-PnPProvisioningTemplate -Path <String>
                              [-TemplateId <String>]
                              [-ResourceFolder <String>]
                              [-OverwriteSystemPropertyBagValues [<SwitchParameter>]]
                              [-IgnoreDuplicateDataRowErrors [<SwitchParameter>]]
                              [-ProvisionContentTypesToSubWebs [<SwitchParameter>]]
                              [-ProvisionFieldsToSubWebs [<SwitchParameter>]]
                              [-ClearNavigation [<SwitchParameter>]]
                              [-Parameters <Hashtable>]
                              [-Handlers <Handlers>]
                              [-ExcludeHandlers <Handlers>]
                              [-ExtensibilityHandlers <ExtensibilityHandler[]>]
                              [-TemplateProviderExtensions <ITemplateProviderExtension[]>]
                              [-Web <WebPipeBind>]
                              [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Apply-PnPProvisioningTemplate -Path template.xml

Applies a site template in XML format to the current web.

——————EXAMPLE 2——————

Apply-PnPProvisioningTemplate -Path template.xml -ResourceFolder c:\provisioning\resources

Applies a site template in XML format to the current web. Any resources like files that are referenced in the template will be retrieved from the folder as specified with the ResourceFolder parameter.

——————EXAMPLE 3——————

Apply-PnPProvisioningTemplate -Path template.xml -Parameters @{"ListTitle"="Projects";"parameter2"="a second value"}

Applies a site template in XML format to the current web. It will populate the parameter in the template the values as specified and in the template you can refer to those values with the {parameter:} token.

For instance with the example above, specifying {parameter:ListTitle} in your template will translate to ‘Projects’ when applying the template. These tokens can be used in most string values in a template.

——————EXAMPLE 4——————

Apply-PnPProvisioningTemplate -Path template.xml -Handlers Lists, SiteSecurity

Applies a site template in XML format to the current web. It will only apply the lists and site security part of the template.

——————EXAMPLE 5——————

Apply-PnPProvisioningTemplate -Path template.pnp

Applies a site template from a pnp package to the current web.

——————EXAMPLE 6——————

Apply-PnPProvisioningTemplate -Path https://tenant.sharepoint.com/sites/templatestorage/Documents/template.pnp

Applies a site template from a pnp package stored in a library to the current web.

——————EXAMPLE 7——————


$handler1 = New-PnPExtensibilityHandlerObject -Assembly Contoso.Core.Handlers -Type Contoso.Core.Handlers.MyExtensibilityHandler1
$handler2 = New-PnPExtensibilityHandlerObject -Assembly Contoso.Core.Handlers -Type Contoso.Core.Handlers.MyExtensibilityHandler2
Apply-PnPProvisioningTemplate -Path NewTemplate.xml -ExtensibilityHandlers $handler1,$handler2

This will create two new ExtensibilityHandler objects that are run while provisioning the template

——————EXAMPLE 8——————

Apply-PnPProvisioningTemplate -Path .\ -InputInstance $template

Applies a site template from an in-memory instance of a ProvisioningTemplate type of the PnP Core Component, reading the supporting files, if any, from the current (.) path. The syntax can be used together with any other supported parameters.

——————EXAMPLE 9——————

Apply-PnPProvisioningTemplate -Path .\template.xml -TemplateId "MyTemplate"

Applies the ProvisioningTemplate with the ID “MyTemplate” located in the template definition file template.xml.

PARAMETERS

-ClearNavigation

Override the RemoveExistingNodes attribute in the Navigation elements of the template. If you specify this value the navigation nodes will always be removed before adding the nodes in the template

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ExcludeHandlers

Allows you to run all handlers, excluding the ones specified.

Type: Handlers
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-ExtensibilityHandlers

Allows you to specify ExtensbilityHandlers to execute while applying a template

Type: ExtensibilityHandler[]
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Handlers

Allows you to only process a specific part of the template. Notice that this might fail, as some of the handlers require other artifacts in place if they are not part of what your applying. Visit https://docs.microsoft.com/dotnet/api/officedevpnp.core.framework.provisioning.model.handlers for possible values.

Type: Handlers
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-IgnoreDuplicateDataRowErrors

Ignore duplicate data row errors when the data row in the template already exists.

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-InputInstance

Allows you to provide an in-memory instance of the ProvisioningTemplate type of the PnP Core Component. When using this parameter, the -Path parameter refers to the path of any supporting file for the template.

Type: ProvisioningTemplate
Parameter Sets: Instance

Required: False
Position: Named
Accept pipeline input: False

-OverwriteSystemPropertyBagValues

Specify this parameter if you want to overwrite and/or create properties that are known to be system entries (starting with vti_, dlc_, etc.)

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Parameters

Allows you to specify parameters that can be referred to in the template by means of the {parameter:<Key>} token. See examples on how to use this parameter.

Type: Hashtable
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Path

Path to the xml or pnp file containing the provisioning template.

Type: String
Parameter Sets: Path

Required: True
Position: 0
Accept pipeline input: True

-ProvisionContentTypesToSubWebs

If set content types will be provisioned if the target web is a subweb.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ProvisionFieldsToSubWebs

If set fields will be provisioned if the target web is a subweb.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ResourceFolder

Root folder where resources/files that are being referenced in the template are located. If not specified the same folder as where the provisioning template is located will be used.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-TemplateId

ID of the template to use from the xml file containing the provisioning template. If not specified and multiple ProvisioningTemplate elements exist, the last one will be used.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-TemplateProviderExtensions

Allows you to specify ITemplateProviderExtension to execute while applying a template.

Type: ITemplateProviderExtension[]
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Apply-PnPTenantTemplate

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Applies a tenant template to the current tenant. You must have the Office 365 Global Admin role to run this cmdlet successfully.

SYNTAX

By Path

Apply-PnPTenantTemplate -Path <String>
                        [-SequenceId <String>]
                        [-ResourceFolder <String>]
                        [-Handlers <Handlers>]
                        [-ExcludeHandlers <Handlers>]
                        [-ExtensibilityHandlers <ExtensibilityHandler[]>]
                        [-TemplateProviderExtensions <ITemplateProviderExtension[]>]
                        [-Parameters <Hashtable>]
                        [-OverwriteSystemPropertyBagValues [<SwitchParameter>]]
                        [-IgnoreDuplicateDataRowErrors [<SwitchParameter>]]
                        [-ProvisionContentTypesToSubWebs [<SwitchParameter>]]
                        [-ProvisionFieldsToSubWebs [<SwitchParameter>]]
                        [-ClearNavigation [<SwitchParameter>]]
                        [-Configuration <ApplyConfigurationPipeBind>]
                        [-Connection <PnPConnection>]

By Object

Apply-PnPTenantTemplate -Template <ProvisioningHierarchy>
                        [-SequenceId <String>]
                        [-ResourceFolder <String>]
                        [-Handlers <Handlers>]
                        [-ExcludeHandlers <Handlers>]
                        [-ExtensibilityHandlers <ExtensibilityHandler[]>]
                        [-TemplateProviderExtensions <ITemplateProviderExtension[]>]
                        [-Parameters <Hashtable>]
                        [-OverwriteSystemPropertyBagValues [<SwitchParameter>]]
                        [-IgnoreDuplicateDataRowErrors [<SwitchParameter>]]
                        [-ProvisionContentTypesToSubWebs [<SwitchParameter>]]
                        [-ProvisionFieldsToSubWebs [<SwitchParameter>]]
                        [-ClearNavigation [<SwitchParameter>]]
                        [-Configuration <ApplyConfigurationPipeBind>]
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Apply-PnPTenantTemplate -Path myfile.pnp

Will read the tenant template from the filesystem and will apply the sequences in the template

——————EXAMPLE 2——————

Apply-PnPTenantTemplate -Path myfile.pnp -SequenceId "mysequence"

Will read the tenant template from the filesystem and will apply the specified sequence in the template

——————EXAMPLE 3——————

Apply-PnPTenantTemplate -Path myfile.pnp -Parameters @{"ListTitle"="Projects";"parameter2"="a second value"}

Applies a tenant template to the current tenant. It will populate the parameter in the template the values as specified and in the template you can refer to those values with the {parameter:} token.

For instance with the example above, specifying {parameter:ListTitle} in your template will translate to ‘Projects’ when applying the template. These tokens can be used in most string values in a template.

PARAMETERS

-ClearNavigation

Override the RemoveExistingNodes attribute in the Navigation elements of the template. If you specify this value the navigation nodes will always be removed before adding the nodes in the template

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Configuration

Specify a JSON configuration file to configure the extraction progress.

Type: ApplyConfigurationPipeBind
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-ExcludeHandlers

Allows you to run all handlers, excluding the ones specified.

Type: Handlers
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-ExtensibilityHandlers

Allows you to specify ExtensbilityHandlers to execute while applying a template

Type: ExtensibilityHandler[]
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Handlers

Allows you to only process a specific part of the template. Notice that this might fail, as some of the handlers require other artifacts in place if they are not part of what your applying.

Type: Handlers
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-IgnoreDuplicateDataRowErrors

Ignore duplicate data row errors when the data row in the template already exists.

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-OverwriteSystemPropertyBagValues

Specify this parameter if you want to overwrite and/or create properties that are known to be system entries (starting with vti_, dlc_, etc.)

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Parameters

Allows you to specify parameters that can be referred to in the tenant template by means of the {parameter:<Key>} token. See examples on how to use this parameter.

Type: Hashtable
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Path

Path to the xml or pnp file containing the tenant template.

Type: String
Parameter Sets: By Path

Required: True
Position: 0
Accept pipeline input: True

-ProvisionContentTypesToSubWebs

If set content types will be provisioned if the target web is a subweb.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ProvisionFieldsToSubWebs

If set fields will be provisioned if the target web is a subweb.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ResourceFolder

Root folder where resources/files that are being referenced in the template are located. If not specified the same folder as where the tenant template is located will be used.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-SequenceId

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Template

Type: ProvisioningHierarchy
Parameter Sets: By Object

Required: True
Position: 0
Accept pipeline input: True

-TemplateProviderExtensions

Allows you to specify ITemplateProviderExtension to execute while applying a template.

Type: ITemplateProviderExtension[]
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Approve-PnPTenantServicePrincipalPermissionRequest

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Approves a permission request for the current tenant’s “SharePoint Online Client” service principal

SYNTAX

Approve-PnPTenantServicePrincipalPermissionRequest -RequestId <GuidPipeBind>
                                                   [-Force [<SwitchParameter>]]
                                                   [-Connection <PnPConnection>]

DESCRIPTION

Approves a permission request for the current tenant’s “SharePoint Online Client” service principal

The return value of a successful call is a permission grant object.

To get the collection of permission grants for the “SharePoint Online Client” service principal, use the Get-PnPTenantServicePrincipalPermissionGrants command.

Approving a permission request also removes that request from the list of permission requests.

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RequestId

Type: GuidPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Clear-PnPDefaultColumnValues

SYNOPSIS

Clear default column values for a document library

SYNTAX

Clear-PnPDefaultColumnValues -List <ListPipeBind>
                             -Field <FieldPipeBind>
                             [-Folder <String>]
                             [-Web <WebPipeBind>]
                             [-Connection <PnPConnection>]

DESCRIPTION

Clear default column values for a document library, per folder, or for the root folder if the folder parameter has not been specified.

EXAMPLES

——————EXAMPLE 1——————

Clear-PnPDefaultColumnValues -List Documents -Field MyField

Clears the default value for the field MyField on a library

——————EXAMPLE 2——————

Clear-PnPDefaultColumnValues -List Documents -Field MyField -Folder A

Clears the default value for the field MyField on the folder A on a library

PARAMETERS

-Field

The internal name, id or a reference to a field

Type: FieldPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Folder

A library relative folder path, if not specified it will set the default column values on the root folder of the library ('/')

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

The ID, Name or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Clear-PnPListItemAsRecord

SYNOPSIS

Undeclares a list item as a record

SYNTAX

Clear-PnPListItemAsRecord -List <ListPipeBind>
                          -Identity <ListItemPipeBind>
                          [-Web <WebPipeBind>]
                          [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Clear-PnPListItemAsRecord -List "Documents" -Identity 4

Undeclares the document in the documents library with id 4 as a record

PARAMETERS

-Identity

The ID of the listitem, or actual ListItem object

Type: ListItemPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-List

The ID, Title or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Clear-PnPMicrosoft365GroupMember

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Directory.ReadWrite.All, Group.ReadWrite.All, GroupMember.ReadWrite.All

Removes all current members from a particular Microsoft 365 Group

SYNTAX

Clear-PnPMicrosoft365GroupMember -Identity <Microsoft365GroupPipeBind>
                                 [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Clear-PnPMicrosoft365GroupMember -Identity "Project Team"

Removes all the current members from the Microsoft 365 Group named “Project Team”

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Microsoft 365 Group to remove all members from

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and PracticesDocumentation

applicable: SharePoint Online schema: 2.0.0

Clear-PnPMicrosoft365GroupOwner

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Directory.ReadWrite.All, Group.ReadWrite.All

Removes all current owners from a particular Microsoft 365 Group (aka Unified Group)

SYNTAX

Clear-PnPMicrosoft365GroupOwner -Identity <Microsoft365GroupPipeBind>
                                [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Clear-PnPMicrosoft365GroupOwner -Identity "Project Team"

Removes all the current owners from the Microsoft 365 Group named “Project Team”

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Microsoft 365 Group to remove all owners from

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and PracticesDocumentation

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Clear-PnPRecycleBinItem

SYNOPSIS

Permanently deletes all or a specific recycle bin item

SYNTAX

All

Clear-PnPRecycleBinItem [-All [<SwitchParameter>]]
                        [-SecondStageOnly [<SwitchParameter>]]
                        [-Force [<SwitchParameter>]]
                        [-RowLimit <Int>]
                        [-Connection <PnPConnection>]

Identity

Clear-PnPRecycleBinItem -Identity <RecycleBinItemPipeBind>
                        [-Force [<SwitchParameter>]]
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPRecycleBinItem | ? FileLeafName -like "*.docx" | Clear-PnpRecycleBinItem

Permanently deletes all the items in the first and second stage recycle bins of which the file names have the .docx extension

——————EXAMPLE 2——————

Clear-PnpRecycleBinItem -Identity 72e4d749-d750-4989-b727-523d6726e442

Permanently deletes the recycle bin item with Id 72e4d749-d750-4989-b727-523d6726e442 from the recycle bin

——————EXAMPLE 3——————

Clear-PnpRecycleBinItem -Identity $item -Force

Permanently deletes the recycle bin item stored under variable $item from the recycle bin without asking for confirmation from the end user first

——————EXAMPLE 4——————

Clear-PnPRecycleBinItem -All -RowLimit 10000

Permanently deletes up to 10,000 items in the recycle bin

PARAMETERS

-All

Clears all items

Type: SwitchParameter
Parameter Sets: All

Required: False
Position: Named
Accept pipeline input: False

-Force

If provided, no confirmation will be asked to restore the recycle bin item

Type: SwitchParameter
Parameter Sets: Identity, All

Required: False
Position: Named
Accept pipeline input: False

-Identity

Id of the recycle bin item or the recycle bin item itself to permanently delete

Type: RecycleBinItemPipeBind
Parameter Sets: Identity

Required: True
Position: Named
Accept pipeline input: True

-RowLimit

Limits deletion to specified number of items

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: Int
Parameter Sets: All

Required: False
Position: Named
Accept pipeline input: False

-SecondStageOnly

If provided, only all the items in the second stage recycle bin will be cleared

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: All

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Clear-PnPTenantAppCatalogUrl

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Removes the url of the tenant scoped app catalog. It will not delete the site collection itself.

SYNTAX

Clear-PnPTenantAppCatalogUrl [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Clear-PnPTenantAppCatalogUrl

Removes the url of the tenant scoped app catalog

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Clear-PnPTenantRecycleBinItem

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Permanently deletes a site collection from the tenant scoped recycle bin

SYNTAX

Clear-PnPTenantRecycleBinItem -Url <String>
                              [-Wait [<SwitchParameter>]]
                              [-Force [<SwitchParameter>]]
                              [-Connection <PnPConnection>]

DESCRIPTION

The Clear-PnPTenantRecycleBinItem cmdlet allows a site collection that has been deleted and still exists in the tenant recycle bin to be permanently deleted from the recycle bin as well.

EXAMPLES

——————EXAMPLE 1——————

Clear-PnPTenantRecycleBinItem -Url https://tenant.sharepoint.com/sites/contoso

This will permanently delete site collection with the url ‘https://tenant.sharepoint.com/sites/contoso' from the tenant recycle bin

——————EXAMPLE 2——————

Clear-PnPTenantRecycleBinItem -Url https://tenant.sharepoint.com/sites/contoso -Wait

This will permanently delete site collection with the url ‘https://tenant.sharepoint.com/sites/contoso' from the tenant recycle bin and will wait with executing further PowerShell commands until the operation has completed

PARAMETERS

-Force

If provided, no confirmation will be asked to permanently delete the site collection from the tenant recycle bin

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Url

Url of the site collection to permanently delete from the tenant recycle bin

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Wait

If provided, the PowerShell execution will halt until the operation has completed

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Connect-PnPMicrosoftGraph

SYNOPSIS

Connect to the Microsoft Graph

SYNTAX

Scope

Connect-PnPMicrosoftGraph -Scopes <String[]>

AAD

Connect-PnPMicrosoftGraph -AppId <String>
                          -AppSecret <String>
                          -AADDomain <String>

DESCRIPTION

Uses the Microsoft Authentication Library (Preview) to connect to Azure AD and to get an OAuth 2.0 Access Token to consume the Microsoft Graph API

EXAMPLES

——————EXAMPLE 1——————

Connect-PnPMicrosoftGraph -Scopes $arrayOfScopes

Connects to Azure AD and gets and OAuth 2.0 Access Token to consume the Microsoft Graph API including the declared permission scopes. The available permission scopes are defined at the following URL: https://graph.microsoft.io/en-us/docs/authorization/permission_scopes

——————EXAMPLE 2——————

Connect-PnPMicrosoftGraph -AppId '<id>' -AppSecret '<secret>' -AADDomain 'contoso.onmicrosoft.com'

Connects to the Microsoft Graph API using application permissions via an app’s declared permission scopes. See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/Graph.ConnectUsingAppPermissions for a sample on how to get started.

PARAMETERS

-AADDomain

The AAD where the O365 app is registered. Eg.: contoso.com, or contoso.onmicrosoft.com.

Type: String
Parameter Sets: AAD

Required: True
Position: Named
Accept pipeline input: False

-AppId

The client id of the app which gives you access to the Microsoft Graph API.

Type: String
Parameter Sets: AAD

Required: True
Position: Named
Accept pipeline input: False

-AppSecret

The app key of the app which gives you access to the Microsoft Graph API.

Type: String
Parameter Sets: AAD

Required: True
Position: Named
Accept pipeline input: False

-Scopes

The array of permission scopes for the Microsoft Graph API.

Type: String[]
Parameter Sets: Scope

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Connect-PnPOnline

SYNOPSIS

Connect to a SharePoint site

SYNTAX

Main

Connect-PnPOnline -Url <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-Credentials <CredentialPipeBind>]
                  [-CurrentCredentials [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-AuthenticationMode <ClientAuthenticationMode>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

Token

Connect-PnPOnline -Url <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-Realm <String>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-AzureEnvironment <AzureEnvironment>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

ADFS with client Certificate

Connect-PnPOnline -Url <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-UseAdfsCert [<SwitchParameter>]]
                  [-ClientCertificate <X509Certificate2>]
                  [-LoginProviderName <String>]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

ADFS with user credentials

Connect-PnPOnline -Url <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-Credentials <CredentialPipeBind>]
                  [-UseAdfs [<SwitchParameter>]]
                  [-Kerberos [<SwitchParameter>]]
                  [-LoginProviderName <String>]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

Access Token

Connect-PnPOnline -AccessToken <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-Url <String>]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

Azure Active Directory using Scopes

Connect-PnPOnline -Scopes <String[]>
                  [-Credentials <CredentialPipeBind>]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

PnP Office 365 Management Shell to the Microsoft Graph

Connect-PnPOnline -Graph [<SwitchParameter>]
                  [-LaunchBrowser [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

Microsoft Graph using Azure Active Directory

Connect-PnPOnline -AADDomain <String>
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

WebLogin

Connect-PnPOnline -Url <String>
                  -UseWebLogin [<SwitchParameter>]
                  [-ReturnConnection [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

SPO Management Shell Credentials

Connect-PnPOnline -Url <String>
                  -SPOManagementShell [<SwitchParameter>]
                  [-ReturnConnection [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-ClearTokenCache [<SwitchParameter>]]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

PnP O365 Management Shell / DeviceLogin

Connect-PnPOnline -Url <String>
                  -PnPManagementShell [<SwitchParameter>]
                  [-ReturnConnection [<SwitchParameter>]]
                  [-LaunchBrowser [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

App-Only using a clientId and clientSecret and an URL

Connect-PnPOnline -Url <String>
                  -ClientSecret <String>
                  -ClientId <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-Realm <String>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-AzureEnvironment <AzureEnvironment>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

App-Only using a clientId and clientSecret and an AAD Domain

Connect-PnPOnline -ClientSecret <String>
                  -ClientId <String>
                  -AADDomain <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-Realm <String>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-NoTelemetry [<SwitchParameter>]]

Azure Active Directory

Connect-PnPOnline -Url <String>
                  -ClientId <String>
                  -RedirectUri <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-ClearTokenCache [<SwitchParameter>]]
                  [-AzureEnvironment <AzureEnvironment>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

App-Only with Azure Active Directory

Connect-PnPOnline -Url <String>
                  -ClientId <String>
                  -Tenant <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-CertificatePath <String>]
                  [-CertificateBase64Encoded <String>]
                  [-Certificate <X509Certificate2>]
                  [-CertificatePassword <SecureString>]
                  [-AzureEnvironment <AzureEnvironment>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

App-Only with Azure Active Directory using X502 certificates

Connect-PnPOnline -Url <String>
                  -ClientId <String>
                  -Tenant <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-AzureEnvironment <AzureEnvironment>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

High Trust using a X509Certificate2 object.

Connect-PnPOnline -Url <String>
                  -ClientId <String>
                  -HighTrustCertificate <X509Certificate2>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-HighTrustCertificateIssuerId <String>]
                  [-UserName <String>]
                  [-NoTelemetry [<SwitchParameter>]]

App-Only with Azure Active Directory using certificate from certificate store by thumbprint

Connect-PnPOnline -Url <String>
                  -ClientId <String>
                  -Tenant <String>
                  -Thumbprint <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-AzureEnvironment <AzureEnvironment>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

High Trust using a certificate from a PFX file.

Connect-PnPOnline -Url <String>
                  -ClientId <String>
                  -HighTrustCertificatePath <String>
                  -HighTrustCertificatePassword <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-HighTrustCertificateIssuerId <String>]
                  [-UserName <String>]
                  [-NoTelemetry [<SwitchParameter>]]

App-Only with Azure Active Directory using certificate as PEM strings

Connect-PnPOnline -Url <String>
                  -ClientId <String>
                  -Tenant <String>
                  -PEMCertificate <String>
                  -PEMPrivateKey <String>
                  [-ReturnConnection [<SwitchParameter>]]
                  [-MinimalHealthScore <Int>]
                  [-RetryCount <Int>]
                  [-RetryWait <Int>]
                  [-RequestTimeout <Int>]
                  [-CreateDrive [<SwitchParameter>]]
                  [-DriveName <String>]
                  [-CertificatePassword <SecureString>]
                  [-AzureEnvironment <AzureEnvironment>]
                  [-TenantAdminUrl <String>]
                  [-SkipTenantAdminCheck [<SwitchParameter>]]
                  [-IgnoreSslErrors [<SwitchParameter>]]
                  [-NoTelemetry [<SwitchParameter>]]

DESCRIPTION

Connects to a SharePoint site or another API and creates a context that is required for the other PnP Cmdlets. See https://github.com/pnp/PnP-PowerShell/wiki/Connect-options for more information on the options to connect and the APIs you can access with them.

EXAMPLES

——————EXAMPLE 1——————

Connect-PnPOnline -Url https://contoso.sharepoint.com

Connect to SharePoint prompting for the username and password. When a generic credential is added to the Windows Credential Manager with https://contoso.sharepoint.com, PowerShell will not prompt for username and password and use those stored credentials instead.

——————EXAMPLE 2——————

Connect-PnPOnline -Url https://contoso.sharepoint.com -Credentials (Get-Credential)

Connect to SharePoint prompting for the username and password to use to authenticate

——————EXAMPLE 3——————

Connect-PnPOnline -Url http://yourlocalserver -CurrentCredentials

Connect to SharePoint using the credentials of the current user logged in to the machine

——————EXAMPLE 4——————

Connect-PnPOnline -Url http://yourlocalserver -Credentials 'O365Creds'

Connect to SharePoint using credentials from the Windows Credential Manager, as defined by the label ‘O365Creds’

——————EXAMPLE 5——————

Connect-PnPOnline -Url http://yourlocalserver -Credentials (Get-Credential) -UseAdfs

Connect to SharePoint through ADFS prompting for the username and password to authenticate with

——————EXAMPLE 6——————

Connect-PnPOnline -Url http://yourlocalserver -UseAdfsCert

Connect to SharePoint through ADFS using client certificate allowing you to select the client certificate to use for authentication

——————EXAMPLE 7——————

Connect-PnPOnline -Url http://yourlocalserver -UseAdfsCert -ClientCertificate (Get-ChildItem -Path Cert:\CurrentUser\My\3A16F907D2BFFF1C22F447E55429C16F8BD3AC6E)

Connect to SharePoint through ADFS using the client certificate with thumbprint 3A16F907D2BFFF1C22F447E55429C16F8BD3AC6E from the local machine certificate store for the current user

——————EXAMPLE 8——————

Connect-PnPOnline -Url https://yourserver -Credentials (Get-Credential) -CreateDrive
cd SPO:\\
dir

This will prompt you for credentials and creates a context for the other PowerShell commands to use. It will also create a SPO:\ drive you can use to navigate around the site

——————EXAMPLE 9——————

Connect-PnPOnline -Url https://yourserver -Credentials (Get-Credential) -AuthenticationMode FormsAuthentication

This will prompt you for credentials and creates a context for the other PowerShell commands to use. It assumes your server is configured for Forms Based Authentication (FBA)

——————EXAMPLE 10——————

Connect-PnPOnline -Url https://contoso.sharepoint.de -ClientId 344b8aab-389c-4e4a-8fa1-4c1ae2c0a60d -ClientSecret a3f3faf33f3awf3a3sfs3f3ss3f4f4a3fawfas3ffsrrffssfd -AzureEnvironment Germany

This will authenticate you to the German Azure environment using the German Azure endpoints for authentication

——————EXAMPLE 11——————

Connect-PnPOnline -Url https://contoso.sharepoint.com -SPOManagementShell

This will authenticate you using the SharePoint Online Management Shell application

——————EXAMPLE 12——————

Connect-PnPOnline -Url https://contoso.sharepoint.com -PnPManagementShell

This will authenticate you using the PnP O365 Management Shell Multi-Tenant application. A browser window will have to be opened where you have to enter a code that is shown in your PowerShell window.

——————EXAMPLE 13——————

Connect-PnPOnline -Url https://contoso.sharepoint.com -PnPManagementShell -LaunchBrowser

This will authenticate you using the PnP O365 Management Shell Multi-Tenant application. A browser window will automatically open and the code you need to enter will be automatically copied to your clipboard.

——————EXAMPLE 14——————

Connect-PnPOnline -Url https://contoso.sharepoint.com -AccessToken $myaccesstoken

Connects using the provided access token

——————EXAMPLE 15——————

Connect-PnPOnline -Scopes "Mail.Read","Files.Read","ActivityFeed.Read"

Connects to Azure Active Directory interactively and gets an OAuth 2.0 Access Token to consume the resources of the declared permission scopes. It will utilize the Azure Active Directory enterprise application named PnP Management Shell with application id 31359c7f-bd7e-475c-86db-fdb8c937548e registered by the PnP team. If you want to connect using your own Azure Active Directory application registration, use one of the Connect-PnPOnline cmdlets using a -ClientId attribute instead and pre-assign the required permissions/scopes/roles in your application registration in Azure Active Directory. The available permission scopes for Microsoft Graph are defined at the following URL: https://docs.microsoft.com/graph/permissions-reference . If the requested scope(s) have been used with this connect cmdlet before, they will not be asked for consent again. You can request scopes from different APIs in one Connect, i.e. from Microsoft Graph and the Microsoft Office Management API. It will ask you to authenticate for each of the APIs you have listed scopes for.

——————EXAMPLE 16——————

Connect-PnPOnline -Scopes "Mail.Read","Files.Read","ActivityFeed.Read" -Credentials (New-Object System.Management.Automation.PSCredential ("johndoe@contoso.onmicrosoft.com", (ConvertTo-SecureString "password" -AsPlainText -Force)))

Connects to Azure Active Directory using delegated permissions and gets an OAuth 2.0 Access Token to consume the resources of the declared permission scopes. It will utilize the Azure Active Directory enterprise application named PnP Management Shell with application id 31359c7f-bd7e-475c-86db-fdb8c937548e registered by the PnP team. If you want to connect using your own Azure Active Directory application registration, use one of the Connect-PnPOnline cmdlets using a -ClientId attribute instead and pre-assign the required permissions/scopes/roles in your application registration in Azure Active Directory. The available permission scopes for Microsoft Graph are defined at the following URL: https://docs.microsoft.com/graph/permissions-reference . If the requested scope(s) have been used with this connect cmdlet before, they will not be asked for consent again. You can request scopes from different APIs in one Connect, i.e. from Microsoft Graph and the Microsoft Office Management API. You must have logged on interactively with the same scopes at least once without using -Credentials to allow for the permission grant dialog to show and allow constent for the user account you would like to use. You can provide this consent by logging in once with Connect-PnPOnline -Url -PnPManagementShell -LaunchBrowser, and provide consent. This is a one-time action. From that moment on you will be able to use the cmdlet as stated here.

——————EXAMPLE 17——————

certutil.exe -csp 'Microsoft Enhanced RSA and AES Cryptographic Provider' -v -p 'password' -importpfx -user c:\HighTrust.pfx NoRoot
Connect-PnPOnline -Url https://yourserver -ClientId <id> -HighTrustCertificate (Get-Item Cert:\CurrentUser\My\<thumbprint>)

Connect to an on-premises SharePoint environment using a high trust certificate, stored in the Personal certificate store of the current user.

——————EXAMPLE 18——————

Connect-PnPOnline -ClientId '<id>' -ClientSecret '<secret>' -AADDomain 'contoso.onmicrosoft.com'

Connects to the Microsoft Graph API using application permissions via an app’s declared permission scopes. See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/Graph.ConnectUsingAppPermissions for a sample on how to get started.

——————EXAMPLE 19——————

Connect-PnPOnline -Url https://yourserver -ClientId 763d5e60-b57e-426e-8e87-b7258f7f8188 -HighTrustCertificatePath c:\HighTrust.pfx -HighTrustCertificatePassword 'password' -HighTrustCertificateIssuerId 6b9534d8-c2c1-49d6-9f4b-cd415620bca8

Connect to an on-premises SharePoint environment using a high trust certificate stored in a .PFX file.

——————EXAMPLE 20——————

Connect-PnPOnline -Url https://contoso.sharepoint.com -ClientId '<id>' -Tenant 'contoso.onmicrosoft.com' -CertificatePath c:\absolute-path\to\pnp.pfx -CertificatePassword <if needed>

Connects to SharePoint using app-only tokens via an app’s declared permission scopes. See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/SharePoint.ConnectUsingAppPermissions for a sample on how to get started.

——————EXAMPLE 21——————

Connect-PnPOnline -ClientId <id> -CertificatePath 'c:\mycertificate.pfx' -CertificatePassword (ConvertTo-SecureString -AsPlainText 'myprivatekeypassword' -Force) -Url https://contoso.sharepoint.com -Tenant 'contoso.onmicrosoft.com'

Connects using an Azure Active Directory registered application using a locally available certificate containing a private key. See https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread for a sample on how to get started.

——————EXAMPLE 22——————

Connect-PnPOnline -Url https://contoso.sharepoint.com -ClientId '<id>' -Tenant 'contoso.onmicrosoft.com' -Thumbprint 34CFAA860E5FB8C44335A38A097C1E41EEA206AA

Connects to SharePoint using app-only tokens via an app’s declared permission scopes. See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/SharePoint.ConnectUsingAppPermissions for a sample on how to get started. Ensure you have imported the private key certificate, typically the .pfx file, into the Windows Certificate Store for the certificate with the provided thumbprint.

——————EXAMPLE 23——————

Connect-PnPOnline -ClientId <id> -CertificateBase64Encoded 'xxxx' -CertificatePassword (ConvertTo-SecureString -AsPlainText 'myprivatekeypassword' -Force) -Url https://contoso.sharepoint.com -Tenant 'contoso.onmicrosoft.com'

Connects using an Azure Active Directory registered application using a certificate containing a private key encoded in base 64 such as received in an Azure Function when using Azure KeyVault. See https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread for a sample on how to get started.

——————EXAMPLE 24——————

Connect-PnPOnline -Url https://contoso.sharepoint.com -ClientId '<id>' -Tenant 'contoso.onmicrosoft.com' -PEMCertificate <PEM string> -PEMPrivateKey <PEM string> -CertificatePassword <if needed>

Connects to SharePoint using app-only tokens via an app’s declared permission scopes. See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/SharePoint.ConnectUsingAppPermissions for a sample on how to get started.

——————EXAMPLE 25——————

Connect-PnPOnline -ClientId <id> -Certificate $cert -CertificatePassword (ConvertTo-SecureString -AsPlainText 'myprivatekeypassword' -Force) -Url https://contoso.sharepoint.com -Tenant 'contoso.onmicrosoft.com'

Connects using an Azure Active Directory registered application using a certificate instance containing a private key. See https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread for a sample on how to get started.

——————EXAMPLE 26——————

Connect-PnPOnline -Url https://contoso.sharepoint.com -ClientId '<id>' -Tenant 'contoso.onmicrosoft.com' -Certificate <X509Certificate2>

Connects to SharePoint using app-only auth in combination with a certificate. See https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread#using-this-principal-in-your-powershell-script-using-the-pnp-sites-core-library for a sample on how to get started.

PARAMETERS

-AADDomain

The AAD where the O365 app is registered. Eg.: contoso.com, or contoso.onmicrosoft.com.

Only applicable to: SharePoint Online

Type: String
Parameter Sets: Microsoft Graph using Azure Active Directory, App-Only using a clientId and clientSecret and an AAD Domain

Required: True
Position: Named
Accept pipeline input: False

-AccessToken

Connect with an existing Access Token

Only applicable to: SharePoint Online

Type: String
Parameter Sets: Access Token

Required: True
Position: Named
Accept pipeline input: False

-AuthenticationMode

Specify to use for instance use forms based authentication (FBA)

Type: ClientAuthenticationMode
Parameter Sets: Main

Required: False
Position: Named
Accept pipeline input: False

-AzureEnvironment

The Azure environment to use for authentication, the defaults to ‘Production’ which is the main Azure environment.

Only applicable to: SharePoint Online

Type: AzureEnvironment
Parameter Sets: Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory using X502 certificates, Token, App-Only using a clientId and clientSecret and an URL

Required: False
Position: Named
Accept pipeline input: False

-Certificate

X509Certificate2 reference containing the private key to authenticate the requests to SharePoint Online

Only applicable to: SharePoint Online

Type: X509Certificate2
Parameter Sets: App-Only with Azure Active Directory

Required: False
Position: Named
Accept pipeline input: False

-CertificateBase64Encoded

Base64 Encoded X509Certificate2 certificate containing the private key to authenticate the requests to SharePoint Online such as retrieved in Azure Functions from Azure KeyVault

Only applicable to: SharePoint Online

Type: String
Parameter Sets: App-Only with Azure Active Directory

Required: False
Position: Named
Accept pipeline input: False

-CertificatePassword

Password to the certificate (*.pfx)

Only applicable to: SharePoint Online

Type: SecureString
Parameter Sets: App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings

Required: False
Position: Named
Accept pipeline input: False

-CertificatePath

Path to the certificate containing the private key (*.pfx)

Only applicable to: SharePoint Online

Type: String
Parameter Sets: App-Only with Azure Active Directory

Required: False
Position: Named
Accept pipeline input: False

-ClearTokenCache

Clears the token cache.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Azure Active Directory, SPO Management Shell Credentials

Required: False
Position: Named
Accept pipeline input: False

-ClientCertificate

The client certificate which you want to use for the ADFS authentication

Type: X509Certificate2
Parameter Sets: ADFS with client Certificate

Required: False
Position: Named
Accept pipeline input: False

-ClientId

The Client ID of the Azure AD Application

Type: String
Parameter Sets: Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory using X502 certificates, App-Only using a clientId and clientSecret and an URL, App-Only using a clientId and clientSecret and an AAD Domain

Required: True
Position: Named
Accept pipeline input: False

-ClientSecret

The client secret to use.

Type: String
Parameter Sets: App-Only using a clientId and clientSecret and an URL, App-Only using a clientId and clientSecret and an AAD Domain

Required: True
Position: Named
Accept pipeline input: False

-CreateDrive

If you want to create a PSDrive connected to the URL

Type: SwitchParameter
Parameter Sets: Main, Token, App-Only using a clientId and clientSecret and an URL, App-Only using a clientId and clientSecret and an AAD Domain, WebLogin, ADFS with client Certificate, ADFS with user credentials, Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory using X502 certificates, SPO Management Shell Credentials, Access Token

Required: False
Position: Named
Accept pipeline input: False

-Credentials

Credentials of the user to connect with. Either specify a PSCredential object or a string. In case of a string value a lookup will be done to the Generic Credentials section of the Windows Credentials in the Windows Credential Manager for the correct credentials.

Type: CredentialPipeBind
Parameter Sets: Main, ADFS with user credentials, Azure Active Directory using Scopes

Required: False
Position: Named
Accept pipeline input: False

-CurrentCredentials

If you want to connect with the current user credentials

Type: SwitchParameter
Parameter Sets: Main

Required: False
Position: Named
Accept pipeline input: False

-DriveName

Name of the PSDrive to create (default: SPO)

Type: String
Parameter Sets: Main, Token, App-Only using a clientId and clientSecret and an URL, App-Only using a clientId and clientSecret and an AAD Domain, WebLogin, ADFS with client Certificate, ADFS with user credentials, Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory using X502 certificates, SPO Management Shell Credentials, Access Token

Required: False
Position: Named
Accept pipeline input: False

-Graph

Log in using the PnP O365 Management Shell application towards the Graph. You will be asked to consent to:

  • Read and write managed metadata
  • Have full control of all site collections
  • Read user profiles
  • Invite guest users to the organization
  • Read and write all groups
  • Read and write directory data
  • Read and write identity providers
  • Access the directory as you

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: PnP Office 365 Management Shell to the Microsoft Graph

Required: True
Position: Named
Accept pipeline input: False

-HighTrustCertificate

The certificate which has been registered in SharePoint as a Trusted Security Token issuer to use for the High Trust connection. Note that CNG key storage providers are not supported.

Only applicable to: SharePoint Server 2019, SharePoint Server 2016, SharePoint Server 2013

Type: X509Certificate2
Parameter Sets: High Trust using a X509Certificate2 object.

Required: True
Position: Named
Accept pipeline input: False

-HighTrustCertificateIssuerId

The IssuerID under which the certificate has been registered in SharePoint as a Trusted Security Token issuer to use for the High Trust connection. Uses the ClientID if not specified.

Only applicable to: SharePoint Server 2019, SharePoint Server 2016, SharePoint Server 2013

Type: String
Parameter Sets: High Trust using a X509Certificate2 object., High Trust using a certificate from a PFX file.

Required: False
Position: Named
Accept pipeline input: False

-HighTrustCertificatePassword

The password of the private key certificate (.pfx) to use for the High Trust connection

Only applicable to: SharePoint Server 2019, SharePoint Server 2016, SharePoint Server 2013

Type: String
Parameter Sets: High Trust using a certificate from a PFX file.

Required: True
Position: Named
Accept pipeline input: False

-HighTrustCertificatePath

The path to the private key certificate (.pfx) to use for the High Trust connection

Only applicable to: SharePoint Server 2019, SharePoint Server 2016, SharePoint Server 2013

Type: String
Parameter Sets: High Trust using a certificate from a PFX file.

Required: True
Position: Named
Accept pipeline input: False

-IgnoreSslErrors

Ignores any SSL errors. To be used i.e. when connecting to a SharePoint farm using self signed certificates or using a certificate authority not trusted by this machine.

Type: SwitchParameter
Parameter Sets: Main, Token, App-Only using a clientId and clientSecret and an URL, WebLogin, ADFS with client Certificate, ADFS with user credentials, Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory using X502 certificates, Microsoft Graph using Azure Active Directory, Azure Active Directory using Scopes, PnP Office 365 Management Shell to the Microsoft Graph, SPO Management Shell Credentials

Required: False
Position: Named
Accept pipeline input: False

-Kerberos

Authenticate using Kerberos to ADFS

Type: SwitchParameter
Parameter Sets: ADFS with user credentials

Required: False
Position: Named
Accept pipeline input: False

-LaunchBrowser

Launch a browser automatically and copy the code to enter to the clipboard

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: PnP O365 Management Shell / DeviceLogin, PnP Office 365 Management Shell to the Microsoft Graph

Required: False
Position: Named
Accept pipeline input: False

-LoginProviderName

The name of the ADFS trusted login provider

Type: String
Parameter Sets: ADFS with client Certificate, ADFS with user credentials

Required: False
Position: Named
Accept pipeline input: False

-MinimalHealthScore

Specifies a minimal server healthscore before any requests are executed

Type: Int
Parameter Sets: Main, Token, App-Only using a clientId and clientSecret and an URL, App-Only using a clientId and clientSecret and an AAD Domain, WebLogin, ADFS with client Certificate, ADFS with user credentials, Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory using X502 certificates, SPO Management Shell Credentials, Access Token

Required: False
Position: Named
Accept pipeline input: False

-NoTelemetry

In order to help to make PnP PowerShell better, we can track anonymous telemetry. We track the version of the cmdlets you are using, which cmdlet you are executing and which version of SharePoint you are connecting to. Use Disable-PnPPowerShellTelemetry to turn this off in general or use the -NoTelemetry switch to turn it off for that session.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PEMCertificate

PEM encoded certificate

Only applicable to: SharePoint Online

Type: String
Parameter Sets: App-Only with Azure Active Directory using certificate as PEM strings

Required: True
Position: Named
Accept pipeline input: False

-PEMPrivateKey

PEM encoded private key for the certificate

Only applicable to: SharePoint Online

Type: String
Parameter Sets: App-Only with Azure Active Directory using certificate as PEM strings

Required: True
Position: Named
Accept pipeline input: False

-PnPManagementShell

Log in using the PnP O365 Management Shell application. You will be asked to consent to:

  • Read and write managed metadata
  • Have full control of all site collections
  • Read user profiles
  • Invite guest users to the organization
  • Read and write all groups
  • Read and write directory data
  • Read and write identity providers
  • Access the directory as you

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: PnP O365 Management Shell / DeviceLogin
Aliases: PnPO365ManagementShell

Required: True
Position: Named
Accept pipeline input: False

-Realm

Authentication realm. If not specified will be resolved from the url specified.

Type: String
Parameter Sets: Token, App-Only using a clientId and clientSecret and an URL, App-Only using a clientId and clientSecret and an AAD Domain

Required: False
Position: Named
Accept pipeline input: False

-RedirectUri

The Redirect URI of the Azure AD Application

Only applicable to: SharePoint Online

Type: String
Parameter Sets: Azure Active Directory

Required: True
Position: Named
Accept pipeline input: False

-RequestTimeout

The request timeout. Default is 1800000

Type: Int
Parameter Sets: Main, Token, App-Only using a clientId and clientSecret and an URL, App-Only using a clientId and clientSecret and an AAD Domain, WebLogin, ADFS with client Certificate, ADFS with user credentials, Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory using X502 certificates, SPO Management Shell Credentials, Access Token

Required: False
Position: Named
Accept pipeline input: False

-RetryCount

Defines how often a retry should be executed if the server healthscore is not sufficient. Default is 10 times.

Type: Int
Parameter Sets: Main, Token, App-Only using a clientId and clientSecret and an URL, App-Only using a clientId and clientSecret and an AAD Domain, WebLogin, ADFS with client Certificate, ADFS with user credentials, Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory using X502 certificates, SPO Management Shell Credentials, Access Token

Required: False
Position: Named
Accept pipeline input: False

-RetryWait

Defines how many seconds to wait before each retry. Default is 1 second.

Type: Int
Parameter Sets: Main, Token, App-Only using a clientId and clientSecret and an URL, App-Only using a clientId and clientSecret and an AAD Domain, WebLogin, ADFS with client Certificate, ADFS with user credentials, Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory using X502 certificates, SPO Management Shell Credentials, Access Token

Required: False
Position: Named
Accept pipeline input: False

-ReturnConnection

Returns the connection for use with the -Connection parameter on cmdlets.

Type: SwitchParameter
Parameter Sets: Main, Token, App-Only using a clientId and clientSecret and an URL, App-Only using a clientId and clientSecret and an AAD Domain, WebLogin, ADFS with client Certificate, ADFS with user credentials, Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory using X502 certificates, SPO Management Shell Credentials, Access Token, PnP O365 Management Shell / DeviceLogin

Required: False
Position: Named
Accept pipeline input: True

-Scopes

The array of permission scopes to request from Azure Active Directory

Only applicable to: SharePoint Online

Type: String[]
Parameter Sets: Azure Active Directory using Scopes

Required: True
Position: Named
Accept pipeline input: False

-SkipTenantAdminCheck

Should we skip the check if this site is the Tenant admin site. Default is false

Type: SwitchParameter
Parameter Sets: Main, Token, App-Only using a clientId and clientSecret and an URL, WebLogin, ADFS with client Certificate, ADFS with user credentials, Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory using X502 certificates, SPO Management Shell Credentials, Access Token

Required: False
Position: Named
Accept pipeline input: False

-SPOManagementShell

Log in using the SharePoint Online Management Shell application

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: SPO Management Shell Credentials

Required: True
Position: Named
Accept pipeline input: False

-Tenant

The Azure AD Tenant name,e.g. mycompany.onmicrosoft.com

Only applicable to: SharePoint Online

Type: String
Parameter Sets: App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory, App-Only with Azure Active Directory using X502 certificates

Required: True
Position: Named
Accept pipeline input: False

-TenantAdminUrl

The url to the Tenant Admin site. If not specified, the cmdlets will assume to connect automatically to https://<tenantname>-admin.sharepoint.com where appropriate.

Type: String
Parameter Sets: Main, Token, App-Only using a clientId and clientSecret and an URL, WebLogin, ADFS with client Certificate, ADFS with user credentials, Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, App-Only with Azure Active Directory using X502 certificates, SPO Management Shell Credentials

Required: False
Position: Named
Accept pipeline input: False

-Thumbprint

The thumbprint of the certificate containing the private key registered with the application in Azure Active Directory

Only applicable to: SharePoint Online

Type: String
Parameter Sets: App-Only with Azure Active Directory using certificate from certificate store by thumbprint

Required: True
Position: Named
Accept pipeline input: False

-Url

The Url of the site collection to connect to

Type: String
Parameter Sets: Main, Token, App-Only using a clientId and clientSecret and an URL, WebLogin, ADFS with client Certificate, ADFS with user credentials, Azure Active Directory, App-Only with Azure Active Directory, App-Only with Azure Active Directory using certificate as PEM strings, App-Only with Azure Active Directory using X502 certificates, App-Only with Azure Active Directory using certificate from certificate store by thumbprint, SPO Management Shell Credentials, Access Token, PnP O365 Management Shell / DeviceLogin

Required: True
Position: 0
Accept pipeline input: True

-UseAdfs

If you want to connect to SharePoint using ADFS and credentials

Type: SwitchParameter
Parameter Sets: ADFS with user credentials

Required: False
Position: Named
Accept pipeline input: False

-UseAdfsCert

If you want to connect to SharePoint farm using ADFS with a client certificate

Type: SwitchParameter
Parameter Sets: ADFS with client Certificate

Required: False
Position: Named
Accept pipeline input: False

-UserName

Name of the user (login name) on whose behalf to create the access token. Supported input formats are SID and User Principal Name (UPN) in the format user@domain.local. If the parameter is not specified, an App Only Context is created.

Only applicable to: SharePoint Server 2019, SharePoint Server 2016, SharePoint Server 2013

Type: String
Parameter Sets: High Trust using a X509Certificate2 object., High Trust using a certificate from a PFX file.

Required: False
Position: Named
Accept pipeline input: False

-UseWebLogin

If you want to connect to SharePoint with browser based login. This is required when you have multi-factor authentication (MFA) enabled.

Type: SwitchParameter
Parameter Sets: WebLogin

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Convert-PnPFolderToProvisioningTemplate

SYNOPSIS

Creates a pnp package file of an existing template xml, and includes all files in the current folder

SYNTAX

Convert-PnPFolderToProvisioningTemplate -Out <String>
                                        [-Force [<SwitchParameter>]]
                                        [-Folder <String>]

EXAMPLES

——————EXAMPLE 1——————

Convert-PnPFolderToProvisioningTemplate -Out template.pnp

Creates a pnp package file of an existing template xml, and includes all files in the current folder

——————EXAMPLE 2——————

Convert-PnPFolderToProvisioningTemplate -Out template.pnp -Folder c:\temp

Creates a pnp package file of an existing template xml, and includes all files in the c:\temp folder

PARAMETERS

-Folder

Folder to process. If not specified the current folder will be used.

Type: String
Parameter Sets: (All)

Required: False
Position: 1
Accept pipeline input: False

-Force

Overwrites the output file if it exists.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Out

Filename to write to, optionally including full path.

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Convert-PnPProvisioningTemplate

SYNOPSIS

Converts a provisioning template to an other schema version

SYNTAX

Convert-PnPProvisioningTemplate -Path <String>
                                [-Out <String>]
                                [-Encoding <Encoding>]
                                [-Force [<SwitchParameter>]]
                                [-ToSchema <XMLPnPSchemaVersion>]

EXAMPLES

——————EXAMPLE 1——————

Convert-PnPProvisioningTemplate -Path template.xml

Converts a provisioning template to the latest schema and outputs the result to current console.

——————EXAMPLE 2——————

Convert-PnPProvisioningTemplate -Path template.xml -Out newtemplate.xml

Converts a provisioning template to the latest schema and outputs the result the newtemplate.xml file.

——————EXAMPLE 3——————

Convert-PnPProvisioningTemplate -Path template.xml -Out newtemplate.xml -ToSchema V201512

Converts a provisioning template to the latest schema using the 201512 schema and outputs the result the newtemplate.xml file.

PARAMETERS

-Encoding

The encoding type of the XML file, Unicode is default

Type: Encoding
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Force

Overwrites the output file if it exists

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Out

Filename to write to, optionally including full path

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Path

Path to the xml file containing the site template

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-ToSchema

The schema of the output to use, defaults to the latest schema

Type: XMLPnPSchemaVersion
Parameter Sets: (All)

Required: False
Position: 1
Accept pipeline input: False

SharePoint Developer Patterns and PracticesEncoding

applicable: SharePoint Online schema: 2.0.0

ConvertTo-PnPClientSidePage

SYNOPSIS

Converts a classic page (wiki or web part page) into a Client-Side Page

SYNTAX

ConvertTo-PnPClientSidePage -Identity <PagePipeBind>
                            [-Library <String>]
                            [-Folder <String>]
                            [-WebPartMappingFile <String>]
                            [-Overwrite [<SwitchParameter>]]
                            [-TakeSourcePageName [<SwitchParameter>]]
                            [-ReplaceHomePageWithDefault [<SwitchParameter>]]
                            [-AddPageAcceptBanner [<SwitchParameter>]]
                            [-SkipItemLevelPermissionCopyToClientSidePage [<SwitchParameter>]]
                            [-SkipUrlRewriting [<SwitchParameter>]]
                            [-SkipDefaultUrlRewriting [<SwitchParameter>]]
                            [-UrlMappingFile <String>]
                            [-ClearCache [<SwitchParameter>]]
                            [-CopyPageMetadata [<SwitchParameter>]]
                            [-AddTableListImageAsImageWebPart [<SwitchParameter>]]
                            [-UseCommunityScriptEditor [<SwitchParameter>]]
                            [-SummaryLinksToHtml [<SwitchParameter>]]
                            [-TargetWebUrl <String>]
                            [-LogType <ClientSidePageTransformatorLogType>]
                            [-LogFolder <String>]
                            [-LogSkipFlush [<SwitchParameter>]]
                            [-LogVerbose [<SwitchParameter>]]
                            [-DontPublish [<SwitchParameter>]]
                            [-KeepPageCreationModificationInformation [<SwitchParameter>]]
                            [-SetAuthorInPageHeader [<SwitchParameter>]]
                            [-PostAsNews [<SwitchParameter>]]
                            [-DisablePageComments [<SwitchParameter>]]
                            [-PublishingPage [<SwitchParameter>]]
                            [-BlogPage [<SwitchParameter>]]
                            [-DelveBlogPage [<SwitchParameter>]]
                            [-DelveKeepSubTitle [<SwitchParameter>]]
                            [-PageLayoutMapping <String>]
                            [-PublishingTargetPageName <String>]
                            [-TargetPageName <String>]
                            [-TargetPageFolder <String>]
                            [-TargetPageFolderOverridesDefaultFolder [<SwitchParameter>]]
                            [-RemoveEmptySectionsAndColumns [<SwitchParameter>]]
                            [-TargetConnection <PnPConnection>]
                            [-SkipUserMapping [<SwitchParameter>]]
                            [-UserMappingFile <String>]
                            [-TermMappingFile <String>]
                            [-SkipTermStoreMapping [<SwitchParameter>]]
                            [-LDAPConnectionString <String>]
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Overwrite

Converts a wiki/web part page named ‘somepage’ to a client side page

——————EXAMPLE 2——————

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Overwrite -WebPartMappingFile c:\contoso\webpartmapping.xml

Converts a wiki/web part page named ‘somepage’ to a client side page using a custom provided mapping file

——————EXAMPLE 3——————

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Overwrite -AddPageAcceptBanner

Converts a wiki/web part page named ‘somepage’ to a client side page and adds the page accept banner web part on top of the page. This requires that the SPFX solution holding the web part (https://github.com/SharePoint/sp-dev-modernization/blob/master/Solutions/PageTransformationUI/assets/sharepointpnp-pagetransformation-client.sppkg?raw=true) has been installed to the tenant app catalog

——————EXAMPLE 4——————

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Overwrite -CopyPageMetadata

Converts a wiki/web part page named ‘somepage’ to a client side page, including the copying of the page metadata (if any)

——————EXAMPLE 5——————

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -PublishingPage -Overwrite -TargetWebUrl https://contoso.sharepoint.com/sites/targetmodernsite

Converts a publishing page named ‘somepage’ to a client side page in the https://contoso.sharepoint.com/sites/targetmodernsite site

——————EXAMPLE 6——————

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -PublishingPage -Overwrite -TargetConnection $target

Converts a publishing page named ‘somepage’ to a client side page in the site specified by the TargetConnection connection. This allows to read a page in one environment (on-premises, tenant A) and create in another online location (tenant B)

——————EXAMPLE 7——————

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Library "SiteAssets" -Folder "Folder1" -Overwrite

Converts a web part page named ‘somepage’ living inside the SiteAssets library in a folder named folder1 into a client side page

——————EXAMPLE 8——————

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Folder "<root>" -Overwrite

Converts a web part page named ‘somepage’ living inside the root of the site collection (so outside of a library)

——————EXAMPLE 9——————

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Overwrite -TargetWebUrl https://contoso.sharepoint.com/sites/targetmodernsite

Converts a wiki/web part page named ‘somepage’ to a client side page in the https://contoso.sharepoint.com/sites/targetmodernsite site

——————EXAMPLE 10——————

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -LogType File -LogFolder c:\temp -LogVerbose -Overwrite

Converts a wiki/web part page named ‘somepage’ and creates a log file in c:\temp using verbose logging

——————EXAMPLE 11——————

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -LogType SharePoint -LogSkipFlush

Converts a wiki/web part page named ‘somepage’ and creates a log file in SharePoint but skip the actual write. Use this option to make multiple ConvertTo-PnPClientSidePage invocations create a single log

——————EXAMPLE 12——————

ConvertTo-PnPClientSidePage -Identity "My post title" -BlogPage -LogType Console -Overwrite -TargetWebUrl https://contoso.sharepoint.com/sites/targetmodernsite

Converts a blog page with a title starting with ‘my post title’ to a client side page in the https://contoso.sharepoint.com/sites/targetmodernsite site

——————EXAMPLE 13——————

ConvertTo-PnPClientSidePage -Identity "My post title" -DelveBlogPage -LogType Console -Overwrite -TargetWebUrl https://contoso.sharepoint.com/sites/targetmodernsite

Converts a Delve blog page with a title starting with ‘my post title’ to a client side page in the https://contoso.sharepoint.com/sites/targetmodernsite site

——————EXAMPLE 14——————

ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -PublishingPage -Overwrite -TargetConnection $target -UserMappingFile c:\\temp\user_mapping_file.csv

Converts a publishing page named ‘somepage’ to a client side page in the site specified by the TargetConnection connection. This allows to read a page in on-premises environment and create in another online locations including using specific user mappings between the two environments.

PARAMETERS

-AddPageAcceptBanner

Adds the page accept banner web part. The actual web part is specified in webpartmapping.xml file

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-AddTableListImageAsImageWebPart

When an image lives inside a table/list then it’s also created as separate image web part underneath that table/list by default. Use this switch set to $false to change that

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-BlogPage

I’m transforming a blog page

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ClearCache

Clears the cache. Can be needed if you’ve installed a new web part to the site and want to use that in a custom webpartmapping file. Restarting your PS session has the same effect

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CopyPageMetadata

Copies the page metadata to the created modern page

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DelveBlogPage

I’m transforming a Delve blog page

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DelveKeepSubTitle

Transform the possible sub title as topic header on the modern page

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisablePageComments

Disable comments for the created modern page

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DontPublish

Don’t publish the created modern page

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Folder

The folder to load the provided page from. If not provided all folders are searched

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Identity

The name of the page to convert

Type: PagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-KeepPageCreationModificationInformation

Keep the author, editor, created and modified information from the source page (when source page lives in SPO)

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LDAPConnectionString

Specifies a LDAP connection string e.g. LDAP://OU=Users,DC=Contoso,DC=local

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Library

The name of the library containing the page. If SitePages then please omit this parameter

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-LogFolder

Folder in where the log file will be created (if LogType==File)

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LogSkipFlush

By default each cmdlet invocation will result in a log file, use the -SkipLogFlush to delay the log flushing. The first call without -SkipLogFlush will then write all log entries to a single log

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LogType

Allows to generate a transformation log (File | SharePoint)

Type: ClientSidePageTransformatorLogType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LogVerbose

Configure logging to include verbose log entries

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Overwrite

Overwrites page if already existing

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PageLayoutMapping

Path and name of the page layout mapping file driving the publishing page transformation

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-PostAsNews

Post the created, and published, modern page as news

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PublishingPage

I’m transforming a publishing page

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PublishingTargetPageName

Name for the target page (only applies to publishing page transformation)

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RemoveEmptySectionsAndColumns

Remove empty sections and columns after transformation of the page

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ReplaceHomePageWithDefault

Replaces a home page with a default stock modern home page

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SetAuthorInPageHeader

Set’s the author of the source page as author in the modern page header (when source page lives in SPO)

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SkipDefaultUrlRewriting

Set this flag to prevent the default URL rewriting while you still want to do URL rewriting using a custom URL mapping file

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SkipItemLevelPermissionCopyToClientSidePage

By default the item level permissions on a page are copied to the created client side page. Use this switch to prevent the copy

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SkipTermStoreMapping

Disables term mapping during transformation

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SkipUrlRewriting

If transforming cross site then by default urls in html and summarylinks are rewritten for the target site. Set this flag to prevent that

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SkipUserMapping

Disables user mapping during transformation

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SummaryLinksToHtml

By default summarylinks web parts are replaced by QuickLinks, but you can transform to plain html by setting this switch

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TakeSourcePageName

Created client side page takes name from previous classic page. Classic page gets renamed to previous_<Page>.aspx

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TargetConnection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TargetPageFolder

Folder to create the target page in (will be used in conjunction with auto-generated folders that ensure page name uniqueness)

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TargetPageFolderOverridesDefaultFolder

When setting a target page folder then the target page folder overrides possibly default folder path (e.g. in the source page lived in a folder) instead of being appended to it

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TargetPageName

Name for the target page (only applies when doing cross site page transformation)

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TargetWebUrl

Url of the target web that will receive the modern page. Defaults to null which means in-place transformation

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TermMappingFile

Specifies a taxonomy term mapping file

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-UrlMappingFile

File holding custom URL mapping definitions

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-UseCommunityScriptEditor

Uses the community script editor (https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-script-editor) as replacement for the classic script editor web part

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-UserMappingFile

Specifies a user mapping file

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-WebPartMappingFile

Path and name of the web part mapping file driving the transformation

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Copy-PnPFile

SYNOPSIS

Copies a file or folder to a different location. This location can be within the same document library, same site, same site collection or even to another site collection on the same tenant. Currently there is a 200MB file size limit for the file or folder to be copied.

SYNTAX

Copy-PnPFile -SourceUrl <String>
             -TargetUrl <String>
             [-OverwriteIfAlreadyExists [<SwitchParameter>]]
             [-Force [<SwitchParameter>]]
             [-SkipSourceFolderName [<SwitchParameter>]]
             [-IgnoreVersionHistory [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

SOURCEURL

Copy-PnPFile -SourceUrl <String>
             -TargetUrl <String>
             [-OverwriteIfAlreadyExists [<SwitchParameter>]]
             [-Force [<SwitchParameter>]]
             [-SkipSourceFolderName [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

PS:>Copy-PnPFile -SourceUrl Documents/MyDocs -TargetUrl /sites/otherproject/Documents -SkipSourceFolderName -OverwriteIfAlreadyExists

Copies a folder named MyDocs in the document library called Documents located in the current site to the root folder of the library named Documents in the site collection otherproject.

——————EXAMPLE 2——————

PS:>Copy-PnPFile -ServerRelativeUrl "/sites/project/Shared Documents/company.docx" -TargetServerRelativeLibrary "/sites/otherproject/Shared Documents"

Copies a file named company.docx located in a document library called Shared Documents in the site collection project to the Shared Documents library in the site collection otherproject. If a file named company.docx already exists, it won’t perform the copy.

——————EXAMPLE 3——————

PS:>Copy-PnPFile -SourceUrl Documents/company.docx -TargetUrl /sites/otherproject/Documents/company.docx

Copies a file named company.docx located in a document library called Documents in the current site to the site collection otherproject. If a file named company.docx already exists, it won’t perform the copy.

——————EXAMPLE 4——————

PS:>Copy-PnPFile -ServerRelativeUrl "/sites/project/Shared Documents/Archive" -TargetServerRelativeLibrary "/sites/otherproject/Shared Documents" -OverwriteIfAlreadyExists

Copies a folder named Archive located in a document library called Shared Documents in the site collection project to the Shared Documents library in the site collection otherproject. If a folder named Archive already exists, it will overwrite it.

——————EXAMPLE 5——————

PS:>Copy-PnPFile -SourceUrl Documents/company.docx -TargetUrl Documents/company2.docx

Copies a file named company.docx located in a document library called Documents to a new document named company2.docx in the same library.

——————EXAMPLE 6——————

PS:>Copy-PnPFile -SourceUrl Documents/company.docx -TargetUrl Documents2/company.docx

Copies a file named company.docx located in a document library called Documents to a document library called Documents2 in the same site.

——————EXAMPLE 7——————

PS:>Copy-PnPFile -SourceUrl Documents/company.docx -TargetUrl Subsite/Documents/company2.docx

Copies a file named company.docx located in a document library called Documents to the document library named Document in a subsite named Subsite as a new document named company2.docx.

——————EXAMPLE 8——————

PS:>Copy-PnPFile -SourceUrl Documents/company.docx -TargetUrl Subsite/Documents

Copies a file named company.docx located in a document library called Documents to the document library named Document in a subsite named Subsite keeping the file name.

——————EXAMPLE 9——————

PS:>Copy-PnPFile -SourceUrl Documents/company.docx -TargetUrl /sites/otherproject/Documents/company.docx -OverwriteIfAlreadyExists

Copies a file named company.docx located in a document library called Documents in the current site to the site collection otherproject. If a file named company.docx already exists, it will still perform the copy and replace the original company.docx file.

——————EXAMPLE 10——————

PS:>Copy-PnPFile -SourceUrl Documents/MyDocs -TargetUrl /sites/otherproject/Documents -OverwriteIfAlreadyExists

Copies a folder named MyDocs in the document library called Documents located in the current site to the site collection otherproject. If the MyDocs folder exist it will copy into it, if not it will be created.

——————EXAMPLE 11——————

PS:>Copy-PnPFile -SourceUrl Documents/MyDocs -TargetUrl /sites/otherproject/Documents/MyDocs -SkipSourceFolderName -OverwriteIfAlreadyExists

Copies a folder named MyDocs in the MyDocs folder of the library named Documents. If the MyDocs folder does not exists, it will be created.

——————EXAMPLE 12——————

PS:>Copy-PnPFile -SourceUrl Documents/MyDocs -TargetUrl /sites/otherproject/Documents/MyDocs -OverwriteIfAlreadyExists

Copies a folder named MyDocs in the root of the library named Documents. If the MyDocs folder exists in the target, a subfolder also named MyDocs is created.

——————EXAMPLE 13——————

PS:>Copy-PnPFile -SourceUrl SubSite1/Documents/company.docx -TargetUrl SubSite2/Documents

Copies a file named company.docx in the library named Documents in SubSite1 to the library named Documents in SubSite2.

PARAMETERS

-Force

If provided, no confirmation will be requested and the action will be performed

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IgnoreVersionHistory

If provided, only the latest version of the document will be copied and its history will be discared. If not provided, all historical versions will be copied along.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-OverwriteIfAlreadyExists

If provided, if a file already exists at the TargetUrl, it will be overwritten. If omitted, the copy operation will be canceled if the file already exists at the TargetUrl location.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SkipSourceFolderName

If the source is a folder, the source folder name will not be created, only the contents within it

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SourceUrl

Site or server relative Url specifying the file or folder to copy. Must include the file name if it’s a file or the entire path to the folder if it’s a folder.

Type: String
Parameter Sets: (All)
Aliases: SiteRelativeUrl,ServerRelativeUrl

Required: True
Position: 0
Accept pipeline input: True

-TargetUrl

Server relative Url where to copy the file or folder to. Must not include the file name.

Type: String
Parameter Sets: (All)
Aliases: TargetServerRelativeLibrary

Required: True
Position: 1
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Copy-PnPItemProxy

SYNOPSIS

Proxy cmdlet for using Copy-Item between SharePoint provider and FileSystem provider

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Deny-PnPTenantServicePrincipalPermissionRequest

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Denies a permission request for the current tenant’s “SharePoint Online Client” service principal

SYNTAX

Deny-PnPTenantServicePrincipalPermissionRequest -RequestId <GuidPipeBind>
                                                [-Force [<SwitchParameter>]]
                                                [-Connection <PnPConnection>]

DESCRIPTION

Denies a permission request for the current tenant’s “SharePoint Online Client” service principal

Denying a permission request removes that request from the list of permission requests.

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RequestId

Type: GuidPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Disable-PnPFeature

SYNOPSIS

Disables a feature

SYNTAX

Disable-PnPFeature -Identity <GuidPipeBind>
                   [-Force [<SwitchParameter>]]
                   [-Scope <FeatureScope>]
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

DESCRIPTION

Deactivates a feature that was active on a site

EXAMPLES

——————EXAMPLE 1——————

Disable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe

This will disable the feature with the id “99a00f6e-fb81-4dc7-8eac-e09c6f9132fe”

——————EXAMPLE 2——————

Disable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Force

This will disable the feature with the id “99a00f6e-fb81-4dc7-8eac-e09c6f9132fe” with force.

——————EXAMPLE 3——————

Disable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Scope Web

This will disable the feature with the id “99a00f6e-fb81-4dc7-8eac-e09c6f9132fe” with the web scope.

PARAMETERS

-Force

Specifies whether to continue if an error occurs when deactivating the feature.

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Identity

The id of the feature to disable.

Type: GuidPipeBind
Parameter Sets: __AllParameterSets

Required: True
Position: 0
Accept pipeline input: False

-Scope

Specify the scope of the feature to deactivate, either Web or Site. Defaults to Web.

Type: FeatureScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Disable-PnPInPlaceRecordsManagementForSite

SYNOPSIS

Disables in place records management for a site.

SYNTAX

Disable-PnPInPlaceRecordsManagementForSite [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Disable-PnPInPlaceRecordsManagementForSite

The in place records management feature will be disabled

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Disable-PnPPowerShellTelemetry

SYNOPSIS

Disables PnP PowerShell telemetry tracking

SYNTAX

Disable-PnPPowerShellTelemetry [-Force [<SwitchParameter>]]

DESCRIPTION

Disables PnP PowerShell telemetry tracking

EXAMPLES

——————EXAMPLE 1——————

Disable-PnPPowerShellTelemetry

Will prompt you to confirm to disable telemetry tracking.

——————EXAMPLE 2——————

Disable-PnPPowerShellTelemetry -Force

Will disable telemetry tracking without prompting.

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Disable-PnPResponsiveUI

SYNOPSIS

Deactivate the PnP Response UI add-on

SYNTAX

Disable-PnPResponsiveUI [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

DESCRIPTION

Disables the PnP Responsive UI implementation on a classic SharePoint Site

EXAMPLES

——————EXAMPLE 1——————

Disable-PnPResponsiveUI

If enabled previously, this will remove the PnP Responsive UI from a site.

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Disable-PnPSharingForNonOwnersOfSite

SYNOPSIS

Configures the site to only allow sharing of the site and items in the site by owners

SYNTAX

Disable-PnPSharingForNonOwnersOfSite [-Identity <SitePipeBind>]
                                     [-Connection <PnPConnection>]

DESCRIPTION

Configures the site to only allow sharing of the site and items in the site by owners. At this point there is no interface available yet to undo this action through script. You will have to do so through the user interface of SharePoint.

EXAMPLES

——————EXAMPLE 1——————

Disable-PnPSharingForNonOwnersOfSite

Restricts sharing of the site and items in the site only to owners

PARAMETERS

-Identity

Type: SitePipeBind
Parameter Sets: (All)
Aliases: Url

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Disable-PnPSiteClassification

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Directory.ReadWrite.All

Disables Site Classifications for the tenant

SYNTAX

Disable-PnPSiteClassification [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Disable-PnPSiteClassification

Disables Site Classifications for your tenant.

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Disable-PnPTenantServicePrincipal

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Enables the current tenant’s “SharePoint Online Client” service principal.

SYNTAX

Disable-PnPTenantServicePrincipal [-Force [<SwitchParameter>]]
                                  [-Connection <PnPConnection>]

DESCRIPTION

Enables the current tenant’s “SharePoint Online Client” service principal.

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Disconnect-PnPOnline

SYNOPSIS

Disconnects the context

SYNTAX

Disconnect-PnPOnline [-Connection <PnPConnection>]

DESCRIPTION

Disconnects the current context and requires you to build up a new connection in order to use the Cmdlets again. Using Connect-PnPOnline to connect to a different site has the same effect.

EXAMPLES

——————EXAMPLE 1——————

Disconnect-PnPOnline

This will clear out all active tokens

PARAMETERS

-Connection

Connection to be used by cmdlet

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Enable-PnPCommSite

SYNOPSIS

Enables the modern communication site experience on a classic team site.

SYNTAX

Enable-PnPCommSite [-DesignPackageId <String>]
                   [-Connection <PnPConnection>]

DESCRIPTION

This command will enable the modern site experience on a classic team site. The site must be the root site of the site collection.

EXAMPLES

——————EXAMPLE 1——————

Enable-PnPCommSite

Enables the modern communication site experience on a classic team site

——————EXAMPLE 2——————

Enable-PnPCommSite -DesignPackageId 6142d2a0-63a5-4ba0-aede-d9fefca2c767

Enables the modern communication site experience on a classic team site, allowing to specify the design package to be applied

PARAMETERS

-DesignPackageId

The id (guid) of the design package to apply: 96c933ac-3698-44c7-9f4a-5fd17d71af9e (Topic = default), 6142d2a0-63a5-4ba0-aede-d9fefca2c767 (Showcase) or f6cc5403-0d63-442e-96c0-285923709ffc (Blank)

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Enable-PnPFeature

SYNOPSIS

Enables a feature

SYNTAX

Enable-PnPFeature -Identity <GuidPipeBind>
                  [-Force [<SwitchParameter>]]
                  [-Scope <FeatureScope>]
                  [-Sandboxed [<SwitchParameter>]]
                  [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Enable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe

This will enable the feature with the id “99a00f6e-fb81-4dc7-8eac-e09c6f9132fe”

——————EXAMPLE 2——————

Enable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Force

This will enable the feature with the id “99a00f6e-fb81-4dc7-8eac-e09c6f9132fe” with force.

——————EXAMPLE 3——————

Enable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Scope Web

This will enable the feature with the id “99a00f6e-fb81-4dc7-8eac-e09c6f9132fe” with the web scope.

PARAMETERS

-Force

Specifies whether to overwrite an existing feature with the same feature identifier. This parameter is ignored if there are no errors.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The id of the feature to enable.

Type: GuidPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Sandboxed

Specify this parameter if the feature you’re trying to activate is part of a sandboxed solution.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Scope

Specify the scope of the feature to activate, either Web or Site. Defaults to Web.

Type: FeatureScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Enable-PnPInPlaceRecordsManagementForSite

SYNOPSIS

Enables in place records management for a site.

SYNTAX

Enable-PnPInPlaceRecordsManagementForSite [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Enable-PnPInPlaceRecordsManagementForSite

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

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Enable-PnPPowerShellTelemetry

SYNOPSIS

Enables PnP PowerShell telemetry tracking.

SYNTAX

Enable-PnPPowerShellTelemetry [-Force [<SwitchParameter>]]

DESCRIPTION

In order to help to make PnP PowerShell better, we can track anonymous telemetry. We track the version of the cmdlets you are using, which cmdlet you are executing and which version of SharePoint you are connecting to. Use Disable-PnPPowerShellTelemetry to turn this off, alternative, use the -NoTelemetry switch on Connect-PnPOnline to turn it off for that session.

EXAMPLES

——————EXAMPLE 1——————

Enable-PnPPowerShellTelemetry

Will prompt you to confirm to enable telemetry tracking.

——————EXAMPLE 2——————

Enable-PnPPowerShellTelemetry -Force

Will enable telemetry tracking without prompting.

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Enable-PnPResponsiveUI

SYNOPSIS

Activates the PnP Response UI Add-on

SYNTAX

Enable-PnPResponsiveUI [-InfrastructureSiteUrl <String>]
                       [-Web <WebPipeBind>]
                       [-Connection <PnPConnection>]

DESCRIPTION

Enables the PnP Responsive UI implementation on a classic SharePoint Site

EXAMPLES

——————EXAMPLE 1——————

Enable-PnPResponsiveUI

Will upload a CSS file, a JavaScript file and adds a custom action to the root web of the current site collection, enabling the responsive UI on the site collection. The CSS and JavaScript files are located in the style library, in a folder called SP.Responsive.UI.

PARAMETERS

-InfrastructureSiteUrl

A full URL pointing to an infrastructure site. If specified, it will add a custom action pointing to the responsive UI JS code in that site.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Enable-PnPSiteClassification

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Directory.ReadWrite.All

Enables Site Classifications for the tenant

SYNTAX

Enable-PnPSiteClassification -Classifications <String>
                             -DefaultClassification <String>
                             [-UsageGuidelinesUrl <String>]
                             [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Connect-PnPOnline -Scopes "Directory.ReadWrite.All"
Enable-PnPSiteClassification -Classifications "HBI","LBI","Top Secret" -DefaultClassification "LBI"

Enables Site Classifications for your tenant and provides three classification values. The default value will be set to “LBI”

——————EXAMPLE 2——————

Connect-PnPOnline -Scopes "Directory.ReadWrite.All"
Enable-PnPSiteClassification -Classifications "HBI","LBI","Top Secret" -UsageGuidelinesUrl https://aka.ms/sppnp

Enables Site Classifications for your tenant and provides three classification values. The usage guideliness will be set to the specified URL.

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Classifications

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-DefaultClassification

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-UsageGuidelinesUrl

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Enable-PnPTenantServicePrincipal

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Enables the current tenant’s “SharePoint Online Client” service principal.

SYNTAX

Enable-PnPTenantServicePrincipal [-Force [<SwitchParameter>]]
                                 [-Connection <PnPConnection>]

DESCRIPTION

Enables the current tenant’s “SharePoint Online Client” service principal.

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Export-PnPClientSidePage

SYNOPSIS

Exports a Client Side Page to a PnP Provisioning Template

SYNTAX

Export-PnPClientSidePage -Identity <ClientSidePagePipeBind>
                         [-PersistBrandingFiles [<SwitchParameter>]]
                         [-Out <String>]
                         [-Force [<SwitchParameter>]]
                         [-Configuration <ExtractConfigurationPipeBind>]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Export-PnPClientSidePage -Identity Home.aspx 

Exports the page ‘Home.aspx’ to a new PnP Provisioning Template

PARAMETERS

-Configuration

Specify a JSON configuration file to configure the extraction progress.

Type: ExtractConfigurationPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Force

Specify to override the question to overwrite a file if it already exists.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The name of the page

Type: ClientSidePagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Out

If specified the template will be saved to the file specified with this parameter.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PersistBrandingFiles

If specified referenced files will be exported to the current folder.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Export-PnPClientSidePageMapping

SYNOPSIS

Get’s the built-in maping files or a custom mapping file for your publishing portal page layouts. These mapping files are used to tailor the page transformation experience.

SYNTAX

Export-PnPClientSidePageMapping [-BuiltInWebPartMapping [<SwitchParameter>]]
                                [-BuiltInPageLayoutMapping [<SwitchParameter>]]
                                [-CustomPageLayoutMapping [<SwitchParameter>]]
                                [-PublishingPage <PagePipeBind>]
                                [-AnalyzeOOBPageLayouts [<SwitchParameter>]]
                                [-Folder <String>]
                                [-Overwrite [<SwitchParameter>]]
                                [-Logging [<SwitchParameter>]]
                                [-Web <WebPipeBind>]
                                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Export-PnPClientSidePageMapping -BuiltInPageLayoutMapping -CustomPageLayoutMapping -Folder c:\\temp -Overwrite

Exports the built in page layout mapping and analyzes the current site’s page layouts and exports these to files in folder c:\temp

——————EXAMPLE 2——————

Export-PnPClientSidePageMapping -CustomPageLayoutMapping -PublishingPage mypage.aspx -Folder c:\\temp -Overwrite

Analyzes the page layout of page mypage.aspx and exports this to a file in folder c:\temp

——————EXAMPLE 3——————

Export-PnPClientSidePageMapping -BuiltInWebPartMapping -Folder c:\\temp -Overwrite

Exports the built in webpart mapping to a file in folder c:\temp. Use this a starting basis if you want to tailer the web part mapping behavior.

PARAMETERS

-AnalyzeOOBPageLayouts

Set this flag if you also want to analyze the OOB page layouts…typically these are covered via the default mapping, but if you’ve updated these page layouts you might want to analyze them again

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-BuiltInPageLayoutMapping

Exports the builtin pagelayout mapping file (only needed for publishing page transformation)

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-BuiltInWebPartMapping

Exports the builtin web part mapping file

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CustomPageLayoutMapping

Analyzes the pagelayouts in the current publishing portal and exports them as a pagelayout mapping file

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Folder

The folder to created the mapping file(s) in

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Logging

Outputs analyser logging to the console

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Overwrite

Overwrites existing mapping files

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PublishingPage

The name of the publishing page to export a page layout mapping file for

Type: PagePipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Export-PnPListToProvisioningTemplate

SYNOPSIS

Exports one or more lists to provisioning template

SYNTAX

Export-PnPListToProvisioningTemplate -List <String>
                                     [-Out <String>]
                                     [-Force [<SwitchParameter>]]
                                     [-OutputInstance [<SwitchParameter>]]
                                     [-Schema <XMLPnPSchemaVersion>]
                                     [-Web <WebPipeBind>]
                                     [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Export-PnPListToProvisioningTemplate -Out template.xml -List "Documents"

Extracts a list to a new provisioning template including the list specified by title or ID.

——————EXAMPLE 2——————

Export-PnPListToProvisioningTemplate -Out template.pnp -List "Documents","Events"

Extracts a list to a new provisioning template Office Open XML file, including the lists specified by title or ID.

PARAMETERS

-Force

Overwrites the output file if it exists.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

Specify the lists to extract, either providing their ID or their Title.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Out

Filename to write to, optionally including full path

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-OutputInstance

Returns the template as an in-memory object, which is an instance of the ProvisioningTemplate type of the PnP Core Component. It cannot be used together with the -Out parameter.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Schema

The schema of the output to use, defaults to the latest schema

Type: XMLPnPSchemaVersion
Parameter Sets: (All)

Required: False
Position: 1
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Export-PnPTaxonomy

SYNOPSIS

Exports a taxonomy to either the output or to a file.

SYNTAX

TermSet

Export-PnPTaxonomy [-TermSetId <GuidPipeBind>]
                   [-TermStoreName <String>]
                   [-Lcid <Int>]
                   [-IncludeID [<SwitchParameter>]]
                   [-Path <String>]
                   [-Force [<SwitchParameter>]]
                   [-Delimiter <String>]
                   [-Encoding <Encoding>]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Export-PnPTaxonomy

Exports the full taxonomy to the standard output

——————EXAMPLE 2——————

Export-PnPTaxonomy -Path c:\output.txt

Exports the full taxonomy the file output.txt

——————EXAMPLE 3——————

Export-PnPTaxonomy -Path c:\output.txt -TermSetId f6f43025-7242-4f7a-b739-41fa32847254

Exports the term set with the specified id

——————EXAMPLE 4——————

Export-PnPTaxonomy -Path c:\output.txt -TermSetId f6f43025-7242-4f7a-b739-41fa32847254 -Lcid 1044

Exports the term set with the specified id using Norwegian labels

PARAMETERS

-Delimiter

The path delimiter to be used, by default this is ‘|’

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Encoding

Defaults to Unicode

Type: Encoding
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Force

Overwrites the output file if it exists.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeID

If specified will include the ids of the taxonomy items in the output. Format: <label>;#<guid>

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Lcid

Specify the language code for the exported terms

Type: Int
Parameter Sets: TermSet

Required: False
Position: Named
Accept pipeline input: False

-Path

File to export the data to.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TermSetId

If specified, will export the specified termset only

Type: GuidPipeBind
Parameter Sets: TermSet

Required: False
Position: Named
Accept pipeline input: False

-TermStoreName

Term store to export; if not specified the default term store is used.

Type: String
Parameter Sets: TermSet

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Export-PnPTermGroupToXml

SYNOPSIS

Exports a taxonomy TermGroup to either the output or to an XML file.

SYNTAX

Export-PnPTermGroupToXml [-Identity <Id, Title or TermGroup>]
                         [-Out <String>]
                         [-FullTemplate [<SwitchParameter>]]
                         [-Encoding <Encoding>]
                         [-Force [<SwitchParameter>]]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Export-PnPTermGroupToXml

Exports all term groups in the default site collection term store to the standard output

——————EXAMPLE 2——————

Export-PnPTermGroupToXml -Out output.xml

Exports all term groups in the default site collection term store to the file ‘output.xml’ in the current folder

——————EXAMPLE 3——————

Export-PnPTermGroupToXml -Out c:\output.xml -Identity "Test Group"

Exports the term group with the specified name to the file ‘output.xml’ located in the root folder of the C: drive.

——————EXAMPLE 4——————

$termgroup = Get-PnPTermGroup -GroupName Test
$termgroup | Export-PnPTermGroupToXml -Out c:\output.xml

Retrieves a termgroup and subsequently exports that term group to a the file named ‘output.xml’

PARAMETERS

-Encoding

Defaults to Unicode

Type: Encoding
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Force

Overwrites the output file if it exists.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-FullTemplate

If specified, a full provisioning template structure will be returned

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The ID or name of the termgroup

Type: Id, Title or TermGroup
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Out

File to export the data to.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Find-PnPFile

SYNOPSIS

Finds a file in the virtual file system of the web.

SYNTAX

Web

Find-PnPFile -Match <String>
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

List

Find-PnPFile -Match <String>
             -List <ListPipeBind>
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

Folder

Find-PnPFile -Match <String>
             -Folder <FolderPipeBind>
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Find-PnPFile -Match *.master

Will return all masterpages located in the current web.

——————EXAMPLE 2——————

Find-PnPFile -List "Documents" -Match *.pdf

Will return all pdf files located in given list.

——————EXAMPLE 3——————

Find-PnPFile -Folder "Shared Documents/Sub Folder" -Match *.docx

Will return all docx files located in given folder.

PARAMETERS

-Folder

Folder object or relative url of a folder to query

Type: FolderPipeBind
Parameter Sets: Folder

Required: True
Position: Named
Accept pipeline input: False

-List

List title, url or an actual List object to query

Type: ListPipeBind
Parameter Sets: List

Required: True
Position: Named
Accept pipeline input: False

-Match

Wildcard query

Type: String
Parameter Sets: Web, List, Folder

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.File

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPAADUser

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Directory.Read.All, Directory.ReadWrite.All, User.Read.All, User.ReadWrite.All

Retrieves users from Azure Active Directory

SYNTAX

Return by specific ID

Get-PnPAADUser [-Identity <String>]
               [-Select <String[]>]
               [-ByPassPermissionCheck [<SwitchParameter>]]

Return a list

Get-PnPAADUser [-Filter <String>]
               [-OrderBy <String>]
               [-Select <String[]>]
               [-ByPassPermissionCheck [<SwitchParameter>]]

Return the delta

Get-PnPAADUser -Delta [<SwitchParameter>]
               [-Filter <String>]
               [-OrderBy <String>]
               [-Select <String[]>]
               [-DeltaToken <String>]
               [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPAADUser

Retrieves all users from Azure Active Directory

——————EXAMPLE 2——————

Get-PnPAADUser -Identity 328c7693-5524-44ac-a946-73e02d6b0f98

Retrieves the user from Azure Active Directory with the id 328c7693-5524-44ac-a946-73e02d6b0f98

——————EXAMPLE 3——————

Get-PnPAADUser -Identity john@contoso.com

Retrieves the user from Azure Active Directory with the user principal name john@contoso.com

——————EXAMPLE 4——————

Get-PnPAADUser -Identity john@contoso.com -Select "DisplayName","extension_3721d05137db455ad81aa442e3c2d4f9_extensionAttribute1"

Retrieves only the DisplayName and extensionAttribute1 properties of the user from Azure Active Directory which has the user principal name john@contoso.com

——————EXAMPLE 5——————

Get-PnPAADUser -Filter "accountEnabled eq false"

Retrieves all the disabled users from Azure Active Directory

——————EXAMPLE 6——————

Get-PnPAADUser -Filter "startswith(DisplayName, 'John')" -OrderBy "DisplayName"

Retrieves all the users from Azure Active Directory of which their DisplayName starts with ‘John’ and sort the results by the DisplayName

——————EXAMPLE 7——————

Get-PnPAADUser -Delta

Retrieves all the users from Azure Active Directory and include a delta DeltaToken which can be used by providing -DeltaToken to query for changes to users in Active Directory since this run

——————EXAMPLE 8——————

Get-PnPAADUser -Delta -DeltaToken abcdef

Retrieves all the users from Azure Active Directory which have had changes since the provided DeltaToken was given out

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Delta

Retrieves all users and provides a SkipToken delta token to allow to query for changes since this run when querying again by adding -DeltaToken to the command

Type: SwitchParameter
Parameter Sets: Return the delta

Required: True
Position: Named
Accept pipeline input: False

-DeltaToken

The change token provided during the previous run with -Delta to query for the changes to user objects made in Azure Active Directory since that run

Type: String
Parameter Sets: Return the delta

Required: False
Position: Named
Accept pipeline input: False

-Filter

Includes a filter to the retrieval of the users. Use OData instructions to construct the filter, i.e. “startswith(DisplayName, ‘John’)”.

Type: String
Parameter Sets: Return a list, Return the delta

Required: False
Position: Named
Accept pipeline input: False

-Identity

Returns the user with the provided user id

Type: String
Parameter Sets: Return by specific ID

Required: False
Position: Named
Accept pipeline input: False

-OrderBy

Includes a custom sorting instruction to the retrieval of the users. Use OData syntax to construct the orderby, i.e. “DisplayName desc”.

Type: String
Parameter Sets: Return a list, Return the delta

Required: False
Position: Named
Accept pipeline input: False

-Select

Allows providing an array with the property names of specific properties to return. If not provided, the default properties will be returned.

Type: String[]
Parameter Sets: Return by specific ID, Return a list, Return the delta

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPAccessToken

SYNOPSIS

Returns the current OAuth Access token

SYNTAX

Get-PnPAccessToken [-Decoded [<SwitchParameter>]]
                   [-ByPassPermissionCheck [<SwitchParameter>]]

DESCRIPTION

Gets the OAuth 2.0 Access Token to consume the Microsoft Graph API. Doesn’t work with all Connect-PnPOnline options.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPAccessToken

Gets the OAuth 2.0 Access Token to consume the Microsoft Graph API

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Decoded

Returns the details from the access token in a decoded manner

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Get-PnPAlert

SYNOPSIS

Returns registered alerts for a user.

SYNTAX

Get-PnPAlert [-List <ListPipeBind>]
             [-User <UserPipeBind>]
             [-Title <String>]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPAlert

Returns all registered alerts for the current user

——————EXAMPLE 2——————

Get-PnPAlert -List "Demo List"

Returns all alerts registered on the given list for the current user.

——————EXAMPLE 3——————

Get-PnPAlert -List "Demo List" -User "i:0#.f|membership|Alice@contoso.onmicrosoft.com"

Returns all alerts registered on the given list for the specified user.

——————EXAMPLE 4——————

Get-PnPAlert -Title "Demo Alert"

Returns all alerts with the given title for the current user. Title comparison is case sensitive.

PARAMETERS

-List

The ID, Title or Url of the list.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Title

Retrieve alerts with this title. Title comparison is case sensitive.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-User

User to retrieve the alerts for (User ID, login name or actual User object). Skip this parameter to retrieve the alerts for the current user. Note: Only site owners can retrieve alerts for other users.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: UserPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Get-PnPApp

SYNOPSIS

Returns the available apps from the app catalog

SYNTAX

Get-PnPApp [-Identity <AppMetadataPipeBind>]
           [-Scope <AppCatalogScope>]
           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPApp

This will return all available apps from the tenant app catalog. It will list the installed version in the current site.

——————EXAMPLE 2——————

Get-PnPApp -Scope Site

This will return all available apps from the site collection scoped app catalog. It will list the installed version in the current site.

——————EXAMPLE 3——————

Get-PnPApp -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f

This will retrieve the specific app from the app catalog.

PARAMETERS

-Identity

Specifies the Id of an app which is available in the app catalog

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppMetadataPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Scope

Defines which app catalog to use. Defaults to Tenant

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppCatalogScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

List<OfficeDevPnP.Core.ALM.AppMetadata>

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPAppAuthAccessToken

SYNOPSIS

Returns the access token

SYNTAX

Get-PnPAppAuthAccessToken [-Connection <PnPConnection>]

DESCRIPTION

Returns the access token from the current client context (only works with App-Only authentication)

EXAMPLES

——————EXAMPLE 1——————

$accessToken = Get-PnPAppAuthAccessToken

This will put the access token from current context in the $accessToken variable. Will only work in App authentication flow (App+user or App-Only)

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

System.String

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPAppInstance

SYNOPSIS

Returns a SharePoint AddIn Instance

SYNTAX

Get-PnPAppInstance [-Includes <String[]>]
                   [-Identity <AppPipeBind>]
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

DESCRIPTION

Returns a SharePoint App/Addin that has been installed in the current site

EXAMPLES

——————EXAMPLE 1——————

Get-PnPAppInstance

This will return all addin instances in the site.

——————EXAMPLE 2——————

Get-PnPAppInstance -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe

This will return an addin instance with the specified id.

PARAMETERS

-Identity

Specifies the Id of the App Instance

Type: AppPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

List<Microsoft.SharePoint.Client.AppInstance>

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Get-PnPApplicationCustomizer

SYNOPSIS

Returns all SharePoint Framework client side extension application customizers

SYNTAX

Custom Action Id

Get-PnPApplicationCustomizer [-Identity <GuidPipeBind>]
                             [-Scope <CustomActionScope>]
                             [-ThrowExceptionIfCustomActionNotFound [<SwitchParameter>]]
                             [-Web <WebPipeBind>]
                             [-Connection <PnPConnection>]

Get-PnPApplicationCustomizer [-Includes <String[]>]
                             [-Scope <CustomActionScope>]
                             [-ThrowExceptionIfCustomActionNotFound [<SwitchParameter>]]
                             [-Web <WebPipeBind>]
                             [-Connection <PnPConnection>]

Client Side Component Id

Get-PnPApplicationCustomizer -ClientSideComponentId <GuidPipeBind>
                             [-Scope <CustomActionScope>]
                             [-ThrowExceptionIfCustomActionNotFound [<SwitchParameter>]]
                             [-Web <WebPipeBind>]
                             [-Connection <PnPConnection>]

DESCRIPTION

Returns all SharePoint Framework client side extension application customizers registered on the current web and/or site

EXAMPLES

——————EXAMPLE 1——————

Get-PnPApplicationCustomizer

Returns the custom action representing the SharePoint Framework client side extension registrations registered on the current site collection and web.

——————EXAMPLE 2——————

Get-PnPApplicationCustomizer -Identity aa66f67e-46c0-4474-8a82-42bf467d07f2

Returns the custom action representing the SharePoint Framework client side extension registration with the id ‘aa66f67e-46c0-4474-8a82-42bf467d07f2’.

——————EXAMPLE 3——————

Get-PnPApplicationCustomizer -ClientSideComponentId aa66f67e-46c0-4474-8a82-42bf467d07f2 -Scope Web

Returns the custom action(s) being registered for a SharePoint Framework solution having the id ‘aa66f67e-46c0-4474-8a82-42bf467d07f2’ in its manifest from the current web.

PARAMETERS

-ClientSideComponentId

The Client Side Component Id of the SharePoint Framework client side extension application customizer found in the manifest for which existing custom action(s) should be removed

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: GuidPipeBind
Parameter Sets: Client Side Component Id

Required: True
Position: Named
Accept pipeline input: False

-Identity

Identity of the SharePoint Framework client side extension application customizer to return. Omit to return all SharePoint Frameworkclient side extension application customizer.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: GuidPipeBind
Parameter Sets: Custom Action Id

Required: False
Position: Named
Accept pipeline input: False

-Includes

Specify properties to include when retrieving objects from the server.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Scope

Scope of the SharePoint Framework client side extension application customizer, either Web, Site or All to return both (all is the default)

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: CustomActionScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ThrowExceptionIfCustomActionNotFound

Switch parameter if an exception should be thrown if the requested SharePoint Frameworkclient side extension application customizer does not exist (true) or if omitted, nothing will be returned in case the SharePoint Framework client side extension application customizer does not exist

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

The web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPAuditing

SYNOPSIS

Get the Auditing setting of a site

SYNTAX

Get-PnPAuditing [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPAuditing

Gets the auditing settings of the current site

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Audit

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPAuthenticationRealm

SYNOPSIS

Returns the authentication realm

SYNTAX

Get-PnPAuthenticationRealm [-Url <String>]
                           [-Connection <PnPConnection>]

DESCRIPTION

Gets the authentication realm for the current web

EXAMPLES

——————EXAMPLE 1——————

Get-PnPAuthenticationRealm

This will get the authentication realm for the current connected site

——————EXAMPLE 2——————

Get-PnPAuthenticationRealm -Url https://contoso.sharepoint.com

This will get the authentication realm for https://contoso.sharepoint.com

PARAMETERS

-Url

Specifies the URL of the site

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

System.String

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Get-PnPAvailableClientSideComponents

SYNOPSIS

Gets the available client side components on a particular page

SYNTAX

Get-PnPAvailableClientSideComponents -Page <ClientSidePagePipeBind>
                                     [-Component <ClientSideComponentPipeBind>]
                                     [-Web <WebPipeBind>]
                                     [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPAvailableClientSideComponents -Page "MyPage.aspx"

Gets the list of available client side components on the page ‘MyPage.aspx’

——————EXAMPLE 2——————

Get-PnPAvailableClientSideComponents $page

Gets the list of available client side components on the page contained in the $page variable

——————EXAMPLE 3——————

Get-PnPAvailableClientSideComponents -Page "MyPage.aspx" -ComponentName "HelloWorld"

Gets the client side component ‘HelloWorld’ if available on the page ‘MyPage.aspx’

PARAMETERS

-Component

Specifies the component instance or Id to look for.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSideComponentPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Page

The name of the page.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Get-PnPAvailableLanguage

SYNOPSIS

Returns the available languages on the current web

SYNTAX

Get-PnPAvailableLanguage [-Includes <String[]>]
                         [-Identity <WebPipeBind>]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPAvailableLanguage

This will return the available languages in the current web

PARAMETERS

-Identity

The guid of the web or web object

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Includes

Specify properties to include when retrieving objects from the server.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPAzureADManifestKeyCredentials

SYNOPSIS

Return the JSON Manifest snippet for Azure Apps

SYNTAX

Get-PnPAzureADManifestKeyCredentials -CertPath <String>

DESCRIPTION

Creates the JSON snippet that is required for the manifest JSON file for Azure WebApplication / WebAPI apps

EXAMPLES

——————EXAMPLE 1——————

Get-PnPAzureADManifestKeyCredentials -CertPath .\mycert.cer

Output the JSON snippet which needs to be replaced in the application manifest file

——————EXAMPLE 2——————

Get-PnPAzureADManifestKeyCredentials -CertPath .\mycert.cer | Set-Clipboard

Output the JSON snippet which needs to be replaced in the application manifest file and copies it to the clipboard

PARAMETERS

-CertPath

Specifies the path to the certificate like .\mycert.cer

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

OUTPUTS

System.String

Outputs a JSON formatted string

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPAzureCertificate

SYNOPSIS

Get PEM values and manifest settings for an existing certificate (.pfx) for use when using CSOM via an app-only ADAL application.

See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/SharePoint.ConnectUsingAppPermissions for a sample on how to get started.

KeyCredentials contains the ADAL app manifest sections.

Certificate contains the PEM encoded certificate.

PrivateKey contains the PEM encoded private key of the certificate.

SYNTAX

Get-PnPAzureCertificate -CertificatePath <String>
                        [-CertificatePassword <SecureString>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPAzureCertificate -CertificatePath "mycert.pfx"

This will output PEM values and ADAL app manifest settings for the certificate mycert.pfx.

——————EXAMPLE 2——————

Get-PnPAzureCertificate -CertificatePath "mycert.pfx" -CertificatePassword (ConvertTo-SecureString -String "YourPassword" -AsPlainText -Force)

This will output PEM values and ADAL app manifest settings for the certificate mycert.pfx which has the password YourPassword.

——————EXAMPLE 3——————

Get-PnPAzureCertificate -CertificatePath "mycert.cer" | clip

Output the JSON snippet which needs to be replaced in the application manifest file and copies it to the clipboard

PARAMETERS

-CertificatePassword

Password to the certificate (*.pfx)

Type: SecureString
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CertificatePath

Path to the certificate (*.pfx)

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Get-PnPClientSideComponent

SYNOPSIS

Retrieve one or more Client-Side components from a site page

SYNTAX

Get-PnPClientSideComponent -Page <ClientSidePagePipeBind>
                           [-InstanceId <GuidPipeBind>]
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

DESCRIPTION

This command allows the retrieval of the components placed on a modern sitepage along with its properties. Note that for a newly created modern site, the Home.aspx page will not be returning any components. This is because the underlying CanvasContent1 will not be populated until the homepage has been edited and published. The reason for this behavior is to allow for the default homepage to be able to be updated by Microsoft as long as it hasn’t been modified. For any other site page or after editing and publishing the homepage, this command will return the correct components as they are positioned on the site page.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPClientSideComponent -Page Home

Returns all controls defined on the given page.

——————EXAMPLE 2——————

Get-PnPClientSideComponent -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82

Returns a specific control defined on the given page.

PARAMETERS

-InstanceId

The instance id of the component

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: GuidPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Page

The name of the page

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Get-PnPClientSidePage

SYNOPSIS

Gets a modern site page

SYNTAX

Get-PnPClientSidePage -Identity <ClientSidePagePipeBind>
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

DESCRIPTION

This command allows the retrieval of a modern sitepage along with its properties and contents on it. Note that for a newly created modern site, the Columns and Sections of the Home.aspx page will not be filled according to the actual site page contents. This is because the underlying CanvasContent1 will not be populated until the homepage has been edited and published. The reason for this behavior is to allow for the default homepage to be able to be updated by Microsoft as long as it hasn’t been modified. For any other site page or after editing and publishing the homepage, this command will return the correct columns and sections as they are positioned on the site page.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPClientSidePage -Identity "MyPage.aspx"

Gets the Modern Page (Client-Side) named ‘MyPage.aspx’ in the current SharePoint site

——————EXAMPLE 2——————

Get-PnPClientSidePage "MyPage"

Gets the Modern Page (Client-Side) named ‘MyPage.aspx’ in the current SharePoint site

——————EXAMPLE 3——————

Get-PnPClientSidePage "Templates/MyPageTemplate"

Gets the Modern Page (Client-Side) named ‘MyPageTemplate.aspx’ from the templates folder of the Page Library in the current SharePoint site

——————EXAMPLE 4——————

Get-PnPClientSidePage -Identity "MyPage.aspx" -Web (Get-PnPWeb -Identity "Subsite1")

Gets the Modern Page (Client-Side) named ‘MyPage.aspx’ from the subsite named ‘Subsite1’

PARAMETERS

-Identity

The name of the page

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPConnection

SYNOPSIS

Returns the current context

DESCRIPTION

Returns a PnP PowerShell Connection for use with the -Connection parameter on other cmdlets.

EXAMPLES

——————EXAMPLE 1——————

$ctx = Get-PnPConnection

This will put the current connection for use with the -Connection parameter on other cmdlets.

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPContentType

SYNOPSIS

Retrieves a content type

SYNTAX

Get-PnPContentType [-Identity <ContentTypePipeBind>]
                   [-List <ListPipeBind>]
                   [-InSiteHierarchy [<SwitchParameter>]]
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPContentType 

This will get a listing of all available content types within the current web

——————EXAMPLE 2——————

Get-PnPContentType -InSiteHierarchy

This will get a listing of all available content types within the site collection

——————EXAMPLE 3——————

Get-PnPContentType -Identity "Project Document"

This will get the content type with the name “Project Document” within the current context

——————EXAMPLE 4——————

Get-PnPContentType -List "Documents"

This will get a listing of all available content types within the list “Documents”

PARAMETERS

-Identity

Name or ID of the content type to retrieve

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-InSiteHierarchy

Search site hierarchy for content types

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

List to query

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.ContentType

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPContentTypePublishingHubUrl

SYNOPSIS

Returns the url to Content Type Publishing Hub

SYNTAX

Get-PnPContentTypePublishingHubUrl [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

$url = Get-PnPContentTypePublishingHubUrl
Connect-PnPOnline -Url $url
Get-PnPContentType

This will retrieve the url to the content type hub, connect to it, and then retrieve the content types form that site

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPContext

SYNOPSIS

Returns the current context

DESCRIPTION

Returns a Client Side Object Model context

EXAMPLES

——————EXAMPLE 1——————

$ctx = Get-PnPContext

This will put the current context in the $ctx variable.

——————EXAMPLE 2——————

Connect-PnPOnline -Url $siteAurl -Credentials $credentials
$ctx = Get-PnPContext
Get-PnPList # returns the lists from site specified with $siteAurl
Connect-PnPOnline -Url $siteBurl -Credentials $credentials
Get-PnPList # returns the lists from the site specified with $siteBurl
Set-PnPContext -Context $ctx # switch back to site A
Get-PnPList # returns the lists from site A

OUTPUTS

Microsoft.SharePoint.Client.ClientContext

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPCustomAction

SYNOPSIS

Return user custom actions

SYNTAX

Get-PnPCustomAction [-Includes <String[]>]
                    [-Identity <GuidPipeBind>]
                    [-Scope <CustomActionScope>]
                    [-ThrowExceptionIfCustomActionNotFound [<SwitchParameter>]]
                    [-Web <WebPipeBind>]
                    [-Connection <PnPConnection>]

DESCRIPTION

Returns all or a specific user custom action

EXAMPLES

——————EXAMPLE 1——————

Get-PnPCustomAction

Returns all custom actions of the current site.

——————EXAMPLE 2——————

Get-PnPCustomAction -Identity aa66f67e-46c0-4474-8a82-42bf467d07f2

Returns the custom action with the id ‘aa66f67e-46c0-4474-8a82-42bf467d07f2’.

——————EXAMPLE 3——————

Get-PnPCustomAction -Scope web

Returns all custom actions for the current web object.

PARAMETERS

-Identity

Identity of the CustomAction to return. Omit to return all CustomActions.

Type: GuidPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Scope

Scope of the CustomAction, either Web, Site or All to return both

Type: CustomActionScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ThrowExceptionIfCustomActionNotFound

Switch parameter if an exception should be thrown if the requested CustomAction does not exist (true) or if omitted, nothing will be returned in case the CustomAction does not exist

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

List<Microsoft.SharePoint.Client.UserCustomAction>

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPDefaultColumnValues

SYNOPSIS

Gets the default column values for all folders in document library

SYNTAX

Get-PnPDefaultColumnValues -List <ListPipeBind>
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

DESCRIPTION

Gets the default column values for a document library, per folder. Supports both text, people and taxonomy fields.

PARAMETERS

-List

The ID, Name or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPDeletedMicrosoft365Group

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Group.Read.All, Group.ReadWrite.All

Gets one deleted Microsoft 365 Group or a list of deleted Microsoft 365 Groups

SYNTAX

Get-PnPDeletedMicrosoft365Group [-Identity <Microsoft365GroupPipeBind>]
                                [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPDeletedMicrosoft365Group

Retrieves all deleted Microsoft 365 Groups

——————EXAMPLE 2——————

Get-PnPDeletedMicrosoft365Group -Identity 38b32e13-e900-4d95-b860-fb52bc07ca7f

Retrieves a specific deleted Microsoft 365 Group based on its ID

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Microsoft 365 Group

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPDeletedUnifiedGroup

SYNOPSIS

Gets one deleted Office 365 Group (aka Unified Group) or a list of deleted Office 365 Groups

SYNTAX

Get-PnPDeletedUnifiedGroup [-Identity <UnifiedGroupPipeBind>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPDeletedUnifiedGroup

Retrieves all deleted Office 365 Groups

——————EXAMPLE 2——————

Get-PnPDeletedUnifiedGroup -Identity 38b32e13-e900-4d95-b860-fb52bc07ca7f

Retrieves a specific deleted Office 365 Group based on its ID

PARAMETERS

-Identity

The Identity of the Office 365 Group.

Type: UnifiedGroupPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPDocumentSetTemplate

SYNOPSIS

Retrieves a document set template

SYNTAX

Get-PnPDocumentSetTemplate -Identity <DocumentSetPipeBind>
                           [-Includes <String[]>]
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPDocumentSetTemplate -Identity "Test Document Set"

This will get the document set template with the name “Test Document Set”

——————EXAMPLE 2——————

Get-PnPDocumentSetTemplate -Identity "0x0120D520005DB65D094035A241BAC9AF083F825F3B"

This will get the document set template with the id “0x0120D520005DB65D094035A241BAC9AF083F825F3B”

PARAMETERS

-Identity

Either specify a name, an id, a document set template object or a content type object

Type: DocumentSetPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.DocumentSet.DocumentSetTemplate

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPEventReceiver

SYNOPSIS

Return registered eventreceivers

SYNTAX

List

Get-PnPEventReceiver [-List <ListPipeBind>]
                     [-Identity <EventReceiverPipeBind>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

Get-PnPEventReceiver [-Includes <String[]>]
                     [-Identity <EventReceiverPipeBind>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

DESCRIPTION

Returns all registered or a specific eventreceiver

EXAMPLES

——————EXAMPLE 1——————

Get-PnPEventReceiver

This will return all registered event receivers on the current web

——————EXAMPLE 2——————

Get-PnPEventReceiver -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22

This will return the event receiver with the provided ReceiverId “fb689d0e-eb99-4f13-beb3-86692fd39f22” from the current web

——————EXAMPLE 3——————

Get-PnPEventReceiver -Identity MyReceiver

This will return the event receiver with the provided ReceiverName “MyReceiver” from the current web

——————EXAMPLE 4——————

Get-PnPEventReceiver -List "ProjectList"

This will return all registered event receivers in the provided “ProjectList” list

——————EXAMPLE 5——————

Get-PnPEventReceiver -List "ProjectList" -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22

This will return the event receiver in the provided “ProjectList” list with with the provided ReceiverId “fb689d0e-eb99-4f13-beb3-86692fd39f22”

——————EXAMPLE 6——————

Get-PnPEventReceiver -List "ProjectList" -Identity MyReceiver

This will return the event receiver in the “ProjectList” list with the provided ReceiverName “MyReceiver”

PARAMETERS

-Identity

The Guid of the event receiver

Type: EventReceiverPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-List

The list object from which to get the event receiver object

Type: ListPipeBind
Parameter Sets: List

Required: False
Position: Named
Accept pipeline input: False

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.EventReceiverDefinition

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPException

SYNOPSIS

Returns the last exception that occurred

SYNTAX

Get-PnPException [-All [<SwitchParameter>]]

DESCRIPTION

Returns the last exception which can be used while debugging PnP Cmdlets

EXAMPLES

——————EXAMPLE 1——————

Get-PnPException

Returns the last exception

——————EXAMPLE 2——————

Get-PnPException -All

Returns all exceptions that occurred

PARAMETERS

-All

Show all exceptions

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPFeature

SYNOPSIS

Returns all activated or a specific activated feature

SYNTAX

Get-PnPFeature [-Includes <String[]>]
               [-Identity <FeaturePipeBind>]
               [-Scope <FeatureScope>]
               [-Web <WebPipeBind>]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPFeature

This will return all activated web scoped features

——————EXAMPLE 2——————

Get-PnPFeature -Scope Site

This will return all activated site scoped features

——————EXAMPLE 3——————

Get-PnPFeature -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22

This will return a specific activated web scoped feature

——————EXAMPLE 4——————

Get-PnPFeature -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22 -Scope Site

This will return a specific activated site scoped feature

PARAMETERS

-Identity

The feature ID or name to query for, Querying by name is not supported in version 15 of the Client Side Object Model

Type: FeaturePipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Scope

The scope of the feature. Defaults to Web.

Type: FeatureScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

List<Microsoft.SharePoint.Client.Feature>

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPField

SYNOPSIS

Returns a field from a list or site

SYNTAX

Get-PnPField [-Includes <String[]>]
             [-List <ListPipeBind>]
             [-Identity <FieldPipeBind>]
             [-Group <String>]
             [-InSiteHierarchy [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPField

Gets all the fields from the current site

——————EXAMPLE 2——————

Get-PnPField -List "Demo list" -Identity "Speakers"

Gets the speakers field from the list Demo list

PARAMETERS

-Group

Filter to the specified group

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The field object or name to get

Type: FieldPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-InSiteHierarchy

Search site hierarchy for fields

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

The list object or name where to get the field from

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Field

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPFile

SYNOPSIS

Downloads a file.

SYNTAX

Return as file object

Get-PnPFile -Url <String>
            [-AsFileObject [<SwitchParameter>]]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

Return as list item

Get-PnPFile -Url <String>
            [-AsListItem [<SwitchParameter>]]
            [-ThrowExceptionIfFileNotFound [<SwitchParameter>]]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

Return as string

Get-PnPFile -Url <String>
            [-AsString [<SwitchParameter>]]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

Save to local path

Get-PnPFile -Url <String>
            -AsFile [<SwitchParameter>]
            [-Path <String>]
            [-Filename <String>]
            [-Force [<SwitchParameter>]]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor

Retrieves the file and downloads it to the current folder

——————EXAMPLE 2——————

Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor -Path c:\temp -FileName company.spcolor -AsFile

Retrieves the file and downloads it to c:\temp\company.spcolor

——————EXAMPLE 3——————

Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor -AsString

Retrieves the file and outputs its contents to the console

——————EXAMPLE 4——————

Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor -AsFile

Retrieves the file and returns it as a File object

——————EXAMPLE 5——————

Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor -AsListItem

Retrieves the file and returns it as a ListItem object

——————EXAMPLE 6——————

Get-PnPFile -Url _catalogs/themes/15/company.spcolor -Path c:\temp -FileName company.spcolor -AsFile

Retrieves the file by site relative URL and downloads it to c:\temp\company.spcolor

PARAMETERS

-AsFile

Type: SwitchParameter
Parameter Sets: Save to local path

Required: True
Position: Named
Accept pipeline input: False

-AsFileObject

Retrieve the file contents as a file object.

Type: SwitchParameter
Parameter Sets: Return as file object

Required: False
Position: Named
Accept pipeline input: False

-AsListItem

Returns the file as a listitem showing all its properties

Type: SwitchParameter
Parameter Sets: Return as list item

Required: False
Position: Named
Accept pipeline input: False

-AsString

Retrieve the file contents as a string

Type: SwitchParameter
Parameter Sets: Return as string

Required: False
Position: Named
Accept pipeline input: False

-Filename

Name for the local file

Type: String
Parameter Sets: Save to local path

Required: False
Position: Named
Accept pipeline input: False

-Force

Overwrites the file if it exists.

Type: SwitchParameter
Parameter Sets: Save to local path

Required: False
Position: Named
Accept pipeline input: False

-Path

Local path where the file should be saved

Type: String
Parameter Sets: Save to local path

Required: False
Position: Named
Accept pipeline input: False

-ThrowExceptionIfFileNotFound

If provided in combination with -AsListItem, a System.ArgumentException will be thrown if the file specified in the -Url argument does not exist. Otherwise it will return nothing instead.

Type: SwitchParameter
Parameter Sets: Return as list item

Required: False
Position: Named
Accept pipeline input: False

-Url

The URL (server or site relative) to the file

Type: String
Parameter Sets: Return as file object, Return as list item, Save to local path, Return as string
Aliases: ServerRelativeUrl,SiteRelativeUrl

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.File

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPFileVersion

SYNOPSIS

Retrieves all versions of a file.

SYNTAX

Get-PnPFileVersion -Url <String>
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPFileVersion -Url Documents/MyDocument.docx

Retrieves the file version information for the specified file.

PARAMETERS

-Url

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.FileVersion

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPFolder

SYNOPSIS

Return a folder object

SYNTAX

Get-PnPFolder [-Includes <String[]>]
              [-Web <WebPipeBind>]
              [-Connection <PnPConnection>]

Folder By Url

Get-PnPFolder -Url <String>
              [-Web <WebPipeBind>]
              [-Connection <PnPConnection>]

Folders In List

Get-PnPFolder -List <ListPipeBind>
              [-Web <WebPipeBind>]
              [-Connection <PnPConnection>]

DESCRIPTION

Retrieves a folder if it exists or all folders inside a provided list or library. Use Resolve-PnPFolder to create the folder if it does not exist.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPFolder -Url "Shared Documents"

Returns the folder called ‘Shared Documents’ which is located in the root of the current web

——————EXAMPLE 2——————

Get-PnPFolder -Url "/sites/demo/Shared Documents"

Returns the folder called ‘Shared Documents’ which is located in the root of the current web

——————EXAMPLE 3——————

Get-PnPFolder -List "Shared Documents"

Returns the folder(s) residing inside a folder called ‘Shared Documents’

PARAMETERS

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-List

Name, ID or instance of a list or document library to retrieve the folders residing in it for.

Type: ListPipeBind
Parameter Sets: Folders In List

Required: True
Position: 1
Accept pipeline input: False

-Url

Site or server relative URL of the folder to retrieve. In the case of a server relative url, make sure that the url starts with the managed path as the current web.

Type: String
Parameter Sets: Folder By Url
Aliases: RelativeUrl

Required: True
Position: 0
Accept pipeline input: True

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Folder

SharePoint Developer Patterns and PracticesResolve-PnPFolder

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPFolderItem

SYNOPSIS

List content in folder

SYNTAX

Folder via url

Get-PnPFolderItem [-FolderSiteRelativeUrl <String>]
                  [-ItemType <String>]
                  [-ItemName <String>]
                  [-Recursive [<SwitchParameter>]]
                  [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

Folder via pipebind

Get-PnPFolderItem [-Identity <FolderPipeBind>]
                  [-ItemType <String>]
                  [-ItemName <String>]
                  [-Recursive [<SwitchParameter>]]
                  [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPFolderItem -FolderSiteRelativeUrl "SitePages"

Returns the contents of the folder SitePages which is located in the root of the current web

——————EXAMPLE 2——————

Get-PnPFolderItem -FolderSiteRelativeUrl "SitePages" -ItemName "Default.aspx"

Returns the file ‘Default.aspx’ which is located in the folder SitePages which is located in the root of the current web

——————EXAMPLE 3——————

Get-PnPFolderItem -FolderSiteRelativeUrl "SitePages" -ItemType Folder

Returns all folders in the folder SitePages which is located in the root of the current web

——————EXAMPLE 4——————

Get-PnPFolderItem -FolderSiteRelativeUrl "SitePages" -ItemType File

Returns all files in the folder SitePages which is located in the root of the current web

——————EXAMPLE 5——————

Get-PnPFolderItem -FolderSiteRelativeUrl "SitePages" -Recursive

Returns all files and folders, including contents of any subfolders, in the folder SitePages which is located in the root of the current web

PARAMETERS

-FolderSiteRelativeUrl

The site relative URL of the folder to retrieve

Type: String
Parameter Sets: Folder via url

Required: False
Position: 0
Accept pipeline input: True

-Identity

A folder instance to the folder to retrieve

Type: FolderPipeBind
Parameter Sets: Folder via pipebind

Required: False
Position: 0
Accept pipeline input: False

-ItemName

Optional name of the item to retrieve

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ItemType

The type of contents to retrieve, either File, Folder or All (default)

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Recursive

A switch parameter to include contents of all subfolders in the specified folder

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: 4
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPFooter

SYNOPSIS

Gets the configuration regarding the footer of the current web

SYNTAX

Get-PnPFooter [-Web <WebPipeBind>]
              [-Connection <PnPConnection>]

DESCRIPTION

Allows the current configuration of the footer in the current web to be retrieved. The footer currently only works on Modern Communication sites.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPFooter

Returns the current footer configuration of the current web

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPGraphAccessToken

SYNOPSIS

Returns the current OAuth Access token for the Microsoft Graph API

SYNTAX

Get-PnPGraphAccessToken [-Decoded [<SwitchParameter>]]
                        [-ByPassPermissionCheck [<SwitchParameter>]]

DESCRIPTION

Gets the OAuth 2.0 Access Token to consume the Microsoft Graph API

EXAMPLES

——————EXAMPLE 1——————

Get-PnPAccessToken

Gets the OAuth 2.0 Access Token to consume the Microsoft Graph API

——————EXAMPLE 2——————

Get-PnPAccessToken -Decoded

Gets the full OAuth 2.0 Token to consume the Microsoft Graph API

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Decoded

Returns the access token in a decoded manner

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPGraphSubscription

SYNOPSIS

Gets subscriptions from Microsoft Graph. Requires the Azure Active Directory application permission ‘Subscription.Read.All’.

SYNTAX

Return by specific ID

Get-PnPGraphSubscription [-Identity <String>]
                         [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPGraphSubscription

Retrieves all subscriptions from Microsoft Graph

——————EXAMPLE 2——————

Get-PnPGraphSubscription -Identity 328c7693-5524-44ac-a946-73e02d6b0f98

Retrieves the subscription from Microsoft Graph with the id 328c7693-5524-44ac-a946-73e02d6b0f98

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Returns the subscription with the provided subscription id

Type: String
Parameter Sets: Return by specific ID

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPGroup

SYNOPSIS

Returns a specific SharePoint group or all SharePoint groups in site.

SYNTAX

ByName

Get-PnPGroup [-Identity <GroupPipeBind>]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

Members

Get-PnPGroup [-AssociatedMemberGroup [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

Visitors

Get-PnPGroup [-AssociatedVisitorGroup [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

Owners

Get-PnPGroup [-AssociatedOwnerGroup [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

Get-PnPGroup [-Includes <String[]>]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPGroup

Returns all SharePoint groups in a site

——————EXAMPLE 2——————

Get-PnPGroup -Identity 'My Site Users'

This will return the group called ‘My Site Users’ in if available in the current site

——————EXAMPLE 3——————

Get-PnPGroup -AssociatedMemberGroup

This will return the current members group for the site

PARAMETERS

-AssociatedMemberGroup

Retrieve the associated member group

Type: SwitchParameter
Parameter Sets: Members

Required: False
Position: Named
Accept pipeline input: False

-AssociatedOwnerGroup

Retrieve the associated owner group

Type: SwitchParameter
Parameter Sets: Owners

Required: False
Position: Named
Accept pipeline input: False

-AssociatedVisitorGroup

Retrieve the associated visitor group

Type: SwitchParameter
Parameter Sets: Visitors

Required: False
Position: Named
Accept pipeline input: False

-Identity

Get a specific group by name

Type: GroupPipeBind
Parameter Sets: ByName
Aliases: Name

Required: False
Position: 0
Accept pipeline input: True

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

List<Microsoft.SharePoint.Client.Group>

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPGroupMembers

SYNOPSIS

Retrieves all members of a group

SYNTAX

Get-PnPGroupMembers -Identity <GroupPipeBind>
                    [-Web <WebPipeBind>]
                    [-Connection <PnPConnection>]

DESCRIPTION

This command will return all the users that are a member of the provided SharePoint Group

EXAMPLES

——————EXAMPLE 1——————

Get-PnPGroupMembers -Identity 'Marketing Site Members'

Returns all the users that are a member of the group ‘Marketing Site Members’ in the current sitecollection

——————EXAMPLE 2——————

Get-PnPGroup | Get-PnPGroupMembers

Returns all the users that are a member of any of the groups in the current sitecollection

——————EXAMPLE 3——————

Get-PnPGroup | ? Title -Like 'Marketing*' | Get-PnPGroupMembers

Returns all the users that are a member of any of the groups of which their name starts with the word ‘Marketing’ in the current sitecollection

PARAMETERS

-Identity

A group object, an ID or a name of a group

Type: GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.User

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPGroupPermissions

SYNOPSIS

Returns the permissions for a specific SharePoint group

SYNTAX

ByName

Get-PnPGroupPermissions -Identity <GroupPipeBind>
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPGroupPermissions -Identity 'My Site Members'

Returns the permissions for the SharePoint group with the name ‘My Site Members’

PARAMETERS

-Identity

Get the permissions of a specific group by name

Type: GroupPipeBind
Parameter Sets: ByName
Aliases: Name

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.RoleDefinitionBindingCollection

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 schema: 2.0.0

Get-PnPHealthScore

SYNOPSIS

Retrieves the healthscore of the site given in his Url parameter or from the current connection if the Url parameter is not provided

DESCRIPTION

Retrieves the current X-SharePointHealthScore value of the server, or CPU, on which your SharePoint instance runs. X-SharePointHealthScore is a value between 0 and 10, where 0 indicates the server is idle and 10 indicates the server is very busy. For more information visit https://docs.microsoft.com/office365/enterprise/diagnosing-performance-issues-with-sharepoint-online and https://docs.microsoft.com/openspecs/sharepoint_protocols/ms-wsshp/c60ddeb6-4113-4a73-9e97-26b5c3907d33.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPHealthScore

This will retrieve the current health score of the server.

——————EXAMPLE 2——————

Get-PnPHealthScore -Url https://contoso.sharepoint.com

This will retrieve the current health score for the url https://contoso.sharepoint.com.

OUTPUTS

System.Int32

Returns a int value representing the current health score value of the server.

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPHideDefaultThemes

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns if the default / OOTB themes should be visible to users or not.

SYNTAX

Get-PnPHideDefaultThemes [-Connection <PnPConnection>]

DESCRIPTION

Returns if the default themes are visible. Use Set-PnPHideDefaultThemes to change this value.

You must be a SharePoint Online global administrator to run the cmdlet.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPHideDefaultThemes

This example returns the current setting if the default themes should be visible

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPHomePage

SYNOPSIS

Return the homepage

SYNTAX

Get-PnPHomePage [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

DESCRIPTION

Returns the URL to the page set as home page

EXAMPLES

——————EXAMPLE 1——————

Get-PnPHomePage

Will return the URL of the home page of the web.

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

System.String

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPHomeSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns the home site url for your tenant

SYNTAX

Get-PnPHomeSite [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPHomeSite

Returns the home site url for your tenant

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPHubSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Retrieve all or a specific hubsite.

SYNTAX

Get-PnPHubSite [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPHubSite

Returns all hubsite properties

——————EXAMPLE 2——————

Get-PnPHubSite -Identity https://contoso.sharepoint.com/sites/myhubsite

Returns the properties of the specified hubsite

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPHubSiteChild

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Retrieves all sites linked to a specific hub site

SYNTAX

Get-PnPHubSiteChild -Identity <HubSitePipeBind>
                    [-Connection <PnPConnection>]

DESCRIPTION

Retrieves all sites linked to a specific hub site

EXAMPLES

——————EXAMPLE 1——————

Get-PnPHubSiteChild -Identity https://contoso.sharepoint.com/sites/myhubsite

Returns the sites having configured the provided hub site as their hub site

PARAMETERS

-Identity

The URL of the hubsite for which to receive the sites refering to it

Type: HubSitePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPIndexedPropertyKeys

SYNOPSIS

Returns the keys of the property bag values that have been marked for indexing by search

SYNTAX

Get-PnPIndexedPropertyKeys [-List <ListPipeBind>]
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

PARAMETERS

-List

The list object or name from where to get the indexed properties

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPInPlaceRecordsManagement

SYNOPSIS

Returns if the place records management feature is enabled.

SYNTAX

Get-PnPInPlaceRecordsManagement [-Web <WebPipeBind>]
                                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPInPlaceRecordsManagement

Returns if $true if in place records management is active

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPIsSiteAliasAvailable

SYNOPSIS

Validates if a certain alias is still available to be used to create a new site collection for. If it is not, it will propose an alternative alias and URL which is still available.

SYNTAX

Get-PnPIsSiteAliasAvailable [-Identity <String>]
                            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPIsSiteAliasAvailable -Identity "HR"

Validates if the alias “HR” is still available to be used

PARAMETERS

-Identity

Alias you want to check for if it is still available to create a new site collection for

Type: String
Parameter Sets: (All)
Aliases: Alias

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPJavaScriptLink

SYNOPSIS

Returns all or a specific custom action(s) with location type ScriptLink

SYNTAX

Get-PnPJavaScriptLink [-Name <String>]
                      [-Scope <CustomActionScope>]
                      [-ThrowExceptionIfJavaScriptLinkNotFound [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPJavaScriptLink

Returns all web scoped JavaScript links

——————EXAMPLE 2——————

Get-PnPJavaScriptLink -Scope All

Returns all web and site scoped JavaScript links

——————EXAMPLE 3——————

Get-PnPJavaScriptLink -Scope Web

Returns all Web scoped JavaScript links

——————EXAMPLE 4——————

Get-PnPJavaScriptLink -Scope Site

Returns all Site scoped JavaScript links

——————EXAMPLE 5——————

Get-PnPJavaScriptLink -Name Test

Returns the web scoped JavaScript link named Test

PARAMETERS

-Name

Name of the Javascript link. Omit this parameter to retrieve all script links

Type: String
Parameter Sets: (All)
Aliases: Key

Required: False
Position: 0
Accept pipeline input: True

-Scope

Scope of the action, either Web, Site or All to return both, defaults to Web

Type: CustomActionScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ThrowExceptionIfJavaScriptLinkNotFound

Switch parameter if an exception should be thrown if the requested JavaScriptLink does not exist (true) or if omitted, nothing will be returned in case the JavaScriptLink does not exist

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.UserCustomAction

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPKnowledgeHubSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Gets the Knowledge Hub Site URL for your tenant

SYNTAX

Get-PnPKnowledgeHubSite [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPKnowledgeHubSite

Returns the Knowledge Hub Site Url for your tenant

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPLabel

SYNOPSIS

Gets the Office 365 retention label/tag of the specified list or library (if applicable)

SYNTAX

Get-PnPLabel -List <ListPipeBind>
             [-ValuesOnly [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPLabel -List "Demo List" -ValuesOnly

This gets the Office 365 retention label which is set to a list or a library

PARAMETERS

-List

The ID or Url of the list

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-ValuesOnly

If provided, the results will be returned as values instead of in written text and will include more detailed information

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPList

SYNOPSIS

Returns lists from SharePoint

SYNTAX

Get-PnPList [-Includes <String[]>]
            [-Identity <ListPipeBind>]
            [-ThrowExceptionIfListNotFound [<SwitchParameter>]]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPList

Returns all lists in the current web

——————EXAMPLE 2——————

Get-PnPList -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe

Returns a list with the given id

——————EXAMPLE 3——————

Get-PnPList -Identity Lists/Announcements

Returns a list with the given url

——————EXAMPLE 4——————

Get-PnPList | Where-Object {$_.RootFolder.ServerRelativeUrl -like "/lists/*"}

This examples shows how to do wildcard searches on the list URL. It returns all lists whose URL starts with “/lists/” This could also be used to search for strings inside of the URL.

PARAMETERS

-Identity

The ID, name or Url (Lists/MyList) of the list

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-ThrowExceptionIfListNotFound

Switch parameter if an exception should be thrown if the requested list does not exist (true) or if omitted, nothing will be returned in case the list does not exist

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.List

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPListInformationRightsManagement

SYNOPSIS

Get the site closure status of the site which has a site policy applied

SYNTAX

Get-PnPListInformationRightsManagement -List <ListPipeBind>
                                       [-Web <WebPipeBind>]
                                       [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPListInformationRightsManagement -List "Documents"

Returns Information Rights Management (IRM) settings for the list. See ‘Get-Help Set-PnPListInformationRightsManagement -Detailed’ for more information about the various values.

PARAMETERS

-List

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPListItem

SYNOPSIS

Retrieves list items

SYNTAX

By Id

Get-PnPListItem -List <ListPipeBind>
                [-Id <Int>]
                [-Fields <String[]>]
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

By Unique Id

Get-PnPListItem -List <ListPipeBind>
                [-UniqueId <GuidPipeBind>]
                [-Fields <String[]>]
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

By Query

Get-PnPListItem -List <ListPipeBind>
                [-Query <String>]
                [-FolderServerRelativeUrl <String>]
                [-PageSize <Int>]
                [-ScriptBlock <ScriptBlock>]
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

All Items

Get-PnPListItem -List <ListPipeBind>
                [-FolderServerRelativeUrl <String>]
                [-Fields <String[]>]
                [-PageSize <Int>]
                [-ScriptBlock <ScriptBlock>]
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPListItem -List Tasks

Retrieves all list items from the Tasks list

——————EXAMPLE 2——————

Get-PnPListItem -List Tasks -Id 1

Retrieves the list item with ID 1 from the Tasks list

——————EXAMPLE 3——————

Get-PnPListItem -List Tasks -UniqueId bd6c5b3b-d960-4ee7-a02c-85dc6cd78cc3

Retrieves the list item with unique id bd6c5b3b-d960-4ee7-a02c-85dc6cd78cc3 from the tasks lists

——————EXAMPLE 4——————

(Get-PnPListItem -List Tasks -Fields "Title","GUID").FieldValues

Retrieves all list items, but only includes the values of the Title and GUID fields in the list item object

——————EXAMPLE 5——————

Get-PnPListItem -List Tasks -Query "<View><Query><Where><Eq><FieldRef Name='GUID'/><Value Type='Guid'>bd6c5b3b-d960-4ee7-a02c-85dc6cd78cc3</Value></Eq></Where></Query></View>"

Retrieves all available fields of list items based on the CAML query specified

——————EXAMPLE 6——————

Get-PnPListItem -List Tasks -Query "<View><ViewFields><FieldRef Name='Title'/><FieldRef Name='Modified'/></ViewFields><Query><Where><Geq><FieldRef Name='Modified'/><Value Type='DateTime'><Today/></Value></Eq></Where></Query></View>"

Retrieves all list items modified today, retrieving the columns ‘Title’ and ‘Modified’. When you use -Query, you can add a clause to retrieve specific columns (since you cannot use -Fields)

——————EXAMPLE 7——————

Get-PnPListItem -List Tasks -PageSize 1000

Retrieves all list items from the Tasks list in pages of 1000 items

——————EXAMPLE 8——————

Get-PnPListItem -List Tasks -PageSize 1000 -ScriptBlock { Param($items) $items.Context.ExecuteQuery() } | % { $_.BreakRoleInheritance($true, $true) }

Retrieves all list items from the Tasks list in pages of 1000 items and breaks permission inheritance on each item

——————EXAMPLE 9——————

Get-PnPListItem -List Samples -FolderServerRelativeUrl "/sites/contosomarketing/Lists/Samples/Demo"

Retrieves all list items from the Demo folder in the Samples list located in the contosomarketing site collection

PARAMETERS

-Fields

The fields to retrieve. If not specified all fields will be loaded in the returned list object.

Type: String[]
Parameter Sets: All Items, By Id, By Unique Id

Required: False
Position: Named
Accept pipeline input: False

-FolderServerRelativeUrl

The server relative URL of a list folder from which results will be returned.

Type: String
Parameter Sets: By Query, All Items

Required: False
Position: Named
Accept pipeline input: False

-Id

The ID of the item to retrieve

Type: Int
Parameter Sets: By Id

Required: False
Position: Named
Accept pipeline input: False

-List

The list to query

Type: ListPipeBind
Parameter Sets: __AllParameterSets

Required: True
Position: 0
Accept pipeline input: True

-PageSize

The number of items to retrieve per page request.

Type: Int
Parameter Sets: All Items, By Query

Required: False
Position: Named
Accept pipeline input: False

-Query

The CAML query to execute against the list

Type: String
Parameter Sets: By Query

Required: False
Position: Named
Accept pipeline input: False

-ScriptBlock

The script block to run after every page request.

Type: ScriptBlock
Parameter Sets: All Items, By Query

Required: False
Position: Named
Accept pipeline input: False

-UniqueId

The unique id (GUID) of the item to retrieve

Type: GuidPipeBind
Parameter Sets: By Unique Id

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.ListItem

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPListRecordDeclaration

SYNOPSIS

Returns the manual record declaration settings for a list

SYNTAX

Get-PnPListRecordDeclaration -List <ListPipeBind>
                             [-Web <WebPipeBind>]
                             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPListRecordDeclaration -List "Documents"

Returns the record declaration setting for the list “Documents”

PARAMETERS

-List

The list to retrieve the record declaration settings for

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPManagementApiAccessToken

SYNOPSIS

Gets an access token for the Office 365 Management API

SYNTAX

Get-PnPManagementApiAccessToken -TenantId <String>
                                -ClientId <String>
                                -ClientSecret <String>

EXAMPLES

——————EXAMPLE 1——————

Get-PnPManagementApiAccessToken -TenantId $tenantId -ClientId $clientId -ClientSecret $clientSecret)

Retrieves access token for the Office 365 Management API

PARAMETERS

-ClientId

The App\Client ID of the app which gives you access to the Office 365 Management API

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ClientSecret

The Client Secret of the app which gives you access to the Office 365 Management API

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-TenantId

The Tenant ID to connect to the Office 365 Management API

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPMasterPage

SYNOPSIS

Returns the URLs of the default Master Page and the custom Master Page.

SYNTAX

Get-PnPMasterPage [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPMicrosoft365Group

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Directory.Read.All, Directory.ReadWrite.All, Group.Read.All, Group.ReadWrite.All, GroupMember.Read.All, GroupMember.ReadWrite.All

Gets one Microsoft 365 Group or a list of Microsoft 365 Groups

SYNTAX

Get-PnPMicrosoft365Group [-Identity <Microsoft365GroupPipeBind>]
                         [-ExcludeSiteUrl [<SwitchParameter>]]
                         [-IncludeClassification [<SwitchParameter>]]
                         [-IncludeHasTeam [<SwitchParameter>]]
                         [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-Microsoft365Group

Retrieves all the Microsoft 365 Groups

——————EXAMPLE 2——————

Get-Microsoft365Group -Identity $groupId

Retrieves a specific Microsoft 365 Group based on its ID

——————EXAMPLE 3——————

Get-Microsoft365Group -Identity $groupDisplayName

Retrieves a specific or list of Microsoft 365 Groups that start with the given DisplayName

——————EXAMPLE 4——————

Get-Microsoft365Group -Identity $groupSiteMailNickName

Retrieves a specific or list of Microsoft 365 Groups for which the email starts with the provided mail nickName

——————EXAMPLE 5——————

Get-Microsoft365Group -Identity $group

Retrieves a specific Microsoft 365 Group based on its object instance

——————EXAMPLE 6——————

Get-Microsoft365Group -IncludeIfHasTeam

Retrieves all the Microsoft 365 Groups and checks for each of them if it has a Microsoft Team provisioned for it

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ExcludeSiteUrl

Exclude fetching the site URL for Microsoft 365 Groups. This speeds up large listings.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Microsoft 365 Group

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeClassification

Include Classification value of Microsoft 365 Groups

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeHasTeam

Include a flag for every Microsoft 365 Group if it has a Microsoft Team provisioned for it. This will slow down the retrieval of Microsoft 365 Groups so only use it if you need it.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPMicrosoft365GroupMembers

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Directory.Read.All, Directory.ReadWrite.All, Group.Read.All, Group.ReadWrite.All, GroupMember.Read.All, GroupMember.ReadWrite.All, User.Read.All, User.ReadWrite.All

Gets members of a particular Microsoft 365 Group (aka Unified Group). Requires the Azure Active Directory application permissions ‘Group.Read.All’ and ‘User.Read.All’.

SYNTAX

Get-PnPMicrosoft365GroupMembers -Identity <Microsoft365GroupPipeBind>
                                [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPMicrosoft365GroupMembers -Identity $groupId

Retrieves all the members of a specific Microsoft 365 Group based on its ID

——————EXAMPLE 2——————

Get-PnPMicrosoft365GroupMembers -Identity $group

Retrieves all the members of a specific Microsoft 365 Group based on the group’s object instance

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Microsoft 365 Group

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPMicrosoft365GroupOwners

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Group.Read.All, Group.ReadWrite.All, User.Read.All, User.ReadWrite.All

Gets owners of a particular Microsoft 365 Group

SYNTAX

Get-PnPMicrosoft365GroupOwners -Identity <Microsoft365GroupPipeBind>
                               [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPMicrosoft365GroupOwners -Identity $groupId

Retrieves all the owners of a specific Microsoft 365 Group based on its ID

——————EXAMPLE 2——————

Get-PnPMicrosoft365GroupOwners -Identity $group

Retrieves all the owners of a specific Microsoft 365 Group based on the group’s object instance

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Microsoft 365 Group.

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPNavigationNode

SYNOPSIS

Returns all or a specific navigation node

SYNTAX

All nodes by location

Get-PnPNavigationNode [-Location <NavigationType>]
                      [-Tree [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

A single node by ID

Get-PnPNavigationNode [-Id <Int>]
                      [-Tree [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPNavigationNode

Returns all navigation nodes in the quicklaunch navigation

——————EXAMPLE 2——————

Get-PnPNavigationNode -Location QuickLaunch

Returns all navigation nodes in the quicklaunch navigation

——————EXAMPLE 3——————

Get-PnPNavigationNode -Location TopNavigationBar

Returns all navigation nodes in the top navigation bar

——————EXAMPLE 4——————

$node = Get-PnPNavigationNode -Id 2030
PS> $children = $node.Children

Returns the selected navigation node and retrieves any children

PARAMETERS

-Id

The Id of the node to retrieve

Type: Int
Parameter Sets: A single node by ID

Required: False
Position: Named
Accept pipeline input: False

-Location

The location of the nodes to retrieve. Either TopNavigationBar, QuickLaunch, SearchNav or Footer.

Type: NavigationType
Parameter Sets: All nodes by location

Required: False
Position: Named
Accept pipeline input: False

-Tree

Show a tree view of all navigation nodes

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPOffice365CurrentServiceStatus

SYNOPSIS

Required Permissions

  • Microsoft Office 365 Management API: ServiceHealth.Read

Gets current service status of the Office 365 Services from the Office 365 Management API

SYNTAX

Get-PnPOffice365CurrentServiceStatus [-Workload <Office365Workload>]
                                     [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPOffice365CurrentServiceStatus

Retrieves the current service status of all Office 365 services

——————EXAMPLE 2——————

Get-PnPOffice365CurrentServiceStatus -Workload SharePoint

Retrieves the current service status of SharePoint Online

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Workload

Allows retrieval of the current service status of only one particular service. If not provided, the current service status of all services will be returned.

Type: Office365Workload
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPOffice365HistoricalServiceStatus

SYNOPSIS

Required Permissions

  • Microsoft Office 365 Management API: ServiceHealth.Read

Gets the historical service status of the Office 365 Services of the last 7 days from the Office 365 Management API

SYNTAX

Get-PnPOffice365HistoricalServiceStatus [-Workload <Office365Workload>]
                                        [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPOffice365HistoricalServiceStatus

Retrieves the historical service status of all Office 365 services

——————EXAMPLE 2——————

Get-PnPOffice365HistoricalServiceStatus -Workload SharePoint

Retrieves the historical service status of SharePoint Online

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Workload

Allows retrieval of the historical service status of only one particular service. If not provided, the historical service status of all services will be returned.

Type: Office365Workload
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPOffice365ServiceMessage

SYNOPSIS

Required Permissions

  • Microsoft Office 365 Management API: ServiceHealth.Read

Gets the service messages regarding services in Office 365 from the Office 365 Management API

SYNTAX

Get-PnPOffice365ServiceMessage [-Workload <Office365Workload>]
                               [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPOffice365ServiceMessage

Retrieves the service messages regarding services in Office 365

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Workload

Allows retrieval of the service messages for only one particular service. If not provided, the service messages of all services will be returned.

Type: Office365Workload
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPOffice365Services

SYNOPSIS

Required Permissions

  • Microsoft Office 365 Management API: ServiceHealth.Read

Gets the services available in Office 365 from the Office 365 Management API

SYNTAX

Get-PnPOffice365Services [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPOffice365Services

Retrieves the current services available in Office 365

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPOfficeManagementApiAccessToken

SYNOPSIS

Gets an access token for the Microsoft Office 365 Management API from the current connection

SYNTAX

Get-PnPOfficeManagementApiAccessToken [-Decoded [<SwitchParameter>]]
                                      [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPManagementApiAccessToken

Gets the OAuth 2.0 Access Token to consume the Microsoft Office 365 Management API

——————EXAMPLE 2——————

Get-PnPManagementApiAccessToken -Decoded

Gets the full OAuth 2.0 Token to consume the Microsoft Office 365 Management API

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Decoded

Returns the access token in a decoded manner

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPOrgAssetsLibrary

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns the list of all the configured organizational asset libraries

SYNTAX

Get-PnPOrgAssetsLibrary [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPOrgAssetsLibrary

Returns the list of all the configured organizational asset sites

——————EXAMPLE 2——————

(Get-PnPOrgAssetsLibrary)[0].OrgAssetsLibraries[0].LibraryUrl.DecodedUrl

Returns the server relative url of the first document library which has been flagged as organizational asset library, i.e. “sites/branding/logos”

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPOrgNewsSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns the list of all the configured organizational news sites.

SYNTAX

Get-PnPOrgNewsSite [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPOrgNewsSite

Returns the list of all the configured organizational news sites.

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPPowerShellTelemetryEnabled

SYNOPSIS

Returns true if the PnP PowerShell Telemetry has been enabled.

SYNTAX

Get-PnPPowerShellTelemetryEnabled [-Connection <PnPConnection>]

DESCRIPTION

In order to help to make PnP PowerShell better, we can track anonymous telemetry. We track the version of the cmdlets you are using, which cmdlet you are executing and which version of SharePoint you are connecting to. Use Disable-PnPPowerShellTelemetry to turn this off, alternative, use the -NoTelemetry switch on Connect-PnPOnline to turn it off for that session.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPPowerShellTelemetryEnabled

Will return true of false.

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPProperty

SYNOPSIS

Returns a previously not loaded property of a ClientObject

SYNTAX

Get-PnPProperty -ClientObject <ClientObject>
                -Property <String[]>
                [-Connection <PnPConnection>]

DESCRIPTION

Will populate properties of an object and optionally, if needed, load the value from the server. If one property is specified its value will be returned to the output.

EXAMPLES

——————EXAMPLE 1——————


$web = Get-PnPWeb
Get-PnPProperty -ClientObject $web -Property Id, Lists
$web.Lists

Will load both the Id and Lists properties of the specified Web object.

——————EXAMPLE 2——————


$list = Get-PnPList -Identity 'Site Assets'
Get-PnPProperty -ClientObject $list -Property Views

Will load the views object of the specified list object and return its value to the output.

PARAMETERS

-ClientObject

Specifies the object where the properties of should be retrieved

Type: ClientObject
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Property

The properties to load. If one property is specified its value will be returned to the output.

Type: String[]
Parameter Sets: (All)

Required: True
Position: 1
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.ClientObject

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPPropertyBag

SYNOPSIS

Returns the property bag values.

SYNTAX

Get-PnPPropertyBag [-Key <String>]
                   [-Folder <String>]
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPPropertyBag

This will return all web property bag values

——————EXAMPLE 2——————

Get-PnPPropertyBag -Key MyKey

This will return the value of the key MyKey from the web property bag

——————EXAMPLE 3——————

Get-PnPPropertyBag -Folder /MyFolder

This will return all property bag values for the folder MyFolder which is located in the root of the current web

——————EXAMPLE 4——————

Get-PnPPropertyBag -Folder /MyFolder -Key vti_mykey

This will return the value of the key vti_mykey from the folder MyFolder which is located in the root of the current web

——————EXAMPLE 5——————

Get-PnPPropertyBag -Folder / -Key vti_mykey

This will return the value of the key vti_mykey from the root folder of the current web

PARAMETERS

-Folder

Site relative url of the folder. See examples for use.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Key

Key that should be looked up

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

SharePointPnP.PowerShell.Commands.PropertyBagValue

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPProvisioningTemplate

SYNOPSIS

Generates a provisioning site template from a web

SYNTAX

Get-PnPProvisioningTemplate [-Out <String>]
                            [-IncludeAllTermGroups [<SwitchParameter>]]
                            [-IncludeSiteCollectionTermGroup [<SwitchParameter>]]
                            [-IncludeSiteGroups [<SwitchParameter>]]
                            [-IncludeTermGroupsSecurity [<SwitchParameter>]]
                            [-IncludeSearchConfiguration [<SwitchParameter>]]
                            [-PersistBrandingFiles [<SwitchParameter>]]
                            [-PersistPublishingFiles [<SwitchParameter>]]
                            [-IncludeNativePublishingFiles [<SwitchParameter>]]
                            [-IncludeHiddenLists [<SwitchParameter>]]
                            [-IncludeAllClientSidePages [<SwitchParameter>]]
                            [-SkipVersionCheck [<SwitchParameter>]]
                            [-PersistMultiLanguageResources [<SwitchParameter>]]
                            [-ResourceFilePrefix <String>]
                            [-Handlers <Handlers>]
                            [-ExcludeHandlers <Handlers>]
                            [-ExtensibilityHandlers <ExtensibilityHandler[]>]
                            [-TemplateProviderExtensions <ITemplateProviderExtension[]>]
                            [-ContentTypeGroups <String[]>]
                            [-Force [<SwitchParameter>]]
                            [-Encoding <Encoding>]
                            [-TemplateDisplayName <String>]
                            [-TemplateImagePreviewUrl <String>]
                            [-TemplateProperties <Hashtable>]
                            [-OutputInstance [<SwitchParameter>]]
                            [-ExcludeContentTypesFromSyndication [<SwitchParameter>]]
                            [-ListsToExtract <String>]
                            [-Configuration <ExtractConfigurationPipeBind>]
                            [-Schema <XMLPnPSchemaVersion>]
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPProvisioningTemplate -Out template.pnp

Extracts a provisioning template in Office Open XML from the current web.

——————EXAMPLE 2——————

Get-PnPProvisioningTemplate -Out template.xml

Extracts a provisioning template in XML format from the current web.

——————EXAMPLE 3——————

Get-PnPProvisioningTemplate -Out template.pnp -Schema V201503

Extracts a provisioning template in Office Open XML from the current web and saves it in the V201503 version of the schema.

——————EXAMPLE 4——————

Get-PnPProvisioningTemplate -Out template.pnp -IncludeAllTermGroups

Extracts a provisioning template in Office Open XML from the current web and includes all term groups, term sets and terms from the Managed Metadata Service Taxonomy.

——————EXAMPLE 5——————

Get-PnPProvisioningTemplate -Out template.pnp -IncludeSiteCollectionTermGroup

Extracts a provisioning template in Office Open XML from the current web and includes the term group currently (if set) assigned to the site collection.

——————EXAMPLE 6——————

Get-PnPProvisioningTemplate -Out template.pnp -PersistBrandingFiles

Extracts a provisioning template in Office Open XML from the current web and saves the files that make up the composed look to the same folder as where the template is saved.

——————EXAMPLE 7——————

Get-PnPProvisioningTemplate -Out template.pnp -Handlers Lists, SiteSecurity

Extracts a provisioning template in Office Open XML from the current web, but only processes lists and site security when generating the template.

——————EXAMPLE 8——————


$handler1 = New-PnPExtensibilityHandlerObject -Assembly Contoso.Core.Handlers -Type Contoso.Core.Handlers.MyExtensibilityHandler1
$handler2 = New-PnPExtensibilityHandlerObject -Assembly Contoso.Core.Handlers -Type Contoso.Core.Handlers.MyExtensibilityHandler2
Get-PnPProvisioningTemplate -Out NewTemplate.xml -ExtensibilityHandlers $handler1,$handler2

This will create two new ExtensibilityHandler objects that are run during extraction of the template

——————EXAMPLE 9——————

Only supported on SP2016, SP2019 and SP Online

Get-PnPProvisioningTemplate -Out template.pnp -PersistMultiLanguageResources

Extracts a provisioning template in Office Open XML from the current web, and for supported artifacts it will create a resource file for each supported language (based upon the language settings of the current web). The generated resource files will be named after the value specified in the Out parameter. For instance if the Out parameter is specified as -Out ‘template.xml’ the generated resource file will be called ‘template.en-US.resx’.

——————EXAMPLE 10——————

Only supported on SP2016, SP2019 and SP Online

Get-PnPProvisioningTemplate -Out template.pnp -PersistMultiLanguageResources -ResourceFilePrefix MyResources

Extracts a provisioning template in Office Open XML from the current web, and for supported artifacts it will create a resource file for each supported language (based upon the language settings of the current web). The generated resource files will be named ‘MyResources.en-US.resx’ etc.

——————EXAMPLE 11——————

$template = Get-PnPProvisioningTemplate -OutputInstance

Extracts an instance of a provisioning template object from the current web. This syntax cannot be used together with the -Out parameter, but it can be used together with any other supported parameters.

——————EXAMPLE 12——————

Get-PnPProvisioningTemplate -Out template.pnp -ContentTypeGroups "Group A","Group B"

Extracts a provisioning template in Office Open XML from the current web, but only processes content types from the to given content type groups.

——————EXAMPLE 13——————

Get-PnPProvisioningTemplate -Out template.pnp -ExcludeContentTypesFromSyndication

Extracts a provisioning template in Office Open XML from the current web, excluding content types provisioned through content type syndication (content type hub), in order to prevent provisioning errors if the target also provision the content type using syndication.

——————EXAMPLE 14——————

Get-PnPProvisioningTemplate -Out template.pnp -ListsToExtract "Title of List One","95c4efd6-08f4-4c67-94ae-49d696ba1298","Title of List Three"

Extracts a provisioning template in Office Open XML from the current web, including only the lists specified by title or ID.

PARAMETERS

-Configuration

Specify a JSON configuration file to configure the extraction progress.

Type: ExtractConfigurationPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ContentTypeGroups

Allows you to specify from which content type group(s) the content types should be included into the template.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Encoding

The encoding type of the XML file, Unicode is default

Type: Encoding
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ExcludeContentTypesFromSyndication

Specify whether or not content types issued from a content hub should be exported. By default, these content types are included.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ExcludeHandlers

Allows you to run all handlers, excluding the ones specified.

Type: Handlers
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ExtensibilityHandlers

Allows you to specify ExtensibilityHandlers to execute while extracting a template.

Type: ExtensibilityHandler[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Force

Overwrites the output file if it exists.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Handlers

Allows you to only process a specific type of artifact in the site. Notice that this might result in a non-working template, as some of the handlers require other artifacts in place if they are not part of what your extracting. For possible values for this parameter visit https://docs.microsoft.com/dotnet/api/officedevpnp.core.framework.provisioning.model.handlers

Type: Handlers
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeAllClientSidePages

If specified all client side pages will be included

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeAllTermGroups

If specified, all term groups will be included. Overrides IncludeSiteCollectionTermGroup.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeHiddenLists

If specified hidden lists will be included in the template

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeNativePublishingFiles

If specified, out of the box / native publishing files will be saved.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeSearchConfiguration

If specified the template will contain the current search configuration of the site.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeSiteCollectionTermGroup

If specified, all the site collection term groups will be included. Overridden by IncludeAllTermGroups.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeSiteGroups

If specified all site groups will be included.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeTermGroupsSecurity

If specified all the managers and contributors of term groups will be included.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ListsToExtract

Specify the lists to extract, either providing their ID or their Title.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Out

Filename to write to, optionally including full path

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-OutputInstance

Returns the template as an in-memory object, which is an instance of the ProvisioningTemplate type of the PnP Core Component. It cannot be used together with the -Out parameter.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PersistBrandingFiles

If specified the files used for masterpages, sitelogo, alternate CSS and the files that make up the composed look will be saved.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PersistMultiLanguageResources

If specified, resource values for applicable artifacts will be persisted to a resource file

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PersistPublishingFiles

If specified the files used for the publishing feature will be saved.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ResourceFilePrefix

If specified, resource files will be saved with the specified prefix instead of using the template name specified. If no template name is specified the files will be called PnP-Resources.<language>.resx. See examples for more info.

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Schema

The schema of the output to use, defaults to the latest schema

Type: XMLPnPSchemaVersion
Parameter Sets: (All)

Required: False
Position: 1
Accept pipeline input: False

-SkipVersionCheck

During extraction the version of the server will be checked for certain actions. If you specify this switch, this check will be skipped.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateDisplayName

It can be used to specify the DisplayName of the template file that will be extracted.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateImagePreviewUrl

It can be used to specify the ImagePreviewUrl of the template file that will be extracted.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateProperties

It can be used to specify custom Properties for the template file that will be extracted.

Type: Hashtable
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateProviderExtensions

Allows you to specify ITemplateProviderExtension to execute while extracting a template.

Type: ITemplateProviderExtension[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and PracticesEncoding

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPProvisioningTemplateFromGallery

SYNOPSIS

Retrieves or searches provisioning templates from the PnP Template Gallery

SYNTAX

Identity

Get-PnPProvisioningTemplateFromGallery [-Identity <Guid>]
                                       [-Path <String>]
                                       [-Force [<SwitchParameter>]]
Get-PnPProvisioningTemplateFromGallery [-Search <String>]
                                       [-TargetPlatform <TargetPlatform>]
                                       [-TargetScope <TargetScope>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPProvisioningTemplateFromGallery

Retrieves all templates from the gallery

——————EXAMPLE 2——————

Get-PnPProvisioningTemplateFromGallery -Search "Data"

Searches for a templates containing the word ‘Data’ in the Display Name

——————EXAMPLE 3——————

Get-PnPProvisioningTemplateFromGallery -Identity ae925674-8aa6-438b-acd0-d2699a022edd

Retrieves a template with the specified ID

——————EXAMPLE 4——————

$template = Get-PnPProvisioningTemplateFromGallery -Identity ae925674-8aa6-438b-acd0-d2699a022edd
Apply-PnPProvisioningTemplate -InputInstance $template

Retrieves a template with the specified ID and applies it to the site.

——————EXAMPLE 5——————

$template = Get-PnPProvisioningTemplateFromGallery -Identity ae925674-8aa6-438b-acd0-d2699a022edd -Path c:\temp

Retrieves a template with the specified ID and saves the template to the specified path

PARAMETERS

-Force

Type: SwitchParameter
Parameter Sets: Identity

Required: False
Position: Named
Accept pipeline input: False

-Identity

Type: Guid
Parameter Sets: Identity

Required: False
Position: Named
Accept pipeline input: False

-Path

Type: String
Parameter Sets: Identity

Required: False
Position: Named
Accept pipeline input: False
Type: String
Parameter Sets: Search

Required: False
Position: Named
Accept pipeline input: False

-TargetPlatform

Type: TargetPlatform
Parameter Sets: Search

Required: False
Position: Named
Accept pipeline input: False

-TargetScope

Type: TargetScope
Parameter Sets: Search

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPPublishingImageRendition

SYNOPSIS

Returns all image renditions or if Identity is specified a specific one

SYNTAX

Get-PnPPublishingImageRendition [-Identity <ImageRenditionPipeBind>]
                                [-Web <WebPipeBind>]
                                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPPublishingImageRendition

Returns all Image Renditions

——————EXAMPLE 2——————

Get-PnPPublishingImageRendition -Identity "Test"

Returns the image rendition named “Test”

——————EXAMPLE 3——————

Get-PnPPublishingImageRendition -Identity 2

Returns the image rendition where its id equals 2

PARAMETERS

-Identity

Id or name of an existing image rendition

Type: ImageRenditionPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Publishing.ImageRendition

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPRecycleBinItem

SYNOPSIS

Returns the items in the recycle bin from the context

SYNTAX

Identity

Get-PnPRecycleBinItem [-Identity <GuidPipeBind>]
                      [-Connection <PnPConnection>]

FirstStage

Get-PnPRecycleBinItem [-FirstStage [<SwitchParameter>]]
                      [-RowLimit <Int>]
                      [-Connection <PnPConnection>]

SecondStage

Get-PnPRecycleBinItem [-SecondStage [<SwitchParameter>]]
                      [-RowLimit <Int>]
                      [-Connection <PnPConnection>]

All

Get-PnPRecycleBinItem [-RowLimit <Int>]
                      [-Connection <PnPConnection>]

Get-PnPRecycleBinItem [-Includes <String[]>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPRecycleBinItem

Returns all items in both the first and the second stage recycle bins in the current site collection

——————EXAMPLE 2——————

Get-PnPRecycleBinItem -Identity f3ef6195-9400-4121-9d1c-c997fb5b86c2

Returns all a specific recycle bin item by id

——————EXAMPLE 3——————

Get-PnPRecycleBinItem -FirstStage

Returns all items in only the first stage recycle bin in the current site collection

——————EXAMPLE 4——————

Get-PnPRecycleBinItem -SecondStage

Returns all items in only the second stage recycle bin in the current site collection

——————EXAMPLE 5——————

Get-PnPRecycleBinItem -RowLimit 10000

Returns items in recycle bin limited by number of results

PARAMETERS

-FirstStage

Return all items in the first stage recycle bin

Type: SwitchParameter
Parameter Sets: FirstStage

Required: False
Position: Named
Accept pipeline input: False

-Identity

Returns a recycle bin item with a specific identity

Type: GuidPipeBind
Parameter Sets: Identity

Required: False
Position: Named
Accept pipeline input: False

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-RowLimit

Limits return results to specified amount

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: Int
Parameter Sets: FirstStage, SecondStage, All

Required: False
Position: Named
Accept pipeline input: False

-SecondStage

Return all items in the second stage recycle bin

Type: SwitchParameter
Parameter Sets: SecondStage

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.RecycleBinItem

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPRequestAccessEmails

SYNOPSIS

Returns the request access e-mail addresses

SYNTAX

Get-PnPRequestAccessEmails [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPRequestAccessEmails

This will return all the request access e-mail addresses for the current web

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

List<System.String>

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPRoleDefinition

SYNOPSIS

Retrieves a Role Definitions of a site

SYNTAX

Get-PnPRoleDefinition [-Identity <RoleDefinitionPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPRoleDefinition

Retrieves the Role Definitions (Permission Levels) settings of the current site

——————EXAMPLE 2——————

Get-PnPRoleDefinition -Identity Read

Retrieves the specified Role Definition (Permission Level) settings of the current site

PARAMETERS

-Identity

The name of a role definition to retrieve.

Type: RoleDefinitionPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.RoleDefinition

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPSearchConfiguration

SYNOPSIS

Returns the search configuration

SYNTAX

Xml

Get-PnPSearchConfiguration [-Path <String>]
                           [-Scope <SearchConfigurationScope>]
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

OutputFormat

Get-PnPSearchConfiguration [-OutputFormat <OutputFormat>]
                           [-Scope <SearchConfigurationScope>]
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSearchConfiguration

Returns the search configuration for the current web

——————EXAMPLE 2——————

Get-PnPSearchConfiguration -Scope Site

Returns the search configuration for the current site collection

——————EXAMPLE 3——————

Get-PnPSearchConfiguration -Scope Subscription

Returns the search configuration for the current tenant

——————EXAMPLE 4——————

Get-PnPSearchConfiguration -Path searchconfig.xml -Scope Subscription

Returns the search configuration for the current tenant and saves it to the specified file

——————EXAMPLE 5——————

Get-PnPSearchConfiguration -Scope Site -OutputFormat ManagedPropertyMappings

Returns all custom managed properties and crawled property mapping at the current site collection

PARAMETERS

-OutputFormat

Output format for of the configuration. Defaults to complete XML

Type: OutputFormat
Parameter Sets: OutputFormat

Required: False
Position: Named
Accept pipeline input: False

-Path

Local path where the search configuration will be saved

Type: String
Parameter Sets: Xml

Required: False
Position: Named
Accept pipeline input: False

-Scope

Scope to use. Either Web, Site, or Subscription. Defaults to Web

Type: SearchConfigurationScope
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

System.String

Does not return a string when the -Path parameter has been specified.

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPSearchCrawlLog

SYNOPSIS

Returns entries from the SharePoint search crawl log. Make sure you are granted access to the crawl log via the SharePoint search admin center at https://-admin.sharepoint.com/_layouts/15/searchadmin/crawllogreadpermission.aspx in order to run this cmdlet.

SYNTAX

Get-PnPSearchCrawlLog [-LogLevel <LogLevel>]
                      [-RowLimit <Int>]
                      [-Filter <String>]
                      [-ContentSource <ContentSource>]
                      [-StartDate <DateTime>]
                      [-EndDate <DateTime>]
                      [-RawFormat [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSearchCrawlLog

Returns the last 100 crawl log entries for site content.

——————EXAMPLE 2——————

Get-PnPSearchCrawlLog -Filter "https://<tenant>-my.sharepoint.com/personal"

Returns the last 100 crawl log entries for OneDrive content.

——————EXAMPLE 3——————

Get-PnPSearchCrawlLog -ContentSource UserProfiles 

Returns the last 100 crawl log entries for user profiles.

——————EXAMPLE 4——————

Get-PnPSearchCrawlLog -ContentSource UserProfiles -Filter "mikael"

Returns the last 100 crawl log entries for user profiles with the term “mikael” in the user principal name.

——————EXAMPLE 5——————

Get-PnPSearchCrawlLog -ContentSource Sites -LogLevel Error -RowLimit 10

Returns the last 10 crawl log entries with a state of Error for site content.

——————EXAMPLE 6——————

Get-PnPSearchCrawlLog -EndDate (Get-Date).AddDays(-100)

Returns the last 100 crawl log entries up until 100 days ago.

——————EXAMPLE 7——————

Get-PnPSearchCrawlLog -RowFilter 3 -RawFormat

Returns the last 3 crawl log entries showing the raw crawl log data.

PARAMETERS

-ContentSource

Content to retrieve (Sites, User Profiles). Defaults to Sites.

Type: ContentSource
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EndDate

End date to stop getting entries from. Default to current time.

Type: DateTime
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Filter

Filter to limit what is being returned. Has to be a URL prefix for SharePoint content, and part of a user principal name for user profiles. Wildcard characters are not supported.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LogLevel

Filter what log entries to return (All, Success, Warning, Error). Defaults to All

Type: LogLevel
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RawFormat

Show raw crawl log data

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RowLimit

Number of entries to return. Defaults to 100.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-StartDate

Start date to start getting entries from. Defaults to start of time.

Type: DateTime
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPSearchSettings

SYNOPSIS

Retrieves search settings for a site

SYNTAX

Get-PnPSearchSettings [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSearchSettings

Retrieve search settings for the site

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPSharingForNonOwnersOfSite

SYNOPSIS

Returns $false if sharing of the site and items in the site is restricted only to owners or $true if members and owners are allowed to share

SYNTAX

Get-PnPSharingForNonOwnersOfSite [-Identity <SitePipeBind>]
                                 [-Connection <PnPConnection>]

DESCRIPTION

Returns $false if sharing of the site and items in the site is restricted only to owners or $true if members and owners are allowed to share. You can disable sharing by non owners by using Disable-PnPSharingForNonOwnersOfSite. At this point there is no interface available yet to enable sharing by owners and members again through script. You will have to do so through the user interface of SharePoint.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSharingForNonOwnersOfSite

Returns $false if sharing of the site and items in the site is restricted only to owners or $true if members and owners are allowed to share

PARAMETERS

-Identity

Type: SitePipeBind
Parameter Sets: (All)
Aliases: Url

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

System.Boolean

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPSite

SYNOPSIS

Returns the current site collection from the context.

SYNTAX

Get-PnPSite [-Includes <String[]>]
            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSite

Gets the current site

——————EXAMPLE 2——————

Get-PnPSite -Includes RootWeb,ServerRelativeUrl

Gets the current site specifying to include RootWeb and ServerRelativeUrl properties. For the full list of properties see https://docs.microsoft.com/previous-versions/office/sharepoint-server/ee538579(v%3doffice.15)

PARAMETERS

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Site

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPSiteClassification

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Directory.Read.All, Directory.ReadWrite.All

Returns the defined Site Classifications for the tenant

SYNTAX

Get-PnPSiteClassification [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSiteClassification

Returns the currently set site classifications for the tenant.

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPSiteClosure

SYNOPSIS

Get the site closure status of the site which has a site policy applied

SYNTAX

Get-PnPSiteClosure [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSiteClosure

Get the site closure status of the site.

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPSiteCollectionAdmin

SYNOPSIS

Returns the current site collection administrators of the site collection in the current context

SYNTAX

Get-PnPSiteCollectionAdmin [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

DESCRIPTION

This command will return all current site collection administrators of the site collection in the current context

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSiteCollectionAdmin

This will return all the current site collection administrators of the site collection in the current context

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPSiteCollectionTermStore

SYNOPSIS

Returns the site collection term store

SYNTAX

Get-PnPSiteCollectionTermStore [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSiteCollectionTermStore

Returns the site collection term store.

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Taxonomy.TermStore

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPSiteDesign

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Retrieve Site Designs that have been registered on the current tenant.

SYNTAX

Get-PnPSiteDesign [-Identity <TenantSiteDesignPipeBind>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSiteDesign

Returns all registered site designs

——————EXAMPLE 2——————

Get-PnPSiteDesign -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd

Returns a specific registered site designs

PARAMETERS

-Identity

If specified will retrieve the specified site design

Type: TenantSiteDesignPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPSiteDesignRights

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns the principals with design rights on a specific Site Design

SYNTAX

Get-PnPSiteDesignRights -Identity <TenantSiteDesignPipeBind>
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSiteDesignRights -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd

Returns the principals with rights on a specific site design

PARAMETERS

-Identity

The ID of the Site Design to receive the rights for

Type: TenantSiteDesignPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPSiteDesignRun

SYNOPSIS

Retrieves a list of site designs applied to a specified site collection. If the WebUrl parameter is not specified we show the list of designs applied to the current site. The returned output includes the ID of the scheduled job, the web and site IDs, and the site design ID, version, and title.

SYNTAX

Get-PnPSiteDesignRun [-SiteDesignId <GuidPipeBind>]
                     [-WebUrl <String>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSiteDesignRun

This example returns a list of the site designs applied to the current site. Providing a specific site design ID will return the details for just that applied site design.

——————EXAMPLE 2——————

Get-PnPSiteDesignRun -WebUrl https://mytenant.sharepoint.com/sites/project

This example returns a list of the site designs applied to the specified site. Providing a specific site design ID will return the details for just that applied site design.

PARAMETERS

-SiteDesignId

The ID of the site design to apply.

Type: GuidPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-WebUrl

The URL of the site collection where the site design will be applied. If not specified the design will be applied to the site you connected to with Connect-PnPOnline.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPSiteDesignRunStatus

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Retrieves and displays a list of all site script actions executed for a specified site design applied to a site.

SYNTAX

Get-PnPSiteDesignRunStatus -Run <TenantSiteDesignRun>
                           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

$myrun = Get-PnPSiteDesignRun -WebUrl "https://contoso.sharepoint.com/sites/project-playbook" -SiteDesignId cefd782e-sean-4814-a68a-b33b116c302f
Get-PnPSiteDesignRunStatus -Run $myrun

This example gets the run for a specific site design applied to a site and sets it to a variable. This variable is then passed into the command -Run parameter. The result is a display of all the site script actions applied for that site design run, including the script action title and outcome.

PARAMETERS

-Run

The site design run for the desired set of script action details.

Type: TenantSiteDesignRun
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPSiteDesignTask

SYNOPSIS

Used to retrieve a scheduled site design script. It takes the ID of the scheduled site design task and the URL for the site where the site design is scheduled to be applied.

SYNTAX

Get-PnPSiteDesignTask [-Identity <TenantSiteDesignTaskPipeBind>]
                      [-WebUrl <String>]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSiteDesignTask -Identity 501z8c32-4147-44d4-8607-26c2f67cae82

This example retrieves a site design task given the provided site design task id

——————EXAMPLE 2——————

Get-PnPSiteDesignTask

This example retrieves all site design tasks currently scheduled on the current site

——————EXAMPLE 3——————

Get-PnPSiteDesignTask -WebUrl "https://contoso.sharepoint.com/sites/project"

This example retrieves all site design tasks currently scheduled on the provided site

PARAMETERS

-Identity

The ID of the site design task to retrieve.

Type: TenantSiteDesignTaskPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-WebUrl

The URL of the site collection where the site design will be applied. If not specified the site design tasks will be returned for the site you connected to with Connect-PnPOnline.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPSitePolicy

SYNOPSIS

Retrieves all or a specific site policy

SYNTAX

Get-PnPSitePolicy [-AllAvailable [<SwitchParameter>]]
                  [-Name <String>]
                  [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSitePolicy

Retrieves the current applied site policy.

——————EXAMPLE 2——————

Get-PnPSitePolicy -AllAvailable

Retrieves all available site policies.

——————EXAMPLE 3——————

Get-PnPSitePolicy -Name "Contoso HBI"

Retrieves an available site policy with the name “Contoso HBI”.

PARAMETERS

-AllAvailable

Retrieve all available site policies

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Name

Retrieves a site policy with a specific name

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

OfficeDevPnP.Core.Entities.SitePolicyEntity

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPSiteScript

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Retrieve Site Scripts that have been registered on the current tenant.

SYNTAX

Get-PnPSiteScript [-Identity <TenantSiteScriptPipeBind>]
                  [-SiteDesign <TenantSiteDesignPipeBind>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSiteScript

Returns all registered site scripts

——————EXAMPLE 2——————

Get-PnPSiteScript -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd

Returns a specific registered site script

PARAMETERS

-Identity

If specified will retrieve the specified site script

Type: TenantSiteScriptPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-SiteDesign

If specified will retrieve the site scripts for this design

Type: TenantSiteDesignPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPSiteScriptFromList

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Generates a Site Script from an existing list

SYNTAX

Get-PnPSiteScriptFromList -Url <String>
                          [-Connection <PnPConnection>]

DESCRIPTION

This command allows a Site Script to be generated off of an existing list on your tenant. Connect to your SharePoint Online Admin site before executing this command.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSiteScriptFromList -Url https://contoso.sharepoint.com/sites/teamsite/lists/MyList

Returns the generated Site Script JSON from the list “MyList” at the provided Url

——————EXAMPLE 2——————

Get-PnPSiteScriptFromList -Url "https://contoso.sharepoint.com/sites/teamsite/Shared Documents"

Returns the generated Site Script JSON from the default document library at the provided Url

PARAMETERS

-Url

Specifies the URL of the list to generate a Site Script from

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPSiteScriptFromWeb

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Generates a Site Script from an existing site

SYNTAX

All components

Get-PnPSiteScriptFromWeb -Url <String>
                         [-IncludeAll [<SwitchParameter>]]
                         [-Lists <String[]>]
                         [-Connection <PnPConnection>]

Specific components

Get-PnPSiteScriptFromWeb -Url <String>
                         [-IncludeBranding [<SwitchParameter>]]
                         [-IncludeLinksToExportedItems [<SwitchParameter>]]
                         [-IncludeRegionalSettings [<SwitchParameter>]]
                         [-IncludeSiteExternalSharingCapability [<SwitchParameter>]]
                         [-IncludeTheme [<SwitchParameter>]]
                         [-Lists <String[]>]
                         [-Connection <PnPConnection>]

DESCRIPTION

This command allows a Site Script to be generated off of an existing site on your tenant. Connect to your SharePoint Online Admin site before executing this command.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSiteScriptFromWeb -Url https://contoso.sharepoint.com/sites/teamsite -IncludeAll

Returns the generated Site Script JSON containing all supported components from the site at the provided Url

——————EXAMPLE 2——————

Get-PnPSiteScriptFromWeb -Url https://contoso.sharepoint.com/sites/teamsite -IncludeAll -Lists "Shared Documents","Lists\MyList"

Returns the generated Site Script JSON containing all supported components from the site at the provided Url including the lists “Shared Documents” and “MyList”

——————EXAMPLE 3——————

Get-PnPSiteScriptFromWeb -Url https://contoso.sharepoint.com/sites/teamsite -IncludeBranding -IncludeLinksToExportedItems

Returns the generated Site Script JSON containing the branding and navigation links from the site at the provided Url

PARAMETERS

-IncludeAll

If specified will include all supported components into the Site Script

Type: SwitchParameter
Parameter Sets: All components

Required: False
Position: Named
Accept pipeline input: False

-IncludeBranding

If specified will include the branding of the site into the Site Script

Type: SwitchParameter
Parameter Sets: Specific components

Required: False
Position: Named
Accept pipeline input: False

-IncludeLinksToExportedItems

If specified will include navigation links into the Site Script

Type: SwitchParameter
Parameter Sets: Specific components

Required: False
Position: Named
Accept pipeline input: False

-IncludeRegionalSettings

If specified will include the regional settings into the Site Script

Type: SwitchParameter
Parameter Sets: Specific components

Required: False
Position: Named
Accept pipeline input: False

-IncludeSiteExternalSharingCapability

If specified will include the external sharing configuration into the Site Script

Type: SwitchParameter
Parameter Sets: Specific components

Required: False
Position: Named
Accept pipeline input: False

-IncludeTheme

If specified will include the branding of the site into the Site Script

Type: SwitchParameter
Parameter Sets: Specific components

Required: False
Position: Named
Accept pipeline input: False

-Lists

Allows specifying one or more site relative URLs of lists that should be included into the Site Script, i.e. “Shared Documents”,“List\MyList”

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Url

Specifies the URL of the site to generate a Site Script from

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPSiteSearchQueryResults

SYNOPSIS

Executes a search query to retrieve indexed site collections

SYNTAX

Limit

Get-PnPSiteSearchQueryResults [-StartRow <Int>]
                              [-MaxResults <Int>]
                              [-Query <String>]
                              [-Web <WebPipeBind>]
                              [-Connection <PnPConnection>]

All

Get-PnPSiteSearchQueryResults [-All [<SwitchParameter>]]
                              [-Query <String>]
                              [-Web <WebPipeBind>]
                              [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSiteSearchQueryResults

Returns the top 500 site collections indexed by SharePoint Search

——————EXAMPLE 2——————

Get-PnPSiteSearchQueryResults -Query "WebTemplate:STS"

Returns the top 500 site collections indexed by SharePoint Search which have are based on the STS (Team Site) template

——————EXAMPLE 3——————

Get-PnPSiteSearchQueryResults -Query "WebTemplate:SPSPERS"

Returns the top 500 site collections indexed by SharePoint Search which have are based on the SPSPERS (MySite) template, up to the MaxResult limit

——————EXAMPLE 4——————

Get-PnPSiteSearchQueryResults -Query "Title:Intranet*"

Returns the top 500 site collections indexed by SharePoint Search of which the title starts with the word Intranet

——————EXAMPLE 5——————

Get-PnPSiteSearchQueryResults -MaxResults 10

Returns the top 10 site collections indexed by SharePoint Search

——————EXAMPLE 6——————

Get-PnPSiteSearchQueryResults -All

Returns absolutely all site collections indexed by SharePoint Search

PARAMETERS

-All

Automatically page results until the end to get more than 500 sites. Use with caution!

Type: SwitchParameter
Parameter Sets: All

Required: False
Position: Named
Accept pipeline input: False

-MaxResults

Maximum amount of search results to return. Default and max is 500 search results.

Type: Int
Parameter Sets: Limit

Required: False
Position: Named
Accept pipeline input: False

-Query

Search query in Keyword Query Language (KQL) to execute to refine the returned sites. If omitted, all indexed sites will be returned.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: 0
Accept pipeline input: True

-StartRow

Search result item to start returning the results from. Useful for paging. Leave at 0 to return all results.

Type: Int
Parameter Sets: Limit

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

List<System.Object>

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPStorageEntity

SYNOPSIS

Retrieve Storage Entities / Farm Properties from either the Tenant App Catalog or from the current site if it has a site scope app catalog.

SYNTAX

Get-PnPStorageEntity [-Key <String>]
                     [-Scope <StorageEntityScope>]
                     [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPStorageEntity

Returns all site storage entities/farm properties

——————EXAMPLE 2——————

Get-PnPStorageEntity -Key MyKey

Returns the storage entity/farm property with the given key.

——————EXAMPLE 3——————

Get-PnPStorageEntity -Scope Site

Returns all site collection scoped storage entities

——————EXAMPLE 4——————

Get-PnPStorageEntity -Key MyKey -Scope Site

Returns the storage entity from the site collection with the given key

PARAMETERS

-Key

The key of the value to retrieve.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Scope

Defines the scope of the storage entity. Defaults to Tenant.

Type: StorageEntityScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPStoredCredential

SYNOPSIS

Get a credential

SYNTAX

Get-PnPStoredCredential -Name <String>
                        [-Type <CredentialType>]

DESCRIPTION

Returns a stored credential from the Windows Credential Manager

EXAMPLES

——————EXAMPLE 1——————

Get-PnPStoredCredential -Name O365

Returns the credential associated with the specified identifier

——————EXAMPLE 2——————

Get-PnPStoredCredential -Name testEnvironment -Type OnPrem

Gets the credential associated with the specified identifier from the credential manager and then will return a credential that can be used for on-premises authentication

PARAMETERS

-Name

The credential to retrieve.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Type

The object type of the credential to return from the Credential Manager. Possible values are ‘O365’, ‘OnPrem’ or ‘PSCredential’

Type: CredentialType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPSubWebs

SYNOPSIS

Returns the subwebs of the current web

SYNTAX

Get-PnPSubWebs [-Includes <String[]>]
               [-Identity <WebPipeBind>]
               [-Recurse [<SwitchParameter>]]
               [-Web <WebPipeBind>]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPSubWebs

Retrieves all subsites of the current context returning the Id, Url, Title and ServerRelativeUrl of each subsite in the output

——————EXAMPLE 2——————

Get-PnPSubWebs -Recurse

Retrieves all subsites of the current context and all of their nested child subsites returning the Id, Url, Title and ServerRelativeUrl of each subsite in the output

——————EXAMPLE 3——————

Get-PnPSubWebs -Recurse -Includes "WebTemplate","Description" | Select ServerRelativeUrl, WebTemplate, Description

Retrieves all subsites of the current context and shows the ServerRelativeUrl, WebTemplate and Description properties in the resulting output

——————EXAMPLE 4——————

Get-PnPSubWebs -Identity Team1 -Recurse

Retrieves all subsites of the subsite Team1 and all of its nested child subsites returning the Id, Url, Title and ServerRelativeUrl of each subsite in the output

PARAMETERS

-Identity

If provided, only the subsite with the provided Id, GUID or the Web instance will be returned

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Recurse

If provided, recursion through all subsites and their children will take place to return them as well

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Web

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPTaxonomyItem

SYNOPSIS

Returns a taxonomy item

SYNTAX

Get-PnPTaxonomyItem -TermPath <String>
                    [-Connection <PnPConnection>]

PARAMETERS

-TermPath

The path, delimited by | of the taxonomy item to retrieve, alike GROUPLABEL|TERMSETLABEL|TERMLABEL

Type: String
Parameter Sets: (All)
Aliases: Term

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Taxonomy.TaxonomyItem

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPTaxonomySession

SYNOPSIS

Returns a taxonomy session

SYNTAX

Get-PnPTaxonomySession [-Web <WebPipeBind>]
                       [-Connection <PnPConnection>]

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Taxonomy.TaxonomySession

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTeamsApp

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of AppCatalog.Read.All, Directory.ReadWrite.All

Gets one Microsoft Teams App or a list of all apps.

SYNTAX

Get-PnPTeamsApp [-Identity <TeamsAppPipeBind>]
                [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTeamsApp

Retrieves all the Microsoft Teams Apps

——————EXAMPLE 2——————

Get-PnPTeamsApp -Identity a54224d7-608b-4839-bf74-1b68148e65d4

Retrieves a specific Microsoft Teams App

——————EXAMPLE 3——————

Get-PnPTeamsApp -Identity "MyTeamsApp"

Retrieves a specific Microsoft Teams App

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Specify the name, id or external id of the app.

Type: TeamsAppPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTeamsChannel

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Group.Read.All, Group.ReadWrite.All

Gets the channels for a specified Team.

SYNTAX

Get-PnPTeamsChannel -Team <TeamsTeamPipeBind>
                    [-Identity <TeamsChannelPipeBind>]
                    [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTeamsChannel -Team a6c1e0d7-f579-4993-81ab-4b666f8edea8

Retrieves all channels for the specified team

——————EXAMPLE 2——————

Get-PnPTeamsChannel -Team a6c1e0d7-f579-4993-81ab-4b666f8edea8 -Identity "Test Channel"

Retrieves the channel called ‘Test Channel’

——————EXAMPLE 3——————

Get-PnPTeamsChannel -Team a6c1e0d7-f579-4993-81ab-4b666f8edea8 -Identity "19:796d063b63e34497aeaf092c8fb9b44e@thread.skype"

Retrieves the channel specified by its channel id

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The identity of the channel to retrieve.

Type: TeamsChannelPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Team

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTeamsChannelMessage

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Sends a message to a Microsoft Teams Channel.

SYNTAX

Get-PnPTeamsChannelMessage -Team <TeamsTeamPipeBind>
                           -Channel <TeamsChannelPipeBind>
                           [-IncludeDeleted [<SwitchParameter>]]
                           [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Submit-PnPTeamsChannelMessage -Team MyTestTeam -Channel "My Channel" -Message "A new message"

Sends “A new message” to the specified channel

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Channel

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsChannelPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-IncludeDeleted

Specify to include deleted messages

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Team

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTeamsTab

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Group.Read.All, Group.ReadWrite.All

Gets one or all tabs in a channel.

SYNTAX

Get-PnPTeamsTab -Team <TeamsTeamPipeBind>
                -Channel <TeamsChannelPipeBind>
                [-Identity <TeamsTabPipeBind>]
                [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTeamsTab -Team 5beb63c5-0571-499e-94d5-3279fdd9b6b5 -Channel 19:796d063b63e34497aeaf092c8fb9b44e@thread.skype

Retrieves the tabs for the specified Microsoft Teams instance and channel

——————EXAMPLE 2——————

Get-PnPTeamsTab -Team 5beb63c5-0571-499e-94d5-3279fdd9b6b5 -Channel 19:796d063b63e34497aeaf092c8fb9b44e@thread.skype -Identity "Wiki"

Retrieves a tab with the display name ‘Wiki’ from the specified team and channel

——————EXAMPLE 3——————

Get-PnPTeamsTab -Team "My Team" -Channel "My Channel"

Retrieves the tabs for the specified Microsoft Teams instance and channel

——————EXAMPLE 4——————

Get-PnPTeamsTab "My Team" -Channel "My Channel" -Identity "Wiki"

Retrieves a tab with the display name ‘Wiki’ from the specified team and channel

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Channel

Specify the channel id of the team to retrieve.

Type: TeamsChannelPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Identity

Identity

Type: TeamsTabPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Team

Specify the group id of the team to retrieve.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTeamsTeam

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Group.Read.All, Group.ReadWrite.All

Gets one Microsoft Teams Team or a list of Teams.

SYNTAX

Get-PnPTeamsTeam [-Identity <TeamsTeamPipeBind>]
                 [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTeamsTeam

Retrieves all the Microsoft Teams instances

——————EXAMPLE 2——————

Get-PnPTeamsTeam -Identity $groupId

Retrieves a specific Microsoft Teams instance

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Specify the group id of the team to retrieve.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTeamsUser

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Group.Read.All, Group.ReadWrite.All

Returns owners, members or guests from a team.

SYNTAX

Get-PnPTeamsUser -Team <TeamsTeamPipeBind>
                 [-Role <String>]
                 [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTeamsUser -Team MyTeam

Returns all owners, members or guests from the specified team.

——————EXAMPLE 2——————

Get-PnPTeamsUser -Team MyTeam -Role Owner

Returns all owners from the specified team.

——————EXAMPLE 3——————

Get-PnPTeamsUser -Team MyTeam -Role Member

Returns all members from the specified team.

——————EXAMPLE 4——————

Get-PnPTeamsUser -Team MyTeam -Role Guest

Returns all guestss from the specified team.

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Role

Specify to filter on the role of the user

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Team

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTenant

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns organization-level site collection properties

SYNTAX

Get-PnPTenant [-Connection <PnPConnection>]

DESCRIPTION

Returns organization-level site collection properties such as StorageQuota, StorageQuotaAllocated, ResourceQuota, ResourceQuotaAllocated, and SiteCreationMode.

Currently, there are no parameters for this cmdlet.

You must have the SharePoint Online admin or Global admin role to run the cmdlet.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenant

This example returns all tenant settings

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTenantAppCatalogUrl

SYNOPSIS

Retrieves the url of the tenant scoped app catalog

SYNTAX

Get-PnPTenantAppCatalogUrl [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenantAppCatalogUrl

Returns the url of the tenant scoped app catalog site collection

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTenantCdnEnabled

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Retrieves if the Office 365 Content Delivery Network has been enabled.

SYNTAX

Get-PnPTenantCdnEnabled -CdnType <SPOTenantCdnType>
                        [-Connection <PnPConnection>]

DESCRIPTION

Enables or disabled the public or private Office 365 Content Delivery Network (CDN).

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenantCdnEnabled -CdnType Public

Returns the enabled status of the specified CDN

PARAMETERS

-CdnType

The type of cdn to retrieve the origins from

Type: SPOTenantCdnType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTenantCdnOrigin

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns the current registered origins from the public or private content delivery network (CDN).

SYNTAX

Get-PnPTenantCdnOrigin -CdnType <SPOTenantCdnType>
                       [-Connection <PnPConnection>]

DESCRIPTION

Returns the current registered origins from the public or private content delivery network (CDN).

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenantCdnOrigin -CdnType Public

Returns the configured CDN origins for the specified CDN type

PARAMETERS

-CdnType

The type of cdn to retrieve the origins from

Type: SPOTenantCdnType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTenantCdnPolicies

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns the CDN Policies for the specified CDN (Public | Private).

SYNTAX

Get-PnPTenantCdnPolicies -CdnType <SPOTenantCdnType>
                         [-Connection <PnPConnection>]

DESCRIPTION

Enables or disabled the public or private Office 365 Content Delivery Network (CDN).

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenantCdnPolicies -CdnType Public

Returns the policies for the specified CDN type

PARAMETERS

-CdnType

The type of cdn to retrieve the policies from

Type: SPOTenantCdnType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTenantId

SYNOPSIS

Returns the Tenant ID

SYNTAX

Get-PnPTenantId [-TenantUrl <String>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenantId

Returns the current Tenant Id. A valid connection with Connect-PnPOnline is required.

——————EXAMPLE 2——————

Get-PnPTenantId -TenantUrl https://contoso.sharepoint.com

Returns the Tenant ID for the specified tenant. Can be executed without a connecting first with Connect-PnPOnline

PARAMETERS

-TenantUrl

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTenantRecycleBinItem

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns all modern and classic site collections in the tenant scoped recycle bin

SYNTAX

Get-PnPTenantRecycleBinItem [-Connection <PnPConnection>]

DESCRIPTION

This command will return all the items in the tenant recycle bin for the Office 365 tenant you are connected to. Be sure to connect to the SharePoint Online Admin endpoint (https://yourtenantname-admin.sharepoint.com) in order for this command to work.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenantRecycleBinItem

Returns all modern and classic site collections in the tenant scoped recycle bin

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.Online.SharePoint.TenantAdministration.DeletedSiteProperties

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPTenantSequence

SYNOPSIS

Returns one ore more provisioning sequence object(s) from a tenant template

SYNTAX

Get-PnPTenantSequence -Template <ProvisioningHierarchy>
                      [-Identity <ProvisioningSequencePipeBind>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenantSequence -Template $myTemplateObject

Returns all sequences from the specified tenant template

——————EXAMPLE 2——————

Get-PnPTenantSequence -Template $myTemplateObject -Identity "mysequence"

Returns the specified sequence from the specified tenant template

PARAMETERS

-Identity

Optional Id of the sequence

Only applicable to: SharePoint Online

Type: ProvisioningSequencePipeBind
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: True

-Template

The template to retrieve the sequence from

Only applicable to: SharePoint Online

Type: ProvisioningHierarchy
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPTenantSequenceSite

SYNOPSIS

Returns one ore more sites from a tenant template

SYNTAX

Get-PnPTenantSequenceSite -Sequence <ProvisioningSequence>
                          [-Identity <ProvisioningSitePipeBind>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenantSequenceSite -Sequence $mysequence

Returns all sites from the specified sequence

——————EXAMPLE 2——————

Get-PnPTenantSequenceSite -Sequence $mysequence -Identity 8058ea99-af7b-4bb7-b12a-78f93398041e

Returns the specified site from the specified sequence

PARAMETERS

-Identity

Optional Id of the site

Only applicable to: SharePoint Online

Type: ProvisioningSitePipeBind
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: True

-Sequence

The sequence to retrieve the site from

Only applicable to: SharePoint Online

Type: ProvisioningSequence
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTenantServicePrincipal

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns the current tenant’s “SharePoint Online Client” service principal.

SYNTAX

Get-PnPTenantServicePrincipal [-Connection <PnPConnection>]

DESCRIPTION

Returns the current tenant’s “SharePoint Online Client” service principal.

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTenantServicePrincipalPermissionGrants

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Gets the collection of permission grants for the “SharePoint Online Client” service principal

SYNTAX

Get-PnPTenantServicePrincipalPermissionGrants [-Connection <PnPConnection>]

DESCRIPTION

Gets the collection of permission grants for the “SharePoint Online Client” service principal.

A permission grant contains the following properties:

  • ClientId: The objectId of the service principal granted consent to impersonate the user when accessing the resource(represented by the resourceId).
  • ConsentType: Whether consent was provided by the administrator on behalf of the organization or whether consent was provided by an individual.The possible values are “AllPrincipals” or “Principal”.
  • ObjectId: The unique identifier for the permission grant.
  • Resource: The resource to which access has been granted (Coming soon)
  • ResourceId: The objectId of the resource service principal to which access has been granted.
  • Scope: The value of the scope claim that the resource application should expect in the OAuth 2.0 access token.

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTenantServicePrincipalPermissionRequests

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Gets the collection of permission requests for the “SharePoint Online Client” service principal

SYNTAX

Get-PnPTenantServicePrincipalPermissionRequests [-Connection <PnPConnection>]

DESCRIPTION

Gets the collection of permission requests for the “SharePoint Online Client” service principal.

Permission request object

A permission request contains the following properties:

  • Id: The identifier of the request.
  • Resource: The resource that the application requires access to.
  • Scope: The value of the scope claim that the resource application should expect in the OAuth 2.0 access token.

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2016, SharePoint 2019 schema: 2.0.0

Get-PnPTenantSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Retrieve site information.

SYNTAX

Get-PnPTenantSite [-Url <String>]
                  [-Template <String>]
                  [-Detailed [<SwitchParameter>]]
                  [-IncludeOneDriveSites [<SwitchParameter>]]
                  [-Filter <String>]
                  [-Connection <PnPConnection>]

DESCRIPTION

Use this cmdlet to retrieve site information from your tenant administration.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenantSite

Returns all site collections

——————EXAMPLE 2——————

Get-PnPTenantSite -Url http://tenant.sharepoint.com/sites/projects

Returns information about the project site

——————EXAMPLE 3——————

Get-PnPTenantSite -Detailed

Returns all sites with the full details of these sites

——————EXAMPLE 4——————

Get-PnPTenantSite -IncludeOneDriveSites

Returns all sites including all OneDrive for Business sites

——————EXAMPLE 5——————

Get-PnPTenantSite -IncludeOneDriveSites -Filter "Url -like '-my.sharepoint.com/personal/'"

Returns all OneDrive for Business sites

——————EXAMPLE 6——————

Get-PnPTenantSite -Template SITEPAGEPUBLISHING#0

Returns all Communication sites

——————EXAMPLE 7——————

Get-PnPTenantSite -Filter "Url -like 'sales'" 

Returns all sites including ‘sales’ in the url

PARAMETERS

-Detailed

By default, not all returned attributes are populated. This switch populates all attributes. It can take several seconds to run. Without this, some attributes will show default values that may not be correct.

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Filter

Specifies the script block of the server-side filter to apply. See https://technet.microsoft.com/en-us/library/fp161380.aspx

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeOneDriveSites

By default, the OneDrives are not returned. This switch includes all OneDrives.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Template

By default, all sites will be returned. Specify a template value alike “STS#0” here to filter on the template

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Url

The URL of the site

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: String
Parameter Sets: (All)
Aliases: Identity

Required: False
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.Online.SharePoint.TenantAdministration.SiteProperties

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTenantSyncClientRestriction

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns organization-level OneDrive synchronization restriction settings

SYNTAX

Get-PnPTenantSyncClientRestriction [-Connection <PnPConnection>]

DESCRIPTION

Returns organization-level OneDrive synchronization restriction properties such as BlockMacSync, OptOutOfGrooveBlock, and TenantRestrictionEnabled.

Currently, there are no parameters for this cmdlet.

You must have the SharePoint Online admin or Global admin role to run the cmdlet.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenantSyncClientRestriction

This example returns all tenant OneDrive synchronization restriction settings

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

SharePointPnP.PowerShell.Commands.Model.SPOTenantSyncClientRestriction

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPTenantTemplate

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Generates a provisioning tenant template from a site. If the site is a hubsite any connected site will be included.

SYNTAX

Extract a template to a file

Get-PnPTenantTemplate -Out <String>
                      [-SiteUrl <String>]
                      [-Force [<SwitchParameter>]]
                      [-Configuration <ExtractConfigurationPipeBind>]
                      [-Connection <PnPConnection>]

Extract a template as an object

Get-PnPTenantTemplate -AsInstance [<SwitchParameter>]
                      [-SiteUrl <String>]
                      [-Configuration <ExtractConfigurationPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenantTemplate -Out tenanttemplate.xml

Extracts a tenant template

PARAMETERS

-AsInstance

Returns the template as an in-memory object, which is an instance of the ProvisioningHierarchy type of the PnP Core Component. It cannot be used together with the -Out parameter.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Extract a template as an object

Required: True
Position: Named
Accept pipeline input: False

-Configuration

Specify a JSON configuration file to configure the extraction progress.

Only applicable to: SharePoint Online

Type: ExtractConfigurationPipeBind
Parameter Sets: Extract a template to a file, Extract a template as an object

Required: False
Position: Named
Accept pipeline input: False

-Force

Overwrites the output file if it exists.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Extract a template to a file

Required: False
Position: Named
Accept pipeline input: False

-Out

Filename to write to, optionally including full path

Only applicable to: SharePoint Online

Type: String
Parameter Sets: Extract a template to a file

Required: True
Position: 0
Accept pipeline input: False

-SiteUrl

Only applicable to: SharePoint Online

Type: String
Parameter Sets: Extract a template to a file, Extract a template as an object

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPTenantTheme

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns all or a specific theme

SYNTAX

Get-PnPTenantTheme [-Name <String>]
                   [-Connection <PnPConnection>]

DESCRIPTION

Returns all or a specific tenant theme.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTenantTheme

Returns all themes

——————EXAMPLE 2——————

Get-PnPTenantTheme -Name "MyCompanyTheme"

Returns the specified theme

PARAMETERS

-Name

The name of the theme to retrieve

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPTerm

SYNOPSIS

Returns a taxonomy term

SYNTAX

Get-PnPTerm [-Includes <String[]>]
            [-IncludeChildTerms [<SwitchParameter>]]
            [-Connection <PnPConnection>]

By Term Id

Get-PnPTerm -Identity <Id, Name or Object>
            [-TermStore <Id, Name or Object>]
            [-IncludeChildTerms [<SwitchParameter>]]
            [-Connection <PnPConnection>]

By Termset

Get-PnPTerm -TermSet <Id, Title or TaxonomyItem>
            -TermGroup <Id, Title or TermGroup>
            [-Identity <Id, Name or Object>]
            [-TermStore <Id, Name or Object>]
            [-Recursive [<SwitchParameter>]]
            [-IncludeChildTerms [<SwitchParameter>]]
            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTerm -TermSet "Departments" -TermGroup "Corporate"

Returns all term in the termset “Departments” which is in the group “Corporate” from the site collection termstore

——————EXAMPLE 2——————

Get-PnPTerm -Identity "Finance" -TermSet "Departments" -TermGroup "Corporate"

Returns the term named “Finance” in the termset “Departments” from the termgroup called “Corporate” from the site collection termstore

——————EXAMPLE 3——————

Get-PnPTerm -Identity ab2af486-e097-4b4a-9444-527b251f1f8d -TermSet "Departments" -TermGroup "Corporate"

Returns the term named with the given id, from the “Departments” termset in a term group called “Corporate” from the site collection termstore

——————EXAMPLE 4——————

Get-PnPTerm -Identity "Small Finance" -TermSet "Departments" -TermGroup "Corporate" -Recursive

Returns the term named “Small Finance”, from the “Departments” termset in a term group called “Corporate” from the site collection termstore even if it’s a subterm below “Finance”

——————EXAMPLE 5——————

$term = Get-PnPTerm -Identity "Small Finance" -TermSet "Departments" -TermGroup "Corporate" -Include Labels
$term.Labels

Returns all the localized labels for the term named “Small Finance”, from the “Departments” termset in a term group called “Corporate”

PARAMETERS

-Identity

The Id or Name of a Term

Type: Id, Name or Object
Parameter Sets: By Term Id, By Termset

Required: True
Position: Named
Accept pipeline input: False

-IncludeChildTerms

Includes the hierarchy of child terms if available

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Recursive

Find the first term recursively matching the label in a term hierarchy.

Type: SwitchParameter
Parameter Sets: By Termset

Required: False
Position: Named
Accept pipeline input: False

-TermGroup

Name of the termgroup to check.

Type: Id, Title or TermGroup
Parameter Sets: By Termset

Required: True
Position: 0
Accept pipeline input: True

-TermSet

Name of the termset to check.

Type: Id, Title or TaxonomyItem
Parameter Sets: By Termset

Required: True
Position: 0
Accept pipeline input: True

-TermStore

Term store to check; if not specified the default term store is used.

Type: Id, Name or Object
Parameter Sets: By Term Id, By Termset

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Taxonomy.Term

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPTermGroup

SYNOPSIS

Returns a taxonomy term group

SYNTAX

Get-PnPTermGroup [-Includes <String[]>]
                 [-Identity <Id, Title or TaxonomyItem>]
                 [-TermStore <Id, Name or Object>]
                 [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTermGroup

Returns all Term Groups in the site collection termstore

——————EXAMPLE 2——————

Get-PnPTermGroup -Identity "Departments"

Returns the termgroup named “Departments” from the site collection termstore

——————EXAMPLE 3——————

Get-PnPTermGroup -Identity ab2af486-e097-4b4a-9444-527b251f1f8d

Returns the termgroup with the given ID from the site collection termstore

PARAMETERS

-Identity

Name of the taxonomy term group to retrieve.

Type: Id, Title or TaxonomyItem
Parameter Sets: (All)
Aliases: GroupName

Required: False
Position: 0
Accept pipeline input: True

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-TermStore

Term store to check; if not specified the default term store is used.

Type: Id, Name or Object
Parameter Sets: (All)
Aliases: TermStoreName

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Taxonomy.TermGroup

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPTermSet

SYNOPSIS

Returns a taxonomy term set

SYNTAX

Get-PnPTermSet -TermGroup <Id, Title or TermGroup>
               [-Includes <String[]>]
               [-Identity <Id, Name or Object>]
               [-TermStore <Id, Name or Object>]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTermSet -TermGroup "Corporate"

Returns all termsets in the group “Corporate” from the site collection termstore

——————EXAMPLE 2——————

Get-PnPTermSet -Identity "Departments" -TermGroup "Corporate"

Returns the termset named “Departments” from the termgroup called “Corporate” from the site collection termstore

——————EXAMPLE 3——————

Get-PnPTermSet -Identity ab2af486-e097-4b4a-9444-527b251f1f8d -TermGroup "Corporate

Returns the termset with the given id from the termgroup called “Corporate” from the site collection termstore

PARAMETERS

-Identity

The Id or Name of a termset

Type: Id, Name or Object
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-TermGroup

Name of the term group to check.

Type: Id, Title or TermGroup
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-TermStore

Term store to check; if not specified the default term store is used.

Type: Id, Name or Object
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Taxonomy.TermSet

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPTheme

SYNOPSIS

Returns the current theme/composed look of the current web.

SYNTAX

Get-PnPTheme [-DetectCurrentComposedLook [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTheme

Returns the current composed look of the current web.

——————EXAMPLE 2——————

Get-PnPTheme -DetectCurrentComposedLook

Returns the current composed look of the current web, and will try to detect the currently applied composed look based upon the actual site. Without this switch the cmdlet will first check for the presence of a property bag variable called _PnP_ProvisioningTemplateComposedLookInfo that contains composed look information when applied through the provisioning engine or the Set-PnPTheme cmdlet.

PARAMETERS

-DetectCurrentComposedLook

Specify this switch to not use the PnP Provisioning engine based composed look information but try to detect the current composed look as is.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

OfficeDevPnP.Core.Entities.ThemeEntity

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPTimeZoneId

SYNOPSIS

Returns a time zone ID

SYNTAX

Get-PnPTimeZoneId [-Match <String>]

DESCRIPTION

In order to create a new classic site you need to specify the timezone this site will use. Use the cmdlet to retrieve a list of possible values.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTimeZoneId

This will return all time zone IDs in use by Office 365.

——————EXAMPLE 2——————

Get-PnPTimeZoneId -Match Stockholm

This will return the time zone IDs for Stockholm

PARAMETERS

-Match

A string to search for like ‘Stockholm’

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

OUTPUTS

List<SharePointPnP.PowerShell.Commands.GetTimeZoneId+Zone>

Returns a list of matching zones. Use the ID property of the object for use in New-SPOTenantSite

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPUnifiedAuditLog

SYNOPSIS

Required Permissions

  • Microsoft Office 365 Management API: ActivityFeed.Read

Gets unified audit logs from the Office 365 Management API. Requires the Azure Active Directory application permission ‘ActivityFeed.Read’.

SYNTAX

Logs by date

Get-PnPUnifiedAuditLog [-ContentType <AuditContentType>]
                       [-StartTime <DateTime>]
                       [-EndTime <DateTime>]
                       [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPUnifiedAuditLog -ContentType SharePoint -StartTime (Get-Date).AddDays(-1) -EndTime (Get-Date).AddDays(-2)

Retrieves the audit logs of SharePoint happening between the current time yesterday and the current time the day before yesterday

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ContentType

Content type of logs to be retrieved, should be one of the following: AzureActiveDirectory, Exchange, SharePoint, General, DLP.

Type: AuditContentType
Parameter Sets: Logs by date

Required: False
Position: Named
Accept pipeline input: False

-EndTime

End time of logs to be retrieved. Start time and end time must both be specified (or both omitted) and must be less than or equal to 24 hours apart.

Type: DateTime
Parameter Sets: Logs by date

Required: False
Position: Named
Accept pipeline input: False

-StartTime

Start time of logs to be retrieved. Start time and end time must both be specified (or both omitted) and must be less than or equal to 24 hours apart, with the start time prior to end time and start time no more than 7 days in the past.

Type: DateTime
Parameter Sets: Logs by date

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPUnifiedGroup

SYNOPSIS

Gets one Office 365 Group (aka Unified Group) or a list of Office 365 Groups. Requires the Azure Active Directory application permission ‘Group.Read.All’.

SYNTAX

Get-PnPUnifiedGroup [-Identity <UnifiedGroupPipeBind>]
                    [-ExcludeSiteUrl [<SwitchParameter>]]
                    [-IncludeClassification [<SwitchParameter>]]
                    [-IncludeHasTeam [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPUnifiedGroup

Retrieves all the Office 365 Groups

——————EXAMPLE 2——————

Get-PnPUnifiedGroup -Identity $groupId

Retrieves a specific Office 365 Group based on its ID

——————EXAMPLE 3——————

Get-PnPUnifiedGroup -Identity $groupDisplayName

Retrieves a specific or list of Office 365 Groups that start with the given DisplayName

——————EXAMPLE 4——————

Get-PnPUnifiedGroup -Identity $groupSiteMailNickName

Retrieves a specific or list of Office 365 Groups for which the email starts with the provided mail nickName

——————EXAMPLE 5——————

Get-PnPUnifiedGroup -Identity $group

Retrieves a specific Office 365 Group based on its object instance

——————EXAMPLE 6——————

Get-PnPUnifiedGroup -IncludeIfHasTeam

Retrieves all the Office 365 Groups and checks for each of them if it has a Microsoft Team provisioned for it

PARAMETERS

-ExcludeSiteUrl

Exclude fetching the site URL for Office 365 Groups. This speeds up large listings.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Office 365 Group.

Type: UnifiedGroupPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeClassification

Include Classification value of Office 365 Groups.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IncludeHasTeam

Include a flag for every Office 365 Group if it has a Microsoft Team provisioned for it. This will slow down the retrieval of Office 365 Groups so only use it if you need it.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPUnifiedGroupMembers

SYNOPSIS

Gets members of a particular Office 365 Group (aka Unified Group). Requires the Azure Active Directory application permissions ‘Group.Read.All’ and ‘User.Read.All’.

SYNTAX

Get-PnPUnifiedGroupMembers -Identity <UnifiedGroupPipeBind>

EXAMPLES

——————EXAMPLE 1——————

Get-PnPUnifiedGroupMembers -Identity $groupId

Retrieves all the members of a specific Office 365 Group based on its ID

——————EXAMPLE 2——————

Get-PnPUnifiedGroupMembers -Identity $group

Retrieves all the members of a specific Office 365 Group based on the group’s object instance

PARAMETERS

-Identity

The Identity of the Office 365 Group.

Type: UnifiedGroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPUnifiedGroupOwners

SYNOPSIS

Gets owners of a particular Office 365 Group (aka Unified Group). Requires the Azure Active Directory application permissions ‘Group.Read.All’ and ‘User.Read.All’.

SYNTAX

Get-PnPUnifiedGroupOwners -Identity <UnifiedGroupPipeBind>

EXAMPLES

——————EXAMPLE 1——————

Get-PnPUnifiedGroupOwners -Identity $groupId

Retrieves all the owners of a specific Office 365 Group based on its ID

——————EXAMPLE 2——————

Get-PnPUnifiedGroupOwners -Identity $group

Retrieves all the owners of a specific Office 365 Group based on the group’s object instance

PARAMETERS

-Identity

The Identity of the Office 365 Group.

Type: UnifiedGroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPUPABulkImportStatus

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Get user profile bulk import status.

SYNTAX

Get-PnPUPABulkImportStatus [-JobId <GuidPipeBind>]
                           [-IncludeErrorDetails [<SwitchParameter>]]
                           [-Connection <PnPConnection>]

DESCRIPTION

Retrieve information about the status of submitted user profile bulk upload jobs.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPUPABulkImportStatus

This will list the status of all submitted user profile bulk import jobs.

——————EXAMPLE 2——————

Get-PnPUPABulkImportStatus -IncludeErrorDetails

This will list the status of all submitted user profile bulk import jobs, and if it contains an error it will include the error log messages if present.

——————EXAMPLE 3——————

Get-PnPUPABulkImportStatus -JobId <guid>

This will list the status for the specified import job.

——————EXAMPLE 4——————

Get-PnPUPABulkImportStatus -JobId <guid> -IncludeErrorDetails

This will list the status for the specified import job, and if it contains an error it will include the error log messages if present.

PARAMETERS

-IncludeErrorDetails

Include error log details

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-JobId

The instance id of the job

Type: GuidPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPUser

SYNOPSIS

Returns site users of current web

SYNTAX

Identity based request

Get-PnPUser [-Identity <UserPipeBind>]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

With rights assigned

Get-PnPUser [-WithRightsAssigned [<SwitchParameter>]]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

With rights assigned detailed

Get-PnPUser [-WithRightsAssignedDetailed [<SwitchParameter>]]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]
Get-PnPUser [-Identity <UserPipeBind>]
            [-WithRightsAssigned [<SwitchParameter>]]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

DESCRIPTION

This command will return all users that exist in the current site collection’s User Information List, optionally identifying their current permissions to this site

EXAMPLES

——————EXAMPLE 1——————

Get-PnPUser

Returns all users from the User Information List of the current site collection regardless if they currently have rights to access the current site

——————EXAMPLE 2——————

Get-PnPUser -Identity 23

Returns the user with Id 23 from the User Information List of the current site collection

——————EXAMPLE 3——————

Get-PnPUser -Identity "i:0#.f|membership|user@tenant.onmicrosoft.com"

Returns the user with LoginName i:0#.f|membership|user@tenant.onmicrosoft.com from the User Information List of the current site collection

——————EXAMPLE 4——————

Get-PnPUser | ? Email -eq "user@tenant.onmicrosoft.com"

Returns the user with e-mail address user@tenant.onmicrosoft.com from the User Information List of the current site collection

——————EXAMPLE 5——————

Get-PnPUser -WithRightsAssigned

Returns only those users from the User Information List of the current site collection who currently have any kind of access rights given either directly to the user or Active Directory Group or given to the user or Active Directory Group via membership of a SharePoint Group to the current site

——————EXAMPLE 6——————

Get-PnPUser -WithRightsAssigned -Web subsite1

Returns only those users from the User Information List of the current site collection who currently have any kind of access rights given either directly to the user or Active Directory Group or given to the user or Active Directory Group via membership of a SharePoint Group to subsite ‘subsite1’

——————EXAMPLE 7——————

Get-PnPUser -WithRightsAssignedDetailed

Returns all users who have been granted explicit access to the current site, lists and listitems

PARAMETERS

-Identity

User ID or login name

Type: UserPipeBind
Parameter Sets: Identity based request

Required: False
Position: Named
Accept pipeline input: True

-WithRightsAssigned

If provided, only users that currently have any kinds of access rights assigned to the current site collection will be returned. Otherwise all users, even those who previously had rights assigned, but not anymore at the moment, will be returned as the information is pulled from the User Information List. Only works if you don’t provide an -Identity.

Type: SwitchParameter
Parameter Sets: With rights assigned

Required: False
Position: Named
Accept pipeline input: False

-WithRightsAssignedDetailed

If provided, only users that currently have any specific kind of access rights assigned to the current site, lists or listitems/documents will be returned. Otherwise all users, even those who previously had rights assigned, but not anymore at the moment, will be returned as the information is pulled from the User Information List. Only works if you don’t provide an -Identity.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: With rights assigned detailed

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPUserOneDriveQuota

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Retrieves the current quota set on the OneDrive for Business site for a specific user

SYNTAX

Get-PnPUserOneDriveQuota -Account <String>
                         [-Connection <PnPConnection>]

DESCRIPTION

This command allows you to request the quota set on the OneDrive for Business site of a specific user. You must connect to the tenant admin website (https://:-admin.sharepoint.com) with Connect-PnPOnline in order to use this cmdlet.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPUserOneDriveQuota -Account 'user@domain.com'

Returns the quota set on the OneDrive for Business site for the specified user

PARAMETERS

-Account

The account of the user, formatted either as a login name, or as a claims identity, e.g. i:0#.f|membership|user@domain.com

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPUserProfileProperty

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

You must connect to the tenant admin website (https://:-admin.sharepoint.com) with Connect-PnPOnline in order to use this cmdlet.

SYNTAX

Get-PnPUserProfileProperty -Account <String[]>
                           [-Connection <PnPConnection>]

DESCRIPTION

Requires a connection to a SharePoint Tenant Admin site.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPUserProfileProperty -Account 'user@domain.com'

Returns the profile properties for the specified user

——————EXAMPLE 2——————

Get-PnPUserProfileProperty -Account 'user@domain.com','user2@domain.com'

Returns the profile properties for the specified users

PARAMETERS

-Account

The account of the user, formatted either as a login name, or as a claims identity, e.g. i:0#.f|membership|user@domain.com

Type: String[]
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.UserProfiles.PersonProperties

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPView

SYNOPSIS

Returns one or all views from a list

SYNTAX

Get-PnPView -List <ListPipeBind>
            [-Includes <String[]>]
            [-Identity <ViewPipeBind>]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPView -List "Demo List"

Returns all views associated from the specified list

——————EXAMPLE 2——————

Get-PnPView -List "Demo List" -Identity "Demo View"

Returns the view called “Demo View” from the specified list

——————EXAMPLE 3——————

Get-PnPView -List "Demo List" -Identity "5275148a-6c6c-43d8-999a-d2186989a661"

Returns the view with the specified ID from the specified list

PARAMETERS

-Identity

The ID or name of the view

Type: ViewPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-List

The ID or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.View

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPWeb

SYNOPSIS

Returns the current web object

SYNTAX

Get-PnPWeb [-Includes <String[]>]
           [-Identity <WebPipeBind>]
           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPWeb

This will return the current web

PARAMETERS

-Identity

The guid of the web or web object

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Web

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Get-PnPWebhookSubscriptions

SYNOPSIS

Gets all the Webhook subscriptions of the resource

SYNTAX

Get-PnPWebhookSubscriptions [-List <ListPipeBind>]
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPWebhookSubscriptions -List MyList

Gets all Webhook subscriptions of the list MyList

——————EXAMPLE 2——————

Get-PnPList | Get-PnPWebhookSubscriptions

Gets all Webhook subscriptions of the all the lists

PARAMETERS

-List

The list object or name to get the Webhook subscriptions from

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

OfficeDevPnP.Core.Entities.WebhookSubscription

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPWebPart

SYNOPSIS

Returns a web part definition object

SYNTAX

Get-PnPWebPart -ServerRelativePageUrl <String>
               [-Identity <WebPartPipeBind>]
               [-Web <WebPipeBind>]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPWebPart -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx"

Returns all webparts defined on the given page.

——————EXAMPLE 2——————

Get-PnPWebPart -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Identity a2875399-d6ff-43a0-96da-be6ae5875f82

Returns a specific web part defined on the given page.

PARAMETERS

-Identity

The identity of the web part, this can be the web part guid or a web part object

Type: WebPartPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-ServerRelativePageUrl

Full server relative URL of the web part page, e.g. /sites/mysite/sitepages/home.aspx

Type: String
Parameter Sets: (All)
Aliases: PageUrl

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

List<Microsoft.SharePoint.Client.WebParts.WebPartDefinition>

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPWebPartProperty

SYNOPSIS

Returns a web part property

SYNTAX

Get-PnPWebPartProperty -ServerRelativePageUrl <String>
                       -Identity <GuidPipeBind>
                       [-Key <String>]
                       [-Web <WebPipeBind>]
                       [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPWebPartProperty -ServerRelativePageUrl /sites/demo/sitepages/home.aspx -Identity ccd2c98a-c9ae-483b-ae72-19992d583914

Returns all properties of the web part.

——————EXAMPLE 2——————

Get-PnPWebPartProperty -ServerRelativePageUrl /sites/demo/sitepages/home.aspx -Identity ccd2c98a-c9ae-483b-ae72-19992d583914 -Key "Title"

Returns the title property of the web part.

PARAMETERS

-Identity

The id of the web part

Type: GuidPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Key

Name of a single property to be returned

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ServerRelativePageUrl

Full server relative URL of the web part page, e.g. /sites/mysite/sitepages/home.aspx

Type: String
Parameter Sets: (All)
Aliases: PageUrl

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPWebPartXml

SYNOPSIS

Returns the web part XML of a web part registered on a site

SYNTAX

Get-PnPWebPartXml -ServerRelativePageUrl <String>
                  -Identity <WebPartPipeBind>
                  [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPWebPartXml -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Identity a2875399-d6ff-43a0-96da-be6ae5875f82

Returns the web part XML for a given web part on a page.

PARAMETERS

-Identity

Id or title of the web part. Use Get-PnPWebPart to retrieve all web part Ids

Type: WebPartPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ServerRelativePageUrl

Full server relative url of the web part page, e.g. /sites/mysite/sitepages/home.aspx

Type: String
Parameter Sets: (All)
Aliases: PageUrl

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

System.String

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPWebTemplates

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Returns the available classic web templates

SYNTAX

Get-PnPWebTemplates [-Lcid <UInt32>]
                    [-CompatibilityLevel <Int>]
                    [-Connection <PnPConnection>]

DESCRIPTION

Will list all available classic templates one can use to create a site. Modern templates will not be returned.

EXAMPLES

——————EXAMPLE 1——————

Get-PnPWebTemplates

——————EXAMPLE 2——————

Get-PnPWebTemplates -LCID 1033

Returns all webtemplates for the Locale with ID 1033 (English)

——————EXAMPLE 3——————

Get-PnPWebTemplates -CompatibilityLevel 15

Returns all webtemplates for the compatibility level 15

PARAMETERS

-CompatibilityLevel

The compatibily level of SharePoint where 14 is SharePoint 2010, 15 is SharePoint 2013 and 16 is SharePoint 2016 and later including SharePoint Online

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Lcid

The language ID. For instance: 1033 for English. For more information, see Locale IDs supported by SharePoint at https://github.com/pnp/PnP-PowerShell/wiki/Supported-LCIDs-by-SharePoint. To get the list of supported languages on a SharePoint environment use: Get-PnPAvailableLanguage.

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.Online.SharePoint.TenantAdministration.SPOTenantWebTemplateCollection

SharePoint Developer Patterns and PracticesLocale IDs

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPWikiPageContent

SYNOPSIS

Gets the contents/source of a wiki page

SYNTAX

Get-PnPWikiPageContent -ServerRelativePageUrl <String>
                       [-Web <WebPipeBind>]
                       [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPWikiPageContent -PageUrl '/sites/demo1/pages/wikipage.aspx'

Gets the content of the page ‘/sites/demo1/pages/wikipage.aspx’

PARAMETERS

-ServerRelativePageUrl

The server relative URL for the wiki page

Type: String
Parameter Sets: (All)
Aliases: PageUrl

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

System.String

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPWorkflowDefinition

SYNOPSIS

Returns a workflow definition

SYNTAX

Get-PnPWorkflowDefinition [-Name <String>]
                          [-PublishedOnly [<SwitchParameter>]]
                          [-Web <WebPipeBind>]
                          [-Connection <PnPConnection>]

DESCRIPTION

Returns a workflow definition

EXAMPLES

——————EXAMPLE 1——————

Get-PnPWorkflowDefinition -Name MyWorkflow

Gets a Workflow with the name “MyWorkflow”.

——————EXAMPLE 2——————

Get-PnPWorkflowDefinition -Name MyWorkflow -PublishedOnly $false

Gets a Workflow with the name “MyWorkflow” that is published.

PARAMETERS

-Name

The name of the workflow

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-PublishedOnly

Return only the published workflows

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.WorkflowServices.WorkflowDefinition

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPWorkflowInstance

SYNOPSIS

Gets SharePoint 2010/2013 workflow instances

SYNTAX

By WorkflowSubscription

Get-PnPWorkflowInstance -WorkflowSubscription <WorkflowSubscriptionPipeBind>
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

By List and ListItem

Get-PnPWorkflowInstance -List <ListPipeBind>
                        -ListItem <ListItemPipeBind>
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

DESCRIPTION

Gets all SharePoint 2010/2013 workflow instances

EXAMPLES

——————EXAMPLE 1——————

Get-PnPWorkflowInstance -List "My Library" -ListItem $ListItem

Retrieves workflow instances running against the provided item on list “My Library”

——————EXAMPLE 2——————

Get-PnPWorkflowInstance -List "My Library" -ListItem 2

Retrieves workflow instances running against the provided item with 2 in the list “My Library”

——————EXAMPLE 3——————

Get-PnPWorkflowSubscription | Get-PnPWorkflowInstance

Retrieves workflow instances from all subscriptions

PARAMETERS

-List

The List for which workflow instances should be retrieved

Type: ListPipeBind
Parameter Sets: By List and ListItem

Required: True
Position: 0
Accept pipeline input: False

-ListItem

The List Item for which workflow instances should be retrieved

Type: ListItemPipeBind
Parameter Sets: By List and ListItem

Required: True
Position: 1
Accept pipeline input: False

-WorkflowSubscription

The workflow subscription for which workflow instances should be retrieved

Type: WorkflowSubscriptionPipeBind
Parameter Sets: By WorkflowSubscription

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Get-PnPWorkflowSubscription

SYNOPSIS

Return a workflow subscription

SYNTAX

Get-PnPWorkflowSubscription [-Name <String>]
                            [-List <ListPipeBind>]
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

DESCRIPTION

Returns a workflow subscriptions from a list

EXAMPLES

——————EXAMPLE 1——————

Get-PnPWorkflowSubscription -Name MyWorkflow

Gets an Workflow subscription with the name “MyWorkflow”.

——————EXAMPLE 2——————

Get-PnPWorkflowSubscription -Name MyWorkflow -list $list

Gets an Workflow subscription with the name “MyWorkflow” from the list $list.

——————EXAMPLE 3——————

Get-PnPList -identity "MyList" | Get-PnPWorkflowSubscription -Name MyWorkflow

Gets an Workflow subscription with the name “MyWorkflow” from the list “MyList”.

PARAMETERS

-List

A list to search the association for

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: 1
Accept pipeline input: False

-Name

The name of the workflow

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.WorkflowServices.WorkflowSubscription

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Grant-PnPHubSiteRights

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Grant additional permissions to the permissions already in place to associate sites to Hub Sites for one or more specific users

SYNTAX

Grant-PnPHubSiteRights [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Grant-PnPHubSiteRights -Identity https://contoso.sharepoint.com/sites/hubsite -Principals "myuser@mydomain.com","myotheruser@mydomain.com"

This example shows how to grant rights to myuser and myotheruser to associate their sites with the provided Hub Site

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Grant-PnPSiteDesignRights

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Grants the specified principals rights to use the site design.

SYNTAX

Grant-PnPSiteDesignRights -Identity <TenantSiteDesignPipeBind>
                          -Principals <String[]>
                          [-Rights <TenantSiteDesignPrincipalRights>]
                          [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Grant-PnPSiteDesignRights -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd -Principals "myuser@mydomain.com","myotheruser@mydomain.com"

Grants the specified principals View rights on the site design specified

——————EXAMPLE 2——————

Get-PnPSiteDesign -Title "MySiteDesign" -SiteScriptIds 438548fd-60dd-42cf-b843-2db506c8e259 -WebTemplate TeamSite | Grant-PnPSiteDesignRights -Principals "myuser@mydomain.com","myotheruser@mydomain.com"

Grants the specified principals View rights on the site design specified

PARAMETERS

-Identity

The site design to use.

Type: TenantSiteDesignPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Principals

One or more principals to grant rights to.

Type: String[]
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Rights

The rights to set. Defaults to ‘View’

Type: TenantSiteDesignPrincipalRights
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Grant-PnPTenantServicePrincipalPermission

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Explicitly grants a specified permission to the “SharePoint Online Client” service principal

SYNTAX

Grant-PnPTenantServicePrincipalPermission -Scope <String>
                                          -Resource <String>
                                          [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Grant-PnPTenantServicePrincipalPermission -Scope "Group.Read.All" -Resource "Microsoft Graph"

This will explicitly grant the Group.Read.All permission on the Microsoft Graph resource

PARAMETERS

-Resource

The resource to grant the permission for

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Scope

The scope to grant the permission for

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

OfficeDevPnP.Core.ALM.AppMetadata

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Import-PnPAppPackage

SYNOPSIS

Adds a SharePoint Addin to a site

SYNTAX

Import-PnPAppPackage -Path <String>
                     [-Force [<SwitchParameter>]]
                     [-LoadOnly [<SwitchParameter>]]
                     [-Locale <Int>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

DESCRIPTION

This commands requires that you have an addin package to deploy

EXAMPLES

——————EXAMPLE 1——————

Import-PnPAppPackage -Path c:\files\demo.app -LoadOnly

This will load the addin in the demo.app package, but will not install it to the site.

——————EXAMPLE 2——————

Import-PnPAppPackage -Path c:\files\demo.app -Force

This load first activate the addin sideloading feature, upload and install the addin, and deactivate the addin sideloading feature.

PARAMETERS

-Force

Will forcibly install the app by activating the addin sideloading feature, installing the addin, and deactivating the sideloading feature

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LoadOnly

Will only upload the addin, but not install it

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Locale

Will install the addin for the specified locale

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Path

Path pointing to the .app file

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.AppInstance

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Import-PnPTaxonomy

SYNOPSIS

Imports a taxonomy from either a string array or a file

SYNTAX

Direct

Import-PnPTaxonomy [-Terms <String[]>]
                   [-Lcid <Int>]
                   [-TermStoreName <String>]
                   [-Delimiter <String>]
                   [-SynchronizeDeletions [<SwitchParameter>]]
                   [-Connection <PnPConnection>]

File

Import-PnPTaxonomy -Path <String>
                   [-Lcid <Int>]
                   [-TermStoreName <String>]
                   [-Delimiter <String>]
                   [-SynchronizeDeletions [<SwitchParameter>]]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Import-PnPTaxonomy -Terms 'Company|Locations|Stockholm'

Creates a new termgroup, ‘Company’, a termset ‘Locations’ and a term ‘Stockholm’

——————EXAMPLE 2——————

Import-PnPTaxonomy -Terms 'Company|Locations|Stockholm|Central','Company|Locations|Stockholm|North'

Creates a new termgroup, ‘Company’, a termset ‘Locations’, a term ‘Stockholm’ and two subterms: ‘Central’, and ‘North’

——————EXAMPLE 3——————

Import-PnPTaxonomy -Path ./mytaxonomyterms.txt

Imports the taxonomy from the file specified. Each line has to be in the format TERMGROUP|TERMSET|TERM. See example 2 for examples of the format.

PARAMETERS

-Delimiter

The path delimiter to be used, by default this is ‘|’

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Lcid

Type: Int
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Path

Specifies a file containing terms per line, in the format as required by the Terms parameter.

Type: String
Parameter Sets: File

Required: True
Position: Named
Accept pipeline input: False

-SynchronizeDeletions

If specified, terms that exist in the termset, but are not in the imported data, will be removed.

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Terms

An array of strings describing termgroup, termset, term, subterms using a default delimiter of ‘|’.

Type: String[]
Parameter Sets: Direct

Required: False
Position: Named
Accept pipeline input: True

-TermStoreName

Term store to import to; if not specified the default term store is used.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Import-PnPTermGroupFromXml

SYNOPSIS

Imports a taxonomy TermGroup from either the input or from an XML file.

SYNTAX

XML

Import-PnPTermGroupFromXml [-Xml <String>]
                           [-Connection <PnPConnection>]

File

Import-PnPTermGroupFromXml [-Path <String>]
                           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Import-PnPTermGroupFromXml -Xml $xml

Imports the XML based termgroup information located in the $xml variable

——————EXAMPLE 2——————

Import-PnPTermGroupFromXml -Path input.xml

Imports the XML file specified by the path.

PARAMETERS

-Path

The XML File to import the data from

Type: String
Parameter Sets: File

Required: False
Position: Named
Accept pipeline input: False

-Xml

The XML to process

Type: String
Parameter Sets: XML

Required: False
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Import-PnPTermSet

SYNOPSIS

Imports a taxonomy term set from a file in the standard format.

SYNTAX

Import-PnPTermSet -GroupName <String>
                  -Path <String>
                  [-TermSetId <Guid>]
                  [-SynchronizeDeletions [<SwitchParameter>]]
                  [-IsOpen <Boolean>]
                  [-Contact <String>]
                  [-Owner <String>]
                  [-TermStoreName <String>]
                  [-Connection <PnPConnection>]

DESCRIPTION

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 synchronization logic allowing updating of an existing Term Set. When synchronizing, 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 synchronizeDeletions 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 taxonomy item name). This expanded syntax is not required, but can be used to ensure all terms have fixed IDs.

EXAMPLES

——————EXAMPLE 1——————

Import-PnPTermSet -GroupName 'Standard Terms' -Path 'C:\\Temp\\ImportTermSet.csv' -SynchronizeDeletions

Creates (or updates) the term set specified in the import file, in the group specified, removing any existing terms not in the file.

——————EXAMPLE 2——————

Import-PnPTermSet -TermStoreName 'My Term Store' -GroupName 'Standard Terms' -Path 'C:\\Temp\\ImportTermSet.csv' -TermSetId '{15A98DB6-D8E2-43E6-8771-066C1EC2B8D8}' 

Creates (or updates) the term set specified in the import file, in the term store and group specified, using the specified ID.

——————EXAMPLE 3——————

Import-PnPTermSet -GroupName 'Standard Terms' -Path 'C:\\Temp\\ImportTermSet.csv' -IsOpen $true -Contact 'user@example.org' -Owner 'user@example.org'

Creates (or updates) the term set specified in the import file, setting the IsOpen, Contact, and Owner properties as specified.

PARAMETERS

-Contact

Contact for the term set; if not specified, the existing setting is retained.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-GroupName

Group to import the term set to; an error is returned if the group does not exist.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-IsOpen

Whether the term set should be marked open; if not specified, then the existing setting is not changed.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owner

Owner for the term set; if not specified, the existing setting is retained.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Path

Local path to the file containing the term set to import, in the standard format (as the ‘sample import file’ available in the Term Store Administration).

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-SynchronizeDeletions

If specified, the import will remove any terms (and children) previously in the term set but not in the import file; default is to leave them.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TermSetId

GUID to use for the term set; if not specified, or the empty GUID, a random GUID is generated and used.

Type: Guid
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TermStoreName

Term store to import into; if not specified the default term store is used.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Initialize-PnPPowerShellAuthentication

SYNOPSIS

Initializes a Azure AD App and optionally creates a new self-signed certificate to use with the application registration.

SYNTAX

Generate Certificate

Initialize-PnPPowerShellAuthentication -ApplicationName <String>
                                       -Tenant <String>
                                       [-CommonName <String>]
                                       [-OutPath <String>]
                                       [-Store <StoreLocation>]
                                       [-Scopes <String[]>]
                                       [-Country <String>]
                                       [-State <String>]
                                       [-Locality <String>]
                                       [-Organization <String>]
                                       [-OrganizationUnit <String>]
                                       [-ValidYears <Int>]
                                       [-CertificatePassword <SecureString>]

Existing Certificate

Initialize-PnPPowerShellAuthentication -CertificatePath <String>
                                       -ApplicationName <String>
                                       -Tenant <String>
                                       [-Scopes <String[]>]
                                       [-CertificatePassword <SecureString>]

DESCRIPTION

Initializes a Azure AD App and optionally creates a new self-signed certificate to use with the application registration. Have a look at https://www.youtube.com/watch?v=QWY7AJ2ZQYI for a demonstration on how this cmdlet works and can be used.

EXAMPLES

——————EXAMPLE 1——————

Initialize-PnPPowerShellAuthentication -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -Store CurrentUser

Creates a new Azure AD Application registration, creates a new self signed certificate, and adds it to the local certificate store. It will upload the certificate to the azure app registration and it will request the following permissions: Sites.FullControl.All, Group.ReadWrite.All, User.Read.All

——————EXAMPLE 2——————

Initialize-PnPPowerShellAuthentication -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -CertificatePath c:\certificate.pfx -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force)

Creates a new Azure AD Application registration which will use the existing private key certificate at the provided path to allow access. It will upload the provided private key certificate to the azure app registration and it will request the following permissions: Sites.FullControl.All, Group.ReadWrite.All, User.Read.All

——————EXAMPLE 3——————

Initialize-PnPPowerShellAuthentication -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -Store CurrentUser -Scopes "MSGraph.User.Read.All","SPO.Sites.Read.All"

Creates a new Azure AD Application registration, creates a new self signed certificate, and adds it to the local certificate store. It will upload the certificate to the azure app registration and it will request the following permissions: Sites.Read.All, User.Read.All

——————EXAMPLE 4——————

Initialize-PnPPowerShellAuthentication -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -OutPath c:\ -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force)

Creates a new Azure AD Application registration, creates a new self signed certificate, and stores the public and private key certificates in c:. The private key certificate will be locked with the password “password”. It will upload the certificate to the azure app registration and it will request the following permissions: Sites.FullControl.All, Group.ReadWrite.All, User.Read.All

PARAMETERS

-ApplicationName

The name of the Azure AD Application to create

Type: String
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

-CertificatePassword

Optional certificate password

Type: SecureString
Parameter Sets: Generate Certificate, Existing Certificate

Required: False
Position: 8
Accept pipeline input: False

-CertificatePath

Password for the certificate being created

Type: String
Parameter Sets: Existing Certificate

Required: True
Position: Named
Accept pipeline input: False

-CommonName

Common Name (e.g. server FQDN or YOUR name). defaults to ‘pnp.contoso.com’

Type: String
Parameter Sets: Generate Certificate

Required: False
Position: 0
Accept pipeline input: False

-Country

Country Name (2 letter code)

Type: String
Parameter Sets: Generate Certificate

Required: False
Position: 1
Accept pipeline input: False

-Locality

Locality Name (eg, city)

Type: String
Parameter Sets: Generate Certificate

Required: False
Position: 3
Accept pipeline input: False

-Organization

Organization Name (eg, company)

Type: String
Parameter Sets: Generate Certificate

Required: False
Position: 4
Accept pipeline input: False

-OrganizationUnit

Organizational Unit Name (eg, section)

Type: String
Parameter Sets: Generate Certificate

Required: False
Position: 5
Accept pipeline input: False

-OutPath

Folder to create certificate files in (.CER and .PFX)

Type: String
Parameter Sets: Generate Certificate

Required: False
Position: Named
Accept pipeline input: False

-Scopes

Specify which permissions scopes to request.

Type: String[]
Parameter Sets: Generate Certificate

Required: False
Position: 0
Accept pipeline input: False

-State

State or Province Name (full name)

Type: String
Parameter Sets: Generate Certificate

Required: False
Position: 2
Accept pipeline input: False

-Store

Local Certificate Store to add the certificate to

Type: StoreLocation
Parameter Sets: Generate Certificate

Required: False
Position: Named
Accept pipeline input: False

-Tenant

The identifier of your tenant, e.g. mytenant.onmicrosoft.com

Type: String
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

-ValidYears

Number of years until expiration (default is 10, max is 30)

Type: Int
Parameter Sets: Generate Certificate

Required: False
Position: 7
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Install-PnPApp

SYNOPSIS

Installs an available app from the app catalog

SYNTAX

Install-PnPApp -Identity <AppMetadataPipeBind>
               [-Scope <AppCatalogScope>]
               [-Wait [<SwitchParameter>]]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Install-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe

This will install an app that is available in the tenant scoped app catalog, specified by the id, to the current site.

——————EXAMPLE 2——————

Install-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Scope Site

This will install an app that is available in the site collection scoped app catalog, specified by the id, to the current site.

——————EXAMPLE 3——————

Get-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe | Install-PnPApp

This will install the given app from the tenant scoped app catalog into the site.

——————EXAMPLE 4——————

Get-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Scope Site | Install-PnPApp

This will install the given app from the site collection scoped app catalog into the site.

PARAMETERS

-Identity

Specifies the Id or an actual app metadata instance

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppMetadataPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Scope

Defines which app catalog to use. Defaults to Tenant

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppCatalogScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Wait

If specified the execution will pause until the app has been installed in the site.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Install-PnPSolution

SYNOPSIS

Installs a sandboxed solution to a site collection. WARNING! This method can delete your composed look gallery due to the method used to activate the solution. We recommend you to only to use this cmdlet if you are okay with that.

SYNTAX

Install-PnPSolution -PackageId <GuidPipeBind>
                    -SourceFilePath <String>
                    [-MajorVersion <Int>]
                    [-MinorVersion <Int>]
                    [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Install-PnPSolution -PackageId c2f5b025-7c42-4d3a-b579-41da3b8e7254 -SourceFilePath mypackage.wsp

Installs the package to the current site

PARAMETERS

-MajorVersion

Optional major version of the solution, defaults to 1

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-MinorVersion

Optional minor version of the solution, defaults to 0

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PackageId

ID of the solution, from the solution manifest

Type: GuidPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-SourceFilePath

Path to the sandbox solution package (.WSP) file

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Invoke-PnPQuery

SYNOPSIS

Executes the currently queued actions

SYNTAX

Invoke-PnPQuery [-RetryCount <Int>]
                [-RetryWait <Int>]
                [-Connection <PnPConnection>]

DESCRIPTION

Executes any queued actions / changes on the SharePoint Client Side Object Model Context

EXAMPLES

——————EXAMPLE 1——————

Invoke-PnPQuery -RetryCount 5

This will execute any queued actions / changes on the SharePoint Client Side Object Model Context and will retry 5 times in case of throttling.

——————EXAMPLE 2——————

Invoke-PnPQuery -RetryWait 10

This will execute any queued actions / changes on the SharePoint Client Side Object Model Context and delay the execution for 10 seconds before it retries the execution.

PARAMETERS

-RetryCount

Number of times to retry in case of throttling. Defaults to 10.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RetryWait

Delay in seconds. Defaults to 1.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Invoke-PnPSiteDesign

SYNOPSIS

Apply a Site Design to an existing site. * Requires Tenant Administration Rights *

SYNTAX

Invoke-PnPSiteDesign -Identity <TenantSiteDesignPipeBind>
                     [-WebUrl <String>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Invoke-PnPSiteDesign -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd

Applies the specified site design to the current site.

——————EXAMPLE 2——————

Invoke-PnPSiteDesign -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd -WebUrl https://contoso.sharepoint.com/sites/mydemosite

Applies the specified site design to the specified site.

——————EXAMPLE 3——————

Get-PnPSiteDesign | ?{$_.Title -eq "Demo"} | Invoke-PnPSiteDesign

Applies the specified site design to the specified site.

PARAMETERS

-Identity

The Site Design Id or an actual Site Design object to apply

Type: TenantSiteDesignPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-WebUrl

The URL of the web to apply the site design to. If not specified it will default to the current web based upon the URL specified with Connect-PnPOnline.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Invoke-PnPSPRestMethod

SYNOPSIS

Invokes a REST request towards a SharePoint site

SYNTAX

Invoke-PnPSPRestMethod -Url <String>
                       [-Method <HttpRequestMethod>]
                       [-Content <Object>]
                       [-ContentType <String>]
                       [-Connection <PnPConnection>]

DESCRIPTION

Invokes a REST request towards a SharePoint site

EXAMPLES

——————EXAMPLE 1——————

Invoke-PnPSPRestMethod -Url /_api/web

This example executes a GET request towards the current site collection and returns the properties of the current web

——————EXAMPLE 2——————

$output = Invoke-PnPSPRestMethod -Url '/_api/web/lists?$select=Id,Title'
$output.value

This example executes a GET request towards the current site collection and returns the id and title of all the lists and outputs them to the console. Notice the use of single quotes. If you want to use double quotes (") then you will have to escape the $ character with a backtick: `$

——————EXAMPLE 3——————

$item = @{Title="Test"}
Invoke-PnPSPRestMethod -Method Post -Url "/_api/web/lists/GetByTitle('Test')/items" -Content $item

This example creates a new item in the list ‘Test’ and sets the title field to ‘Test’

——————EXAMPLE 4——————

$item = "{'Title':'Test'}"
Invoke-PnPSPRestMethod -Method Post -Url "/_api/web/lists/GetByTitle('Test')/items" -Content $item

This example creates a new item in the list ‘Test’ and sets the title field to ‘Test’

——————EXAMPLE 5——————

$item = "{ '__metadata': { 'type': 'SP.Data.TestListItem' }, 'Title': 'Test'}"
Invoke-PnPSPRestMethod -Method Post -Url "/_api/web/lists/GetByTitle('Test')/items" -Content $item -ContentType "application/json;odata=verbose"

This example creates a new item in the list ‘Test’ and sets the title field to ‘Test’

PARAMETERS

-Content

A string or object to send

Type: Object
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ContentType

The content type of the object to send. Defaults to ‘application/json’.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Method

The Http method to execute. Defaults to GET.

Type: HttpRequestMethod
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Url

The url to execute

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Invoke-PnPWebAction

SYNOPSIS

Executes operations on web, lists and list items.

SYNTAX

Invoke-PnPWebAction [-Webs <Web[]>]
                    [-WebAction <Web>]
                    [-ShouldProcessWebAction <Web>]
                    [-PostWebAction <Web>]
                    [-ShouldProcessPostWebAction <Web>]
                    [-WebProperties <String[]>]
                    [-ListAction <List>]
                    [-ShouldProcessListAction <List>]
                    [-PostListAction <List>]
                    [-ShouldProcessPostListAction <List>]
                    [-ListProperties <String[]>]
                    [-ListItemAction <ListItem>]
                    [-ShouldProcessListItemAction <ListItem>]
                    [-ListItemProperties <String[]>]
                    [-SubWebs [<SwitchParameter>]]
                    [-DisableStatisticsOutput [<SwitchParameter>]]
                    [-SkipCounting [<SwitchParameter>]]
                    [-Web <WebPipeBind>]
                    [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Invoke-PnPWebAction -ListAction ${function:ListAction}

This will call the function ListAction on all the lists located on the current web.

——————EXAMPLE 2——————

Invoke-PnPWebAction -ShouldProcessListAction ${function:ShouldProcessList} -ListAction ${function:ListAction}

This will call the function ShouldProcessList, if it returns true the function ListAction will then be called. This will occur on all lists located on the current web

PARAMETERS

-DisableStatisticsOutput

Will not output statistics after the operation

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ListAction

Function to be executed on the list. There is one input parameter of type List

Type: List
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ListItemAction

Function to be executed on the list item. There is one input parameter of type ListItem

Type: ListItem
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ListItemProperties

The properties to load for list items.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ListProperties

The properties to load for list.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PostListAction

Function to be executed on the list, this will trigger after list items have been processed. There is one input parameter of type List

Type: List
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PostWebAction

Function to be executed on the web, this will trigger after lists and list items have been processed. There is one input parameter of type Web

Type: Web
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ShouldProcessListAction

Function to be executed on the web that would determine if ListAction should be invoked, There is one input parameter of type List and the function should return a boolean value

Type: List
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ShouldProcessListItemAction

Function to be executed on the web that would determine if ListItemAction should be invoked, There is one input parameter of type ListItem and the function should return a boolean value

Type: ListItem
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ShouldProcessPostListAction

Function to be executed on the web that would determine if PostListAction should be invoked, There is one input parameter of type List and the function should return a boolean value

Type: List
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ShouldProcessPostWebAction

Function to be executed on the web that would determine if PostWebAction should be invoked, There is one input parameter of type Web and the function should return a boolean value

Type: Web
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ShouldProcessWebAction

Function to be executed on the web that would determine if WebAction should be invoked, There is one input parameter of type Web and the function should return a boolean value

Type: Web
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SkipCounting

Will skip the counting process; by doing this you will not get an estimated time remaining

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SubWebs

Specify if sub webs will be processed

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-WebAction

Function to be executed on the web. There is one input parameter of type Web

Type: Web
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-WebProperties

The properties to load for web.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Webs

Webs you want to process (for example different site collections), will use Web parameter if not specified

Type: Web[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2016, SharePoint 2019 schema: 2.0.0

Measure-PnPList

SYNOPSIS

Returns statistics on the list object. This may fail on lists larger than the list view threshold

SYNTAX

Measure-PnPList -Identity <ListPipeBind>
                [-Includes <String[]>]
                [-ItemLevel [<SwitchParameter>]]
                [-BrokenPermissions [<SwitchParameter>]]
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Measure-PnPList "Documents"

Gets statistics on Documents document library

——————EXAMPLE 2——————

Measure-PnPList "Documents" -BrokenPermissions -ItemLevel

Displays items and folders with broken permissions inside Documents library

PARAMETERS

-BrokenPermissions

Show items with broken permissions

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Includes

Specify properties to include when retrieving objects from the server.

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-ItemLevel

Show item level statistics

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

The web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Measure-PnPResponseTime

SYNOPSIS

Gets statistics on response time for the specified endpoint by sending probe requests

SYNTAX

Measure-PnPResponseTime [-Url <DiagnosticEndpointPipeBind>]
                        [-Count <UInt32>]
                        [-WarmUp <UInt32>]
                        [-Timeout <UInt32>]
                        [-Histogram <UInt32>]
                        [-Mode <MeasureResponseTimeMode>]
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Measure-PnPResponseTime -Count 100 -Timeout 20

Calculates statistics on sequence of 100 probe requests, sleeps 20ms between probes

——————EXAMPLE 2——————

Measure-PnPResponseTime "/Pages/Test.aspx" -Count 1000

Calculates statistics on response time of Test.aspx by sending 1000 requests with default sleep time between requests

——————EXAMPLE 3——————

Measure-PnPResponseTime $web -Count 1000 -WarmUp 10 -Histogram 20 -Timeout 50 | Select -expa Histogram | % {$_.GetEnumerator() | Export-Csv C:\Temp\responsetime.csv -NoTypeInformation}

Builds histogram of response time for the home page of the web and exports to CSV for later processing in Excel

PARAMETERS

-Count

Number of probe requests to send

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Histogram

Number of buckets in histogram in output statistics

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Mode

Response time measurement mode. RoundTrip - measures full request round trip. SPRequestDuration - measures server processing time only, based on SPRequestDuration HTTP header. Latency - difference between RoundTrip and SPRequestDuration

Type: MeasureResponseTimeMode
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Timeout

Idle timeout between requests to avoid request throttling

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Url

Type: DiagnosticEndpointPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-WarmUp

Number of warm up requests to send before start calculating statistics

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2016, SharePoint 2019 schema: 2.0.0

Measure-PnPWeb

SYNOPSIS

Returns statistics on the web object

SYNTAX

Measure-PnPWeb [-Identity <WebPipeBind>]
               [-Recursive [<SwitchParameter>]]
               [-IncludeHiddenList [<SwitchParameter>]]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Measure-PnPWeb

Gets statistics on the current web

——————EXAMPLE 2——————

Measure-PnPWeb $web -Recursive

Gets statistics on the provided web including all its subwebs

PARAMETERS

-Identity

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-IncludeHiddenList

Include hidden lists in statistics calculation

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Recursive

Iterate all sub webs recursively

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Move-PnPClientSideComponent

SYNOPSIS

Moves a Client-Side Component to a different section/column

SYNTAX

Move to other section

Move-PnPClientSideComponent -Section <Int>
                            -Page <ClientSidePagePipeBind>
                            -InstanceId <GuidPipeBind>
                            [-Position <Int>]
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

Move to other column

Move-PnPClientSideComponent -Column <Int>
                            -Page <ClientSidePagePipeBind>
                            -InstanceId <GuidPipeBind>
                            [-Position <Int>]
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

Move within a column

Move-PnPClientSideComponent -Position <Int>
                            -Page <ClientSidePagePipeBind>
                            -InstanceId <GuidPipeBind>
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

Move to other section and column

Move-PnPClientSideComponent -Section <Int>
                            -Column <Int>
                            -Page <ClientSidePagePipeBind>
                            -InstanceId <GuidPipeBind>
                            [-Position <Int>]
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

DESCRIPTION

Moves a Client-Side Component to a different location on the page. Notice that the sections and or columns need to be present before moving the component.

EXAMPLES

——————EXAMPLE 1——————

Move-PnPClientSideComponent -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -Section 1

Moves the specified component to the first section of the page.

——————EXAMPLE 2——————

Move-PnPClientSideComponent -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -Column 2

Moves the specified component to the second column of the current section.

——————EXAMPLE 3——————

Move-PnPClientSideComponent -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -Section 1 -Column 2

Moves the specified component to the first section of the page into the second column.

——————EXAMPLE 4——————

Move-PnPClientSideComponent -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -Section 1 -Column 2 -Position 2

Moves the specified component to the first section of the page into the second column and sets the column to position 2 in the list of webparts.

PARAMETERS

-Column

The column to move the web part to

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: Move to other column, Move to other section and column

Required: True
Position: Named
Accept pipeline input: False

-InstanceId

The instance id of the control. Use Get-PnPClientSideControl retrieve the instance ids.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: GuidPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Page

The name of the page

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Position

Change to order of the web part in the column

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: Move to other column, Move to other section, Move to other section and column, Move within a column

Required: False
Position: Named
Accept pipeline input: False

-Section

The section to move the web part to

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: Move to other section, Move to other section and column

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Move-PnPFile

SYNOPSIS

Moves a file or folder to a different location

SYNTAX

Other Site Collection

Move-PnPFile -TargetServerRelativeLibrary <String>
             [-ServerRelativeUrl <String>]
             [-SiteRelativeUrl <String>]
             [-OverwriteIfAlreadyExists [<SwitchParameter>]]
             [-AllowSchemaMismatch [<SwitchParameter>]]
             [-AllowSmallerVersionLimitOnDestination [<SwitchParameter>]]
             [-IgnoreVersionHistory [<SwitchParameter>]]
             [-Force [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

Server Relative

Move-PnPFile -ServerRelativeUrl <String>
             -TargetUrl <String>
             [-OverwriteIfAlreadyExists [<SwitchParameter>]]
             [-Force [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

Site Relative

Move-PnPFile -SiteRelativeUrl <String>
             -TargetUrl <String>
             [-OverwriteIfAlreadyExists [<SwitchParameter>]]
             [-Force [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

DESCRIPTION

Allows moving a file or folder to a different location inside the same document library, such as in a subfolder, to a different document library on the same site collection or to a document library on another site collection

EXAMPLES

——————EXAMPLE 1——————

PS:>Move-PnPFile -SiteRelativeUrl "Shared Documents/Document.docx" -TargetUrl "/sites/project/Archive/Document2.docx"

Moves a file named Document.docx located in the document library named “Shared Documents” in the current site to the document library named “Archive” in the same site, renaming the file to Document2.docx. If a file named Document2.docx already exists at the destination, it won’t perform the move.

——————EXAMPLE 2——————

PS:>Move-PnPFile -ServerRelativeUrl "/sites/project/Shared Documents/Document.docx -TargetUrl "/sites/project/Archive/Document.docx" -OverwriteIfAlreadyExists

Moves a file named Document.docx located in the document library named “Shared Documents” in the current site to the document library named “Archive” in the same site. If a file named Document.docx already exists at the destination, it will overwrite it.

——————EXAMPLE 3——————

PS:>Move-PnPFile -ServerRelativeUrl "/sites/project/Shared Documents/Document.docx" -TargetServerRelativeLibrary "/sites/otherproject/Shared Documents" -OverwriteIfAlreadyExists -AllowSchemaMismatch -AllowSmallerVersionLimitOnDestination

Moves a file named Document.docx located in the document library named “Shared Documents” in the current site to the document library named “Shared Documents” in another site collection “otherproject” allowing it to overwrite an existing file Document.docx in the destination, allowing the fields to be different on the destination document library from the source document library and allowing a lower document version limit on the destination compared to the source.

——————EXAMPLE 4——————

PS:>Move-PnPFile -ServerRelativeUrl "/sites/project/Shared Documents/Archive" -TargetServerRelativeLibrary "/sites/archive/Project" -AllowSchemaMismatch -AllowSmallerVersionLimitOnDestination

Moves a folder named Archive located in the document library named “Shared Documents” in the current site to the document library named “Project” in another site collection “archive” not allowing it to overwrite an existing folder named “Archive” in the destination, allowing the fields to be different on the destination document library from the source document library and allowing a lower document version limit on the destination compared to the source.

PARAMETERS

-AllowSchemaMismatch

If provided and the target document library specified using TargetServerRelativeLibrary has different fields than the document library where the document is being moved from, the move will succeed. If not provided, it will fail to protect against data loss of metadata stored in fields that cannot be moved along.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Other Site Collection

Required: False
Position: Named
Accept pipeline input: False

-AllowSmallerVersionLimitOnDestination

If provided and the target document library specified using TargetServerRelativeLibrary is configured to keep less historical versions of documents than the document library where the document is being moved from, the move will succeed. If not provided, it will fail to protect against data loss of historical versions that cannot be moved along.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Other Site Collection

Required: False
Position: Named
Accept pipeline input: False

-Force

If provided, no confirmation will be requested and the action will be performed

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IgnoreVersionHistory

If provided, only the latest version of the document will be moved and its history will be discared. If not provided, all historical versions will be moved along.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Other Site Collection

Required: False
Position: Named
Accept pipeline input: False

-OverwriteIfAlreadyExists

If provided, if a file or folder already exists at the TargetUrl, it will be overwritten. If omitted, the move operation will be canceled if the file or folder already exists at the TargetUrl location.

Type: SwitchParameter
Parameter Sets: Server Relative, Site Relative, Other Site Collection

Required: False
Position: Named
Accept pipeline input: False

-ServerRelativeUrl

Server relative Url specifying the file to move. Must include the file name.

Type: String
Parameter Sets: Server Relative, Other Site Collection

Required: True
Position: 0
Accept pipeline input: True

-SiteRelativeUrl

Site relative Url specifying the file or folder to move. Must include the file or folder name.

Type: String
Parameter Sets: Site Relative, Other Site Collection

Required: True
Position: 0
Accept pipeline input: True

-TargetServerRelativeLibrary

Server relative url of a document library where to move the fileor folder to. Must not include the file or folder name.

Only applicable to: SharePoint Online

Type: String
Parameter Sets: Other Site Collection

Required: True
Position: 1
Accept pipeline input: False

-TargetUrl

Server relative Url where to move the file or folder to. Must include the file or folder name.

Type: String
Parameter Sets: Site Relative, Server Relative

Required: True
Position: 1
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Move-PnPFolder

SYNOPSIS

Move a folder to another location in the current web. If you want to move a folder to a different site collection, use the Move-PnPFile cmdlet instead, which also supports moving folders and also accross site collections.

SYNTAX

Move-PnPFolder -Folder <String>
               -TargetFolder <String>
               [-Web <WebPipeBind>]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Move-PnPFolder -Folder Documents/Reports -TargetFolder 'Archived Reports'

This will move the folder Reports in the Documents library to the ‘Archived Reports’ library

——————EXAMPLE 2——————

Move-PnPFolder -Folder 'Shared Documents/Reports/2016/Templates' -TargetFolder 'Shared Documents/Reports'

This will move the folder Templates to the new location in ‘Shared Documents/Reports’

PARAMETERS

-Folder

The folder to move

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-TargetFolder

The new parent location to which the folder should be moved to

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Folder

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Move-PnPItemProxy

SYNOPSIS

Proxy cmdlet for using Move-Item between SharePoint provider and FileSystem provider

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Move-PnPListItemToRecycleBin

SYNOPSIS

Moves an item from a list to the Recycle Bin

SYNTAX

Move-PnPListItemToRecycleBin -List <ListPipeBind>
                             -Identity <ListItemPipeBind>
                             [-Force [<SwitchParameter>]]
                             [-Web <WebPipeBind>]
                             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Move-PnPListItemToRecycleBin -List "Demo List" -Identity "1" -Force

Moves the listitem with id “1” from the “Demo List” list to the Recycle Bin.

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The ID of the listitem, or actual ListItem object

Type: ListItemPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-List

The ID, Title or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Move-PnPRecycleBinItem

SYNOPSIS

Moves all items or a specific item in the first stage recycle bin of the current site collection to the second stage recycle bin

SYNTAX

Move-PnPRecycleBinItem [-Identity <RecycleBinItemPipeBind>]
                       [-Force [<SwitchParameter>]]
                       [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Move-PnpRecycleBinItem

Moves all the items in the first stage recycle bin of the current site collection to the second stage recycle bin

——————EXAMPLE 2——————

Move-PnpRecycleBinItem -Identity 26ffff29-b526-4451-9b6f-7f0e56ba7125

Moves the item with the provided ID in the first stage recycle bin of the current site collection to the second stage recycle bin without asking for confirmation first

——————EXAMPLE 3——————

Move-PnpRecycleBinItem -Force

Moves all the items in the first stage recycle bin of the current context to the second stage recycle bin without asking for confirmation first

PARAMETERS

-Force

If provided, no confirmation will be asked to move the first stage recycle bin items to the second stage

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

If provided, moves the item with the specific ID to the second stage recycle bin

Type: RecycleBinItemPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPAzureCertificate

SYNOPSIS

Generate a new 2048bit self-signed certificate and manifest settings for use when using CSOM via an app-only ADAL application.

See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/SharePoint.ConnectUsingAppPermissions for a sample on how to get started.

KeyCredentials contains the ADAL app manifest sections.

Certificate contains the PEM encoded certificate.

PrivateKey contains the PEM encoded private key of the certificate.

SYNTAX

New-PnPAzureCertificate [-CommonName <String>]
                        [-Country <String>]
                        [-State <String>]
                        [-Locality <String>]
                        [-Organization <String>]
                        [-OrganizationUnit <String>]
                        [-OutPfx <String>]
                        [-OutCert <String>]
                        [-ValidYears <Int>]
                        [-CertificatePassword <SecureString>]

EXAMPLES

——————EXAMPLE 1——————

New-PnPAzureCertificate -OutPfx pnp.pfx -OutCert pnp.cer

This will generate a default self-signed certificate named “pnp.contoso.com” valid for 10 years and output a pfx and cer file.

——————EXAMPLE 2——————

New-PnPAzureCertificate -CommonName "My Certificate" -ValidYears 30 

This will output a certificate named “My Certificate” which expires in 30 years from now.

PARAMETERS

-CertificatePassword

Optional certificate password

Type: SecureString
Parameter Sets: (All)

Required: False
Position: 8
Accept pipeline input: False

-CommonName

Common Name (e.g. server FQDN or YOUR name) [pnp.contoso.com]

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Country

Country Name (2 letter code)

Type: String
Parameter Sets: (All)

Required: False
Position: 1
Accept pipeline input: False

-Locality

Locality Name (eg, city)

Type: String
Parameter Sets: (All)

Required: False
Position: 3
Accept pipeline input: False

-Organization

Organization Name (eg, company)

Type: String
Parameter Sets: (All)

Required: False
Position: 4
Accept pipeline input: False

-OrganizationUnit

Organizational Unit Name (eg, section)

Type: String
Parameter Sets: (All)

Required: False
Position: 5
Accept pipeline input: False

-OutCert

Filename to write to, optionally including full path (.cer)

Type: String
Parameter Sets: (All)

Required: False
Position: 6
Accept pipeline input: False

-OutPfx

Filename to write to, optionally including full path (.pfx)

Type: String
Parameter Sets: (All)

Required: False
Position: 6
Accept pipeline input: False

-State

State or Province Name (full name)

Type: String
Parameter Sets: (All)

Required: False
Position: 2
Accept pipeline input: False

-ValidYears

Number of years until expiration (default is 10, max is 30)

Type: Int
Parameter Sets: (All)

Required: False
Position: 7
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPExtensibilityHandlerObject

SYNOPSIS

Creates an ExtensibilityHandler Object, to be used by the Get-PnPProvisioningTemplate cmdlet

SYNTAX

New-PnPExtensibilityHandlerObject -Assembly <String>
                                  -Type <String>
                                  [-Configuration <String>]
                                  [-Disabled [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————


$handler = New-PnPExtensibilityHandlerObject -Assembly Contoso.Core.Handlers -Type Contoso.Core.Handlers.MyExtensibilityHandler
Get-PnPProvisioningTemplate -Out NewTemplate.xml -ExtensibilityHandlers $handler

This will create a new ExtensibilityHandler object that is run during extraction of the template

PARAMETERS

-Assembly

The full assembly name of the handler

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Configuration

Any configuration data you want to send to the handler

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Disabled

If set, the handler will be disabled

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Type

The type of the handler

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

OUTPUTS

OfficeDevPnP.Core.Framework.Provisioning.Model.ExtensibilityHandler

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

New-PnPGraphSubscription

SYNOPSIS

Creates a new Microsof Graph Subscription which allows your webhook API to be called when a change occurs in Microsoft Graph

SYNTAX

New-PnPGraphSubscription -ChangeType <GraphSubscriptionChangeType>
                         -NotificationUrl <String>
                         -Resource <String>
                         [-ExpirationDateTime <DateTime>]
                         [-ClientState <String>]
                         [-LatestSupportedTlsVersion <GraphSubscriptionTlsVersion>]
                         [-ByPassPermissionCheck [<SwitchParameter>]]

DESCRIPTION

Creates a new Microsof Graph Subscription. The required Azure Active Directory application permission depends on the resource creating the subscription for, see https://docs.microsoft.com/graph/api/subscription-post-subscriptions#permissions. For a sample ASP.NET WebApi webhook implementation to receive the notifications from Microsoft Graph, see https://github.com/microsoftgraph/msgraph-training-changenotifications/blob/b8d21ca7aa5feeece336287c9a781e71b7ba01c6/demos/01-create-application/Controllers/NotificationsController.cs#L51.

EXAMPLES

——————EXAMPLE 1——————

New-PnPGraphSubscription -ChangeType Create -NotificationUrl https://mywebapiservice/notifications -Resource "me/mailFolders('Inbox')/messages" -ExpirationDateTime (Get-Date).AddDays(1) -ClientState [Guid]::NewGuid().ToString()

Creates a new Microsoft Graph subscription listening for incoming mail during the next 24 hours in the inbox of the user under which the connection has been made and will signal the URL provided through NotificationUrl when a message comes in

——————EXAMPLE 2——————

New-PnPGraphSubscription -ChangeType Updates -NotificationUrl https://mywebapiservice/notifications -Resource "Users" -ExpirationDateTime (Get-Date).AddHours(1) -ClientState [Guid]::NewGuid().ToString()

Creates a new Microsoft Graph subscription listening for changes to user objects during the next hour and will signal the URL provided through NotificationUrl when a change has been made

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ChangeType

The event(s) the subscription should trigger on

Type: GraphSubscriptionChangeType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ClientState

Specifies the value of the clientState property sent by the service in each notification. The maximum length is 128 characters. The client can check that the notification came from the service by comparing the value of the clientState property sent with the subscription with the value of the clientState property received with each notification.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ExpirationDateTime

The datetime defining how long this subscription should stay alive before which it needs to get extended to stay alive. See https://docs.microsoft.com/graph/api/resources/subscription#maximum-length-of-subscription-per-resource-type for the supported maximum lifetime of the subscriber endpoints.

Type: DateTime
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LatestSupportedTlsVersion

Specifies the latest version of Transport Layer Security (TLS) that the notification endpoint, specified by NotificationUrl, supports. If not provided, TLS 1.2 will be assumed.

Type: GraphSubscriptionTlsVersion
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-NotificationUrl

The URL that should be called when an event matching this subscription occurs

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Resource

The resource to monitor for changes. See https://docs.microsoft.com/graph/api/subscription-post-subscriptions#resources-examples for the list with supported options.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPGroup

SYNOPSIS

Adds group to the Site Groups List and returns a group object

SYNTAX

New-PnPGroup -Title <String>
             [-Description <String>]
             [-Owner <String>]
             [-AllowRequestToJoinLeave [<SwitchParameter>]]
             [-AutoAcceptRequestToJoinLeave [<SwitchParameter>]]
             [-AllowMembersEditMembership [<SwitchParameter>]]
             [-DisallowMembersViewMembership [<SwitchParameter>]]
             [-RequestToJoinEmail <String>]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

New-PnPGroup -Title "My Site Users"

PARAMETERS

-AllowMembersEditMembership

A switch parameter that specifies whether group members can modify membership in the group

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-AllowRequestToJoinLeave

A switch parameter that specifies whether to allow users to request membership in the group and to allow users to request to leave the group

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-AutoAcceptRequestToJoinLeave

A switch parameter that specifies whether users are automatically added or removed when they make a request

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The description for the group

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisallowMembersViewMembership

A switch parameter that disallows group members to view membership.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owner

The owner for the group, which can be a user or another group

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RequestToJoinEmail

The e-mail address to which membership requests are sent

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

The Title of the group

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Group

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPList

SYNOPSIS

Creates a new list

SYNTAX

New-PnPList -Title <String>
            -Template <ListTemplateType>
            [-Url <String>]
            [-Hidden [<SwitchParameter>]]
            [-EnableVersioning [<SwitchParameter>]]
            [-EnableContentTypes [<SwitchParameter>]]
            [-OnQuickLaunch [<SwitchParameter>]]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

New-PnPList -Title Announcements -Template Announcements

Create a new announcements list

——————EXAMPLE 2——————

New-PnPList -Title "Demo List" -Url "lists/DemoList" -Template Announcements

Create an announcements list with a title that is different from the url

——————EXAMPLE 3——————

New-PnPList -Title HiddenList -Template GenericList -Hidden

Create a new custom list and hides it from the SharePoint UI

PARAMETERS

-EnableContentTypes

Switch parameter if content types should be enabled on this list

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableVersioning

Switch parameter if versioning should be enabled

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Hidden

Switch parameter if list should be hidden from the SharePoint UI

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-OnQuickLaunch

Switch parameter if this list should be visible on the QuickLaunch

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Template

The type of list to create.

Type: ListTemplateType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Title

The Title of the list

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Url

If set, will override the url of the list.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

New-PnPMicrosoft365Group

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Directory.ReadWrite.All, Group.Create, Group.ReadWrite.All

Creates a new Microsoft 365 Group

SYNTAX

New-PnPMicrosoft365Group -DisplayName <String>
                         -Description <String>
                         -MailNickname <String>
                         [-Owners <String[]>]
                         [-Members <String[]>]
                         [-IsPrivate [<SwitchParameter>]]
                         [-GroupLogoPath <String>]
                         [-CreateTeam [<SwitchParameter>]]
                         [-Force [<SwitchParameter>]]
                         [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

New-PnPMicrosoft365Group -DisplayName $displayName -Description $description -MailNickname $nickname

Creates a public Microsoft 365 Group with all the required properties

——————EXAMPLE 2——————

New-PnPMicrosoft365Group -DisplayName $displayName -Description $description -MailNickname $nickname -Owners $arrayOfOwners -Members $arrayOfMembers

Creates a public Microsoft 365 Group with all the required properties, and with a custom list of Owners and a custom list of Members

——————EXAMPLE 3——————

New-PnPMicrosoft365Group -DisplayName $displayName -Description $description -MailNickname $nickname -IsPrivate

Creates a private Microsoft 365 Group with all the required properties

——————EXAMPLE 4——————

New-PnPMicrosoft365Group -DisplayName $displayName -Description $description -MailNickname $nickname -Owners $arrayOfOwners -Members $arrayOfMembers -IsPrivate

Creates a private Microsoft 365 Group with all the required properties, and with a custom list of Owners and a custom list of Members

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CreateTeam

Creates a Microsoft Teams team associated with created group

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The Description of the Microsoft 365 Group

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-DisplayName

The Display Name of the Microsoft 365 Group

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-GroupLogoPath

The path to the logo file of to set

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IsPrivate

Makes the group private when selected

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-MailNickname

The Mail Nickname of the Microsoft 365 Group. Cannot contain spaces.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Members

The array UPN values of the group’s members

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owners

The array UPN values of the group’s owners

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and PracticesDocumentation

applicable: SharePoint Online schema: 2.0.0

New-PnPPersonalSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Office365 only: Creates a personal / OneDrive For Business site

SYNTAX

New-PnPPersonalSite -Email <String[]>
                    [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

$users = ('katiej@contoso.onmicrosoft.com','garth@contoso.onmicrosoft.com')
                 New-PnPPersonalSite -Email $users

Creates a personal / OneDrive For Business site for the 2 users in the variable $users

PARAMETERS

-Email

The UserPrincipalName (UPN) of the users

Type: String[]
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPProvisioningTemplate

SYNOPSIS

Creates a new provisioning template object

EXAMPLES

——————EXAMPLE 1——————

$template = New-PnPProvisioningTemplate

Creates a new instance of a site template object.

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPProvisioningTemplateFromFolder

SYNOPSIS

Generates a provisioning template from a given folder, including only files that are present in that folder

SYNTAX

New-PnPProvisioningTemplateFromFolder [-Out <String>]
                                      [-Folder <String>]
                                      [-Match <String>]
                                      [-ContentType <ContentTypePipeBind>]
                                      [-Properties <Hashtable>]
                                      [-AsIncludeFile [<SwitchParameter>]]
                                      [-Force [<SwitchParameter>]]
                                      [-Encoding <Encoding>]
                                      [-TargetFolder <String>]
                                      [-Schema <XMLPnPSchemaVersion>]
                                      [-Web <WebPipeBind>]
                                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

New-PnPProvisioningTemplateFromFolder -Out template.xml

Creates an empty provisioning template, and includes all files in the current folder.

——————EXAMPLE 2——————

New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp

Creates an empty provisioning template, and includes all files in the c:\temp folder.

——————EXAMPLE 3——————

New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp -Match *.js

Creates an empty provisioning template, and includes all files with a JS extension in the c:\temp folder.

——————EXAMPLE 4——————

New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp -Match *.js -TargetFolder "Shared Documents"

Creates an empty provisioning template, and includes all files with a JS extension in the c:\temp folder and marks the files in the template to be added to the ‘Shared Documents’ folder

——————EXAMPLE 5——————

New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp -Match *.js -TargetFolder "Shared Documents" -ContentType "Test Content Type"

Creates an empty provisioning template, and includes all files with a JS extension in the c:\temp folder and marks the files in the template to be added to the ‘Shared Documents’ folder. It will add a property to the item for the content type.

——————EXAMPLE 6——————

New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp -Match *.js -TargetFolder "Shared Documents" -Properties @{"Title" = "Test Title"; "Category"="Test Category"}

Creates an empty provisioning template, and includes all files with a JS extension in the c:\temp folder and marks the files in the template to be added to the ‘Shared Documents’ folder. It will add the specified properties to the file entries.

——————EXAMPLE 7——————

New-PnPProvisioningTemplateFromFolder -Out template.pnp

Creates an empty provisioning template as a pnp package file, and includes all files in the current folder

——————EXAMPLE 8——————

New-PnPProvisioningTemplateFromFolder -Out template.pnp -Folder c:\temp

Creates an empty provisioning template as a pnp package file, and includes all files in the c:\temp folder

PARAMETERS

-AsIncludeFile

If specified, the output will only contain the <pnp:Files> element. This allows the output to be included in another template.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ContentType

An optional content type to use.

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Encoding

The encoding type of the XML file, Unicode is default

Type: Encoding
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Folder

Folder to process. If not specified the current folder will be used.

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Force

Overwrites the output file if it exists.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Match

Optional wildcard pattern to match filenames against. If empty all files will be included.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Out

Filename to write to, optionally including full path.

Type: String
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Properties

Additional properties to set for every file entry in the generated template.

Type: Hashtable
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Schema

The schema of the output to use, defaults to the latest schema

Type: XMLPnPSchemaVersion
Parameter Sets: (All)

Required: False
Position: 1
Accept pipeline input: False

-TargetFolder

Target folder to provision to files to. If not specified, the current folder name will be used.

Type: String
Parameter Sets: (All)

Required: False
Position: 1
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and PracticesEncoding

applicable: SharePoint Online schema: 2.0.0

New-PnPSite

SYNOPSIS

Creates either a communication site or a Microsoft 365 group-connected team site

SYNTAX

Communication Site with Built-In Site Design

New-PnPSite -Title <String>
            -Url <String>
            -Type <SiteType>
            [-Description <String>]
            [-Classification <String>]
            [-SensitivityLabel <String>]
            [-Owner <String>]
            [-PreferredDataLocation <Office365Geography>]
            [-AllowFileSharingForGuestUsers [<SwitchParameter>]]
            [-SiteDesign <CommunicationSiteDesign>]
            [-Lcid <UInt32>]
            [-HubSiteId <GuidPipeBind>]
            [-Wait [<SwitchParameter>]]
            [-Connection <PnPConnection>]

Team Site

New-PnPSite -Title <String>
            -Alias <String>
            -Type <SiteType>
            [-Lcid <UInt32>]
            [-Description <String>]
            [-Classification <String>]
            [-SensitivityLabel <String>]
            [-IsPublic [<SwitchParameter>]]
            [-Owners <String[]>]
            [-PreferredDataLocation <Office365Geography>]
            [-HubSiteId <GuidPipeBind>]
            [-Wait [<SwitchParameter>]]
            [-Connection <PnPConnection>]

Communication Site with Custom Design

New-PnPSite -Title <String>
            -Url <String>
            -SiteDesignId <GuidPipeBind>
            -Type <SiteType>
            [-Description <String>]
            [-Classification <String>]
            [-SensitivityLabel <String>]
            [-Owner <String>]
            [-PreferredDataLocation <Office365Geography>]
            [-AllowFileSharingForGuestUsers [<SwitchParameter>]]
            [-Lcid <UInt32>]
            [-HubSiteId <GuidPipeBind>]
            [-Wait [<SwitchParameter>]]
            [-Connection <PnPConnection>]

DESCRIPTION

The New-PnPSite cmdlet creates a new site collection for the current tenant. Currently only ‘modern’ sites like Communication Site and the Modern Microsoft 365 group-connected team sites are supported. If you want to create a classic site, use New-PnPTenantSite.

EXAMPLES

——————EXAMPLE 1——————

New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso

This will create a new Communications Site collection with the title ‘Contoso’ and the url ‘https://tenant.sharepoint.com/sites/contoso'

——————EXAMPLE 2——————

New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -SiteDesign Showcase

This will create a new Communications Site collection with the title ‘Contoso’ and the url ‘https://tenant.sharepoint.com/sites/contoso'. It will use the ‘Showcase’ design for the site.

——————EXAMPLE 3——————

New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -SiteDesignId ae2349d5-97d6-4440-94d1-6516b72449ac

This will create a new Communications Site collection with the title ‘Contoso’ and the url ‘https://tenant.sharepoint.com/sites/contoso'. It will use the specified custom site design for the site.

——————EXAMPLE 4——————

New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -Classification "HBI"

This will create a new Communications Site collection with the title ‘Contoso’ and the url ‘https://tenant.sharepoint.com/sites/contoso'. The classification for the site will be set to “HBI”

——————EXAMPLE 5——————

New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -ShareByEmailEnabled

This will create a new Communications Site collection with the title ‘Contoso’ and the url ‘https://tenant.sharepoint.com/sites/contoso'. Allows owners to invite users outside of the organization.

——————EXAMPLE 6——————

New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -Lcid 1040

This will create a new Communications Site collection with the title ‘Contoso’ and the url ‘https://tenant.sharepoint.com/sites/contoso' and sets the default language to Italian.

——————EXAMPLE 7——————

New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso

This will create a new Modern Team Site collection with the title ‘Team Contoso’ and the url ‘https://tenant.sharepoint.com/sites/contoso' or ‘https://tenant.sharepoint.com/teams/contoso' based on the managed path configuration in the SharePoint Online Admin portal.

——————EXAMPLE 8——————

New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso -IsPublic

This will create a new Modern Team Site collection with the title ‘Team Contoso’ and the url ‘https://tenant.sharepoint.com/sites/contoso' or ‘https://tenant.sharepoint.com/teams/contoso' based on the managed path configuration in the SharePoint Online Admin portal and sets the site to public.

——————EXAMPLE 9——————

New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso -Lcid 1040

This will create a new Modern Team Site collection with the title ‘Team Contoso’ and the url ‘https://tenant.sharepoint.com/sites/contoso' or ‘https://tenant.sharepoint.com/teams/contoso' based on the managed path configuration in the SharePoint Online Admin portal and sets the default language of the site to Italian.

PARAMETERS

-Alias

Specifies the alias of the new site collection which represents the part of the URL that will be assigned to the site behind ‘https://tenant.sharepoint.com/sites/' or ‘https://tenant.sharepoint.com/teams/' based on the managed path configuration in the SharePoint Online Admin portal, this parameter only applies to Modern Team Sites

Type: String
Parameter Sets: Team Site

Required: True
Position: 0
Accept pipeline input: False

-AllowFileSharingForGuestUsers

Specifies if guest users can share files in the new site collection

Type: SwitchParameter
Parameter Sets: Communication Site with Built-In Site Design

Required: False
Position: 0
Accept pipeline input: False

-Classification

Specifies the classification of the new site collection

Type: String
Parameter Sets: Communication Site with Built-In Site Design

Required: False
Position: 0
Accept pipeline input: False

-Description

Specifies the description of the new site collection

Type: String
Parameter Sets: Communication Site with Built-In Site Design

Required: False
Position: 0
Accept pipeline input: False

-HubSiteId

If specified the site will be associated to the hubsite as identified by this id

Type: GuidPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IsPublic

Specifies if the Office 365 Group should be public. Defaults to private.

Type: SwitchParameter
Parameter Sets: Team Site

Required: False
Position: 0
Accept pipeline input: False

-Lcid

Specifies the language of the new site collection. Defaults to the current language of the web connected to. For more information, see Locale IDs supported by SharePoint at https://github.com/pnp/PnP-PowerShell/wiki/Supported-LCIDs-by-SharePoint. To get the list of supported languages on a SharePoint environment use: Get-PnPAvailableLanguage.

Type: UInt32
Parameter Sets: Communication Site with Built-In Site Design

Required: False
Position: 0
Accept pipeline input: False

-Owner

Specifies the owner of the site. Specify the value as a string array: “user@domain.com

Type: String
Parameter Sets: Communication Site with Built-In Site Design

Required: False
Position: 0
Accept pipeline input: False

-Owners

Specifies the owners of the site. Specify the value as a string array: “user@domain.com”,“anotheruser@domain.com

Type: String[]
Parameter Sets: Team Site

Required: False
Position: 0
Accept pipeline input: False

-PreferredDataLocation

Allows specifying in which geography the SharePoint site collection should be created. I.e. NAM, EUR, APC. For a full list of available regions, see https://docs.microsoft.com/office365/enterprise/multi-geo-add-group-with-pdl#geo-location-codes. Only supported on multi-geo enabled tenants.

Type: Office365Geography
Parameter Sets: Communication Site with Built-In Site Design

Required: False
Position: 0
Accept pipeline input: False

-SensitivityLabel

Specifies the sensitivity label of the new site collection

Type: String
Parameter Sets: Communication Site with Built-In Site Design

Required: False
Position: 0
Accept pipeline input: False

-SiteDesign

Specifies the site design of the new site collection. Defaults to ‘Topic’

Type: CommunicationSiteDesign
Parameter Sets: Communication Site with Built-In Site Design

Required: False
Position: 0
Accept pipeline input: False

-SiteDesignId

Specifies the site design id to use for the new site collection. If specified will override SiteDesign

Type: GuidPipeBind
Parameter Sets: Communication Site with Custom Design

Required: True
Position: 0
Accept pipeline input: False

-Title

Specifies the title of the new site collection

Type: String
Parameter Sets: Communication Site with Built-In Site Design

Required: True
Position: 0
Accept pipeline input: False

-Type

Specifies with type of site to create.

Type: SiteType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Url

Specifies the full url of the new site collection, this parameter only applies to Communications Sites

Type: String
Parameter Sets: Communication Site with Built-In Site Design

Required: True
Position: 0
Accept pipeline input: False

-Wait

If specified the cmdlet will wait until the site has been fully created and all site artifacts have been provisioned by SharePoint. Notice that this can take a while.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

System.String

Returns the url of the newly created site collection

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

New-PnPTeamsApp

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of AppCatalog.ReadWrite.All, Directory.ReadWrite.All

Adds an app to the Teams App Catalog.

SYNTAX

New-PnPTeamsApp -Path <String>
                [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

New-PnPTeamsApp -Path c:\myapp.zip

Adds the app as defined in the zip file to the Teams App Catalog

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Path

The path pointing to the packaged/zip file containing the app

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

New-PnPTeamsTeam

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Creates a new Team in Microsoft Teams. The cmdlet will create a Microsoft 365 group and then add a team to the group.

SYNTAX

For an existing group

New-PnPTeamsTeam -GroupId <String>
                 [-Owner <String>]
                 [-AllowAddRemoveApps <Boolean>]
                 [-AllowChannelMentions <Boolean>]
                 [-AllowCreateUpdateChannels <Boolean>]
                 [-AllowCreateUpdateRemoveConnectors <Boolean>]
                 [-AllowCreateUpdateRemoveTabs <Boolean>]
                 [-AllowCustomMemes <Boolean>]
                 [-AllowDeleteChannels <Boolean>]
                 [-AllowGiphy <Boolean>]
                 [-AllowGuestCreateUpdateChannels <Boolean>]
                 [-AllowGuestDeleteChannels <Boolean>]
                 [-AllowOwnerDeleteMessages <Boolean>]
                 [-AllowStickersAndMemes <Boolean>]
                 [-AllowTeamMentions <Boolean>]
                 [-AllowUserDeleteMessages <Boolean>]
                 [-AllowUserEditMessages <Boolean>]
                 [-GiphyContentRating <TeamGiphyContentRating>]
                 [-ShowInTeamsSearchAndSuggestions <Boolean>]
                 [-Classification <String>]
                 [-ByPassPermissionCheck [<SwitchParameter>]]

For a new group

New-PnPTeamsTeam -DisplayName <String>
                 [-MailNickName <String>]
                 [-Description <String>]
                 [-Visibility <TeamVisibility>]
                 [-Owner <String>]
                 [-AllowAddRemoveApps <Boolean>]
                 [-AllowChannelMentions <Boolean>]
                 [-AllowCreateUpdateChannels <Boolean>]
                 [-AllowCreateUpdateRemoveConnectors <Boolean>]
                 [-AllowCreateUpdateRemoveTabs <Boolean>]
                 [-AllowCustomMemes <Boolean>]
                 [-AllowDeleteChannels <Boolean>]
                 [-AllowGiphy <Boolean>]
                 [-AllowGuestCreateUpdateChannels <Boolean>]
                 [-AllowGuestDeleteChannels <Boolean>]
                 [-AllowOwnerDeleteMessages <Boolean>]
                 [-AllowStickersAndMemes <Boolean>]
                 [-AllowTeamMentions <Boolean>]
                 [-AllowUserDeleteMessages <Boolean>]
                 [-AllowUserEditMessages <Boolean>]
                 [-GiphyContentRating <TeamGiphyContentRating>]
                 [-ShowInTeamsSearchAndSuggestions <Boolean>]
                 [-Classification <String>]
                 [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Get-PnPTeamsTeam

Retrieves all the Microsoft Teams instances

——————EXAMPLE 2——————

Get-PnPTeamsTeam -GroupId $groupId

Retrieves a specific Microsoft Teams instance

——————EXAMPLE 3——————

Get-PnPTeamsTeam -Visibility Public

Retrieves all Microsoft Teams instances which are public visible

PARAMETERS

-AllowAddRemoveApps

Boolean value that determines whether or not members (not only owners) are allowed to add apps to the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowChannelMentions

Boolean value that determines whether or not channels in the team can be @ mentioned so that all users who follow the channel are notified.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowCreateUpdateChannels

Setting that determines whether or not members (and not just owners) are allowed to create channels.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowCreateUpdateRemoveConnectors

Setting that determines whether or not members (and not only owners) can manage connectors in the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowCreateUpdateRemoveTabs

Setting that determines whether or not members (and not only owners) can manage tabs in channels.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowCustomMemes

Setting that determines whether or not members can use the custom memes functionality in teams.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowDeleteChannels

Setting that determines whether or not members (and not only owners) can delete channels in the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowGiphy

Setting that determines whether or not giphy can be used in the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowGuestCreateUpdateChannels

Setting that determines whether or not guests can create channels in the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowGuestDeleteChannels

Setting that determines whether or not guests can delete in the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowOwnerDeleteMessages

Setting that determines whether or not owners can delete messages that they or other members of the team have posted.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowStickersAndMemes

Setting that determines whether stickers and memes usage is allowed in the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowTeamMentions

Setting that determines whether the entire team can be @ mentioned (which means that all users will be notified)

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowUserDeleteMessages

Setting that determines whether or not members can delete messages that they have posted.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowUserEditMessages

Setting that determines whether or not users can edit messages that they have posted.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Classification

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Description

Team description. Characters Limit - 1024.

Type: String
Parameter Sets: For a new group

Required: False
Position: Named
Accept pipeline input: False

-DisplayName

Team display name. Characters Limit - 256.

Type: String
Parameter Sets: For a new group

Required: True
Position: Named
Accept pipeline input: False

-GiphyContentRating

Setting that determines the level of sensitivity of giphy usage that is allowed in the team. Accepted values are “Strict” or “Moderate”

Type: TeamGiphyContentRating
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-GroupId

Specify a GroupId to convert to a Team. If specified, you cannot provide the other values that are already specified by the existing group, namely: Visibility, Alias, Description, or DisplayName.

Type: String
Parameter Sets: For an existing group

Required: True
Position: Named
Accept pipeline input: False

-MailNickName

The MailNickName parameter specifies the alias for the associated Microsoft 365 Group. This value will be used for the mail enabled object and will be used as PrimarySmtpAddress for this Microsoft 365 Group.The value of the MailNickName parameter has to be unique across your tenant.

Type: String
Parameter Sets: For a new group

Required: False
Position: Named
Accept pipeline input: False

-Owner

An admin who is allowed to create on behalf of another user should use this flag to specify the desired owner of the group.This user will be added as both a member and an owner of the group. If not specified, the user who creates the team will be added as both a member and an owner.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-ShowInTeamsSearchAndSuggestions

Setting that determines whether or not private teams should be searchable from Teams clients for users who do not belong to that team. Set to $false to make those teams not discoverable from Teams clients.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Visibility

Set to Public to allow all users in your organization to join the group by default. Set to Private to require that an owner approve the join request.

Type: TeamVisibility
Parameter Sets: For a new group

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

New-PnPTenantSequence

SYNOPSIS

Creates a new tenant sequence object

SYNTAX

New-PnPTenantSequence [-Id <String>]

EXAMPLES

——————EXAMPLE 1——————

$sequence = New-PnPTenantSequence

Creates a new instance of a tenant sequence object.

——————EXAMPLE 2——————

$sequence = New-PnPTenantSequence -Id "MySequence"

Creates a new instance of a tenant sequence object and sets the Id to the value specified.

PARAMETERS

-Id

Optional Id of the sequence

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

New-PnPTenantSequenceCommunicationSite

SYNOPSIS

Creates a communication site object

SYNTAX

New-PnPTenantSequenceCommunicationSite -Url <String>
                                       -Title <String>
                                       [-Language <UInt32>]
                                       [-Owner <String>]
                                       [-Description <String>]
                                       [-Classification <String>]
                                       [-SiteDesignId <String>]
                                       [-HubSite [<SwitchParameter>]]
                                       [-AllowFileSharingForGuestUsers [<SwitchParameter>]]
                                       [-TemplateIds <String[]>]

EXAMPLES

——————EXAMPLE 1——————

$site = New-PnPTenantSequenceCommunicationSite -Url "/sites/mycommunicationsite" -Title "My Team Site"

Creates a new communication site object with the specified variables

PARAMETERS

-AllowFileSharingForGuestUsers

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Classification

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-HubSite

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Language

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owner

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SiteDesignId

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateIds

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Url

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

New-PnPTenantSequenceTeamNoGroupSite

SYNOPSIS

Creates a new team site without a Microsoft 365 group in-memory object

SYNTAX

New-PnPTenantSequenceTeamNoGroupSite -Url <String>
                                     -Title <String>
                                     -TimeZoneId <UInt32>
                                     [-Language <UInt32>]
                                     [-Owner <String>]
                                     [-Description <String>]
                                     [-HubSite [<SwitchParameter>]]
                                     [-TemplateIds <String[]>]

EXAMPLES

——————EXAMPLE 1——————

$site = New-PnPTenantSequenceTeamNoGroupSite -Url "/sites/MyTeamSite" -Title "My Team Site"

Creates a new team site object with the specified variables

PARAMETERS

-Description

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-HubSite

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Language

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owner

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateIds

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TimeZoneId

Type: UInt32
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Title

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Url

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

New-PnPTenantSequenceTeamNoGroupSubSite

SYNOPSIS

Creates a team site subsite with no Microsoft 365 group object

SYNTAX

New-PnPTenantSequenceTeamNoGroupSubSite -Url <String>
                                        -Title <String>
                                        -TimeZoneId <UInt32>
                                        [-Language <UInt32>]
                                        [-Description <String>]
                                        [-TemplateIds <String[]>]
                                        [-QuickLaunchDisabled [<SwitchParameter>]]
                                        [-UseDifferentPermissionsFromParentSite [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

$site = New-PnPTenantSequenceTeamNoGroupSubSite -Url "MyTeamSubsite" -Title "My Team Site" -TimeZoneId 4

Creates a new team site subsite object with the specified variables

PARAMETERS

-Description

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Language

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-QuickLaunchDisabled

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateIds

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TimeZoneId

Type: UInt32
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Title

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Url

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-UseDifferentPermissionsFromParentSite

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

New-PnPTenantSequenceTeamSite

SYNOPSIS

Creates a team site object

SYNTAX

New-PnPTenantSequenceTeamSite -Alias <String>
                              -Title <String>
                              [-Description <String>]
                              [-DisplayName <String>]
                              [-Classification <String>]
                              [-Public [<SwitchParameter>]]
                              [-HubSite [<SwitchParameter>]]
                              [-TemplateIds <String[]>]

EXAMPLES

——————EXAMPLE 1——————

$site = New-PnPTenantSequenceTeamSite -Alias "MyTeamSite" -Title "My Team Site"

Creates a new team site object with the specified variables

PARAMETERS

-Alias

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Classification

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisplayName

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-HubSite

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Public

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateIds

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPTenantSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Creates a new (classic) site collection for the current tenant

SYNTAX

New-PnPTenantSite -Title <String>
                  -Url <String>
                  -Owner <String>
                  -TimeZone <Int>
                  [-Lcid <UInt32>]
                  [-Template <String>]
                  [-ResourceQuota <Double>]
                  [-ResourceQuotaWarningLevel <Double>]
                  [-StorageQuota <Int>]
                  [-StorageQuotaWarningLevel <Int>]
                  [-RemoveDeletedSite [<SwitchParameter>]]
                  [-Wait [<SwitchParameter>]]
                  [-Force [<SwitchParameter>]]
                  [-Connection <PnPConnection>]

DESCRIPTION

The New-PnPTenantSite cmdlet creates a new site collection for the current company. However, creating a new SharePoint Online site collection fails if a deleted site with the same URL exists in the Recycle Bin. If you want to use this command for an on-premises farm, please refer to http://blogs.msdn.com/b/vesku/archive/2014/06/09/provisioning-site-collections-using-sp-app-model-in-on-premises-with-just-csom.aspx

EXAMPLES

——————EXAMPLE 1——————

New-PnPTenantSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -Owner user@example.org -TimeZone 4 -Template STS#0

This will add a site collection with the title ‘Contoso’, the url ‘https://tenant.sharepoint.com/sites/contoso', the timezone ‘UTC+01:00’,the owner ‘user@example.org’ and the template used will be STS#0, a TeamSite

——————EXAMPLE 2——————

New-PnPTenantSite -Title Contoso -Url /sites/contososite -Owner user@example.org -TimeZone 4 -Template STS#0

This will add a site collection with the title ‘Contoso’, the url ‘https://tenant.sharepoint.com/sites/contososite' of which the base part will be picked up from your current connection, the timezone ‘UTC+01:00’, the owner ‘user@example.org’ and the template used will be STS#0, a TeamSite

PARAMETERS

-Force

Do not ask for confirmation.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Lcid

Specifies the language of this site collection. For more information, see Locale IDs supported by SharePoint at https://github.com/pnp/PnP-PowerShell/wiki/Supported-LCIDs-by-SharePoint. To get the list of supported languages on a SharePoint environment use: Get-PnPAvailableLanguage.

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owner

Specifies the user name of the site collection’s primary owner. The owner must be a user instead of a security group or an email-enabled security group.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-RemoveDeletedSite

Specifies if any existing site with the same URL should be removed from the recycle bin

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ResourceQuota

Specifies the quota for this site collection in Sandboxed Solutions units. This value must not exceed the company’s aggregate available Sandboxed Solutions quota. The default value is 0. For more information, see Resource Usage Limits on Sandboxed Solutions in SharePoint 2010 : http://msdn.microsoft.com/en-us/library/gg615462.aspx.

Type: Double
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ResourceQuotaWarningLevel

Specifies the warning level for the resource quota. This value must not exceed the value set for the ResourceQuota parameter

Type: Double
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-StorageQuota

Specifies the storage quota for this site collection in megabytes. This value must not exceed the company’s available quota.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-StorageQuotaWarningLevel

Specifies the warning level for the storage quota in megabytes. This value must not exceed the values set for the StorageQuota parameter

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Template

Specifies the site collection template type. Use the Get-PnPWebTemplates cmdlet to get the list of valid templates. If no template is specified, one can be added later. The Template and LocaleId parameters must be a valid combination as returned from the Get-PnPWebTemplates cmdlet.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TimeZone

Use Get-PnPTimeZoneId to retrieve possible timezone values

Type: Int
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Title

Specifies the title of the new site collection

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Url

Specifies the full URL of the new site collection. It must be in a valid managed path in the company’s site. For example, for company contoso, valid managed paths are https://contoso.sharepoint.com/sites and https://contoso.sharepoint.com/teams.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Wait

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and PracticesLocale IDsResource Usage Limits on Sandboxed Solutions in SharePoint 2010Creating on-premises site collections using CSOM

applicable: SharePoint Online schema: 2.0.0

New-PnPTenantTemplate

SYNOPSIS

Creates a new tenant template object

SYNTAX

New-PnPTenantTemplate [-Author <String>]
                      [-Description <String>]
                      [-DisplayName <String>]
                      [-Generator <String>]

EXAMPLES

——————EXAMPLE 1——————

$template = New-PnPTenantTemplate

Creates a new instance of a tenant template object.

PARAMETERS

-Author

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisplayName

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Generator

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPTerm

SYNOPSIS

Creates a taxonomy term

SYNTAX

New-PnPTerm -Name <String>
            -TermSet <Id, Title or TaxonomyItem>
            -TermGroup <Id, Title or TermGroup>
            [-Id <Guid>]
            [-Lcid <Int>]
            [-Description <String>]
            [-CustomProperties <Hashtable>]
            [-LocalCustomProperties <Hashtable>]
            [-TermStore <Id, Name or Object>]
            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

New-PnPTerm -TermSet "Departments" -TermGroup "Corporate" -Name "Finance"

Creates a new taxonomy term named “Finance” in the termset Departments which is located in the “Corporate” termgroup

PARAMETERS

-CustomProperties

Custom Properties

Type: Hashtable
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

Descriptive text to help users understand the intended use of this term.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Id

The Id to use for the term; if not specified, or the empty GUID, a random GUID is generated and used.

Type: Guid
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Lcid

The locale id to use for the term. Defaults to the current locale id.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LocalCustomProperties

Custom Properties

Type: Hashtable
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Name

The name of the term.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-TermGroup

The termgroup to create the term in.

Type: Id, Title or TermGroup
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-TermSet

The termset to add the term to.

Type: Id, Title or TaxonomyItem
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-TermStore

Term store to check; if not specified the default term store is used.

Type: Id, Name or Object
Parameter Sets: __AllParameterSets
Aliases: TermStoreName

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Taxonomy.Term

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPTermGroup

SYNOPSIS

Creates a taxonomy term group

SYNTAX

New-PnPTermGroup -Name <String>
                 [-Id <Guid>]
                 [-Description <String>]
                 [-TermStore <Id, Name or Object>]
                 [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

New-PnPTermGroup -GroupName "Countries"

Creates a new taxonomy term group named “Countries”

PARAMETERS

-Description

Description to use for the term group.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Id

GUID to use for the term group; if not specified, or the empty GUID, a random GUID is generated and used.

Type: Guid
Parameter Sets: (All)
Aliases: GroupId

Required: False
Position: Named
Accept pipeline input: False

-Name

Name of the taxonomy term group to create.

Type: String
Parameter Sets: (All)
Aliases: GroupName

Required: True
Position: Named
Accept pipeline input: True

-TermStore

Term store to add the group to; if not specified the default term store is used.

Type: Id, Name or Object
Parameter Sets: (All)
Aliases: TermStoreName

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Taxonomy.TermGroup

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPTermLabel

SYNOPSIS

Creates a localized label for a taxonomy term

SYNTAX

New-PnPTermLabel -Term <Id, Title or TaxonomyItem>
                 -Name <String>
                 -Lcid <Int>
                 [-IsDefault [<SwitchParameter>]]
                 [-Connection <PnPConnection>]

DESCRIPTION

Creates a localized label for a taxonomy term. Use Get-PnPTerm -Include Labels to request the current labels on a taxonomy term.

EXAMPLES

——————EXAMPLE 1——————

New-PnPTermLabel -Name "Finanzwesen" -Lcid 1031 -Term (Get-PnPTerm -Identity "Finance" -TermSet "Departments" -TermGroup "Corporate")

Creates a new localized taxonomy label in German (LCID 1031) named “Finanzwesen” for the term “Finance” in the termset Departments which is located in the “Corporate” termgroup

——————EXAMPLE 2——————

Get-PnPTerm -Identity "Finance" -TermSet "Departments" -TermGroup "Corporate" | New-PnPTermLabel -Name "Finanzwesen" -Lcid 1031

Creates a new localized taxonomy label in German (LCID 1031) named “Finanzwesen” for the term “Finance” in the termset Departments which is located in the “Corporate” termgroup

PARAMETERS

-IsDefault

Makes this new label the default label

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Lcid

The locale id to use for the localized term

Type: Int
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Name

The localized name of the term

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Term

The term to add the localized label to

Type: Id, Title or TaxonomyItem
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Taxonomy.Label

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPTermSet

SYNOPSIS

Creates a taxonomy term set

SYNTAX

New-PnPTermSet -Name <String>
               -TermGroup <Id, Title or TermGroup>
               [-Id <Guid>]
               [-Lcid <Int>]
               [-Contact <String>]
               [-Description <String>]
               [-IsOpenForTermCreation [<SwitchParameter>]]
               [-IsNotAvailableForTagging [<SwitchParameter>]]
               [-Owner <String>]
               [-StakeHolders <String[]>]
               [-CustomProperties <Hashtable>]
               [-TermStore <Id, Name or Object>]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

New-PnPTermSet -Name "Department" -TermGroup "Corporate"

Creates a new termset named “Department” in the group named “Corporate”

PARAMETERS

-Contact

An e-mail address for term suggestion and feedback. If left blank the suggestion feature will be disabled.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CustomProperties

Type: Hashtable
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

Descriptive text to help users understand the intended use of this term set.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Id

The Id to use for the term set; if not specified, or the empty GUID, a random GUID is generated and used.

Type: Guid
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IsNotAvailableForTagging

By default a term set is available to be used by end users and content editors of sites consuming this term set. Specify this switch to turn this off

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IsOpenForTermCreation

When a term set is closed, only metadata managers can add terms to this term set. When it is open, users can add terms from a tagging application. Not specifying this switch will make the term set closed.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Lcid

The locale id to use for the term set. Defaults to the current locale id.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Name

The name of the termset.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Owner

The primary user or group of this term set.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-StakeHolders

People and groups in the organization that should be notified before major changes are made to the term set. You can enter multiple users or groups.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TermGroup

Name, id or actually termgroup to create the termset in.

Type: Id, Title or TermGroup
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-TermStore

Term store to check; if not specified the default term store is used.

Type: Id, Name or Object
Parameter Sets: (All)
Aliases: TermStoreName

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Taxonomy.TermSet

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

New-PnPUnifiedGroup

SYNOPSIS

Creates a new Office 365 Group (aka Unified Group). Requires the Azure Active Directory application permission ‘Group.ReadWrite.All’.

SYNTAX

New-PnPUnifiedGroup -DisplayName <String>
                    -Description <String>
                    -MailNickname <String>
                    [-Owners <String[]>]
                    [-Members <String[]>]
                    [-IsPrivate [<SwitchParameter>]]
                    [-GroupLogoPath <String>]
                    [-CreateTeam [<SwitchParameter>]]
                    [-Force [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

New-PnPUnifiedGroup -DisplayName $displayName -Description $description -MailNickname $nickname

Creates a public Office 365 Group with all the required properties

——————EXAMPLE 2——————

New-PnPUnifiedGroup -DisplayName $displayName -Description $description -MailNickname $nickname -Owners $arrayOfOwners -Members $arrayOfMembers

Creates a public Office 365 Group with all the required properties, and with a custom list of Owners and a custom list of Members

——————EXAMPLE 3——————

New-PnPUnifiedGroup -DisplayName $displayName -Description $description -MailNickname $nickname -IsPrivate

Creates a private Office 365 Group with all the required properties

——————EXAMPLE 4——————

New-PnPUnifiedGroup -DisplayName $displayName -Description $description -MailNickname $nickname -Owners $arrayOfOwners -Members $arrayOfMembers -IsPrivate

Creates a private Office 365 Group with all the required properties, and with a custom list of Owners and a custom list of Members

PARAMETERS

-CreateTeam

Creates a MS Teams team associated with created group.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The Description of the Office 365 Group.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-DisplayName

The Display Name of the Office 365 Group.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-GroupLogoPath

The path to the logo file of to set.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IsPrivate

Makes the group private when selected.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-MailNickname

The Mail Nickname of the Office 365 Group. Cannot contain spaces.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Members

The array UPN values of the group’s members.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owners

The array UPN values of the group’s owners.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

New-PnPUPABulkImportJob

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Submit up a new user profile bulk import job.

SYNTAX

New-PnPUPABulkImportJob -Folder <String>
                        -Path <String>
                        -UserProfilePropertyMapping <Hashtable>
                        -IdProperty <String>
                        [-IdType <ImportProfilePropertiesUserIdType>]
                        [-Connection <PnPConnection>]

DESCRIPTION

See https://docs.microsoft.com/sharepoint/dev/solution-guidance/bulk-user-profile-update-api-for-sharepoint-online for information on the API and how the bulk import process works.

EXAMPLES

——————EXAMPLE 1——————

@" 
 {
  "value": [
    {
      "IdName": "mikaels@contoso.com",
      "Department": "PnP",
    },
	{
      "IdName": "vesaj@contoso.com",
      "Department": "PnP",
    }    
  ]
}
"@ > profiles.json

New-PnPUPABulkImportJob -Folder "Shared Documents" -Path profiles.json -IdProperty "IdName" -UserProfilePropertyMapping @{"Department"="Department"}

This will submit a new user profile bulk import job to SharePoint Online.

PARAMETERS

-Folder

Site or server relative URL of the folder to where you want to store the import job file.

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-IdProperty

The name of the identifying property in your file.

Type: String
Parameter Sets: (All)

Required: True
Position: 3
Accept pipeline input: False

-IdType

The type of profile identifier (Email/CloudId/PrincipalName). Defaults to Email.

Type: ImportProfilePropertiesUserIdType
Parameter Sets: (All)

Required: False
Position: 4
Accept pipeline input: False

-Path

The local file path.

Type: String
Parameter Sets: (All)

Required: True
Position: 1
Accept pipeline input: False

-UserProfilePropertyMapping

Specify user profile property mapping between the import file and UPA property names.

Type: Hashtable
Parameter Sets: (All)

Required: True
Position: 2
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPUser

SYNOPSIS

Adds a user to the built-in Site User Info List and returns a user object

SYNTAX

New-PnPUser -LoginName <String>
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

New-PnPUser -LoginName user@company.com

Adds a new user with the login user@company.com to the current site

PARAMETERS

-LoginName

The users login name (user@company.com)

Type: String
Parameter Sets: (All)
Aliases: LogonName

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.User

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

New-PnPWeb

SYNOPSIS

Creates a new subweb under the current web

SYNTAX

New-PnPWeb -Title <String>
           -Url <String>
           -Template <String>
           [-Description <String>]
           [-Locale <Int>]
           [-BreakInheritance [<SwitchParameter>]]
           [-InheritNavigation [<SwitchParameter>]]
           [-Web <WebPipeBind>]
           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

New-PnPWeb -Title "Project A Web" -Url projectA -Description "Information about Project A" -Locale 1033 -Template "STS#0"

Creates a new subweb under the current web with URL projectA

PARAMETERS

-BreakInheritance

By default the subweb will inherit its security from its parent, specify this switch to break this inheritance

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The description of the new web

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-InheritNavigation

Specifies whether the site inherits navigation.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Locale

The language id of the new web. default = 1033 for English

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Template

The site definition template to use for the new web, e.g. STS#0. Use Get-PnPWebTemplates to fetch a list of available templates

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Title

The title of the new web

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Url

The URL of the new web

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Web

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Publish-PnPApp

SYNOPSIS

Publishes/Deploys/Trusts an available app in the app catalog

SYNTAX

Publish-PnPApp -Identity <AppMetadataPipeBind>
               [-SkipFeatureDeployment [<SwitchParameter>]]
               [-Scope <AppCatalogScope>]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Publish-PnPApp -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f

This will deploy/trust an app into the app catalog. Notice that the app needs to be available in the tenant scoped app catalog

——————EXAMPLE 2——————

Publish-PnPApp -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f -Scope Site

This will deploy/trust an app into the app catalog. Notice that the app needs to be available in the site collection scoped app catalog

PARAMETERS

-Identity

Specifies the Id of the app

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppMetadataPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Scope

Defines which app catalog to use. Defaults to Tenant

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppCatalogScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SkipFeatureDeployment

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Read-PnPProvisioningTemplate

SYNOPSIS

Loads/Reads a PnP file from the file system or a string

SYNTAX

By Path

Read-PnPProvisioningTemplate -Path <String>
                             [-TemplateProviderExtensions <ITemplateProviderExtension[]>]

By XML

Read-PnPProvisioningTemplate -Xml <String>
                             [-TemplateProviderExtensions <ITemplateProviderExtension[]>]

EXAMPLES

——————EXAMPLE 1——————

Read-PnPProvisioningTemplate -Path template.pnp

Loads a PnP file from the file system

——————EXAMPLE 2——————

Read-PnPProvisioningTemplate -Path template.pnp -TemplateProviderExtensions $extensions

Loads a PnP file from the file system using some custom template provider extensions while loading the file.

——————EXAMPLE 3——————

Read-PnPProvisioningTemplate -Xml $xml

Reads a PnP Provisioning template from a string containing the XML of a provisioning template

PARAMETERS

-Path

Filename to read from, optionally including full path.

Type: String
Parameter Sets: By Path

Required: True
Position: 0
Accept pipeline input: False

-TemplateProviderExtensions

Allows you to specify ITemplateProviderExtension to execute while loading the template.

Type: ITemplateProviderExtension[]
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Xml

Variable to read from, containing the valid XML of a provisioning template.

Type: String
Parameter Sets: By XML

Required: True
Position: 1
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Read-PnPTenantTemplate

SYNOPSIS

Loads/Reads a PnP tenant template from the file system and returns an in-memory instance of this template.

SYNTAX

Read-PnPTenantTemplate -Path <String>
                       [-TemplateProviderExtensions <ITemplateProviderExtension[]>]

EXAMPLES

——————EXAMPLE 1——————

Read-PnPTenantTemplate -Path template.pnp

Reads a PnP tenant template file from the file system and returns an in-memory instance

PARAMETERS

-Path

Filename to read from, optionally including full path.

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-TemplateProviderExtensions

Allows you to specify ITemplateProviderExtension to execute while loading the template.

Type: ITemplateProviderExtension[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Register-PnPAppCatalogSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Creates a new App Catalog Site and sets this site as the Tenant App Catalog

SYNTAX

Register-PnPAppCatalogSite -Url <String>
                           -Owner <String>
                           -TimeZoneId <Int>
                           [-Force [<SwitchParameter>]]
                           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Register-PnPAppCatalogSite -Url https://yourtenant.sharepoint.com/sites/appcatalog -Owner admin@domain.com -TimeZoneId 4

This will create a new appcatalog site if no app catalog is already present. Use -Force to create a new appcatalog site if one has already been registered. If using the same URL as an existing one and Force is present, the current/existing appcatalog site will be deleted.

PARAMETERS

-Force

If specified, and an app catalog is already present, a new app catalog site will be created. If the same URL is used the existing/current app catalog site will be deleted first.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owner

The login account of the user designated to be the admin for the site, e.g. user@domain.com

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-TimeZoneId

Use Get-PnPTimeZoneId to retrieve possible timezone values

Type: Int
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Url

The full url of the app catalog site to be created, e.g. https://yourtenant.sharepoint.com/sites/appcatalog

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Register-PnPHubSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Registers a site as a hubsite

SYNTAX

Register-PnPHubSite -Site <SitePipeBind>
                    [-Connection <PnPConnection>]

DESCRIPTION

Registers a site as a hubsite

EXAMPLES

——————EXAMPLE 1——————

Register-PnPHubSite -Site https://tenant.sharepoint.com/sites/myhubsite

This example registers the specified site as a hubsite

PARAMETERS

-Site

The site to register as a hubsite

Type: SitePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Remove-PnPAlert

SYNOPSIS

Removes an alert for a user

SYNTAX

Remove-PnPAlert -Identity <AlertPipeBind>
                [-User <UserPipeBind>]
                [-Force [<SwitchParameter>]]
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPAlert -Identity 641ac67f-0ce0-4837-874a-743c8f8572a7

Removes the alert with the specified ID for the current user

——————EXAMPLE 2——————

Remove-PnPAlert -Identity 641ac67f-0ce0-4837-874a-743c8f8572a7 -User "i:0#.f|membership|Alice@contoso.onmicrosoft.com"

Removes the alert with the specified ID for the user specified

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The alert id, or the actual alert object to remove.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AlertPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-User

User to remove the alert for (User ID, login name or actual User object). Skip this parameter to use the current user. Note: Only site owners can remove alerts for other users.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: UserPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Remove-PnPApp

SYNOPSIS

Removes an app from the app catalog

SYNTAX

Remove-PnPApp -Identity <AppMetadataPipeBind>
              [-Scope <AppCatalogScope>]
              [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe

This will remove the specified app from the tenant scoped app catalog

——————EXAMPLE 2——————

Remove-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Scope Site

This will remove the specified app from the site collection scoped app catalog

PARAMETERS

-Identity

Specifies the Id of the Addin Instance

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppMetadataPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Scope

Defines which app catalog to use. Defaults to Tenant

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppCatalogScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Remove-PnPApplicationCustomizer

SYNOPSIS

Removes a SharePoint Framework client side extension application customizer

SYNTAX

Custom Action Id

Remove-PnPApplicationCustomizer [-Identity <UserCustomActionPipeBind>]
                                [-Scope <CustomActionScope>]
                                [-Force [<SwitchParameter>]]
                                [-Web <WebPipeBind>]
                                [-Connection <PnPConnection>]

Client Side Component Id

Remove-PnPApplicationCustomizer -ClientSideComponentId <GuidPipeBind>
                                [-Scope <CustomActionScope>]
                                [-Force [<SwitchParameter>]]
                                [-Web <WebPipeBind>]
                                [-Connection <PnPConnection>]

DESCRIPTION

Removes a SharePoint Framework client side extension application customizer by removing a user custom action from a web or sitecollection

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPApplicationCustomizer -Identity aa66f67e-46c0-4474-8a82-42bf467d07f2

Removes the custom action representing the client side extension registration with the id ‘aa66f67e-46c0-4474-8a82-42bf467d07f2’.

——————EXAMPLE 2——————

Remove-PnPApplicationCustomizer -ClientSideComponentId aa66f67e-46c0-4474-8a82-42bf467d07f2 -Scope web

Removes the custom action(s) being registered for a SharePoint Framework solution having the id ‘aa66f67e-46c0-4474-8a82-42bf467d07f2’ in its manifest from the current web.

PARAMETERS

-ClientSideComponentId

The Client Side Component Id of the SharePoint Framework client side extension application customizer found in the manifest for which existing custom action(s) should be removed

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: GuidPipeBind
Parameter Sets: Client Side Component Id

Required: True
Position: Named
Accept pipeline input: False

-Force

Use the -Force flag to bypass the confirmation question

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The id or name of the CustomAction representing the client side extension registration that needs to be removed or a CustomAction instance itself

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: UserCustomActionPipeBind
Parameter Sets: Custom Action Id

Required: False
Position: 0
Accept pipeline input: True

-Scope

Define if the CustomAction representing the client side extension registration is to be found at the web or site collection scope. Specify All to allow deletion from either web or site collection (default).

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: CustomActionScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Remove-PnPClientSideComponent

SYNOPSIS

Removes a Client-Side component from a page

SYNTAX

Remove-PnPClientSideComponent -Page <ClientSidePagePipeBind>
                              -InstanceId <GuidPipeBind>
                              [-Force [<SwitchParameter>]]
                              [-Web <WebPipeBind>]
                              [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPClientSideComponent -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82

Removes the control specified from the page.

——————EXAMPLE 2——————

$webpart = Get-PnPClientSideComponent -Page "Home" | Where-Object { $_.Title -eq "Site activity" }
Remove-PnPClientSideComponent -Page "Home" -InstanceId $webpart.InstanceId -Force

Finds a web part with the Title “Site activity” on the Home.aspx page, then removes it from the page

PARAMETERS

-Force

If specified you will not receive the confirmation question

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-InstanceId

The instance id of the component

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: GuidPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Page

The name of the page

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Remove-PnPClientSidePage

SYNOPSIS

Removes a Client-Side Page

SYNTAX

Remove-PnPClientSidePage -Identity <ClientSidePagePipeBind>
                         [-Force [<SwitchParameter>]]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPClientSidePage -Identity "MyPage"

Removes the Client-Side page named ‘MyPage.aspx’

——————EXAMPLE 2——————

Remove-PnPClientSidePage -Identity "Templates/MyPageTemplate"

Removes the specified Client-Side page which is located in the Templates folder of the Site Pages library.

——————EXAMPLE 3——————

Remove-PnPClientSidePage $page

Removes the specified Client-Side page which is contained in the $page variable.

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The name of the page

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPContentType

SYNOPSIS

Removes a content type from a web

SYNTAX

Remove-PnPContentType -Identity <ContentTypePipeBind>
                      [-Force [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPContentType -Identity "Project Document"

This will remove a content type called “Project Document” from the current web

——————EXAMPLE 2——————

Remove-PnPContentType -Identity "Project Document" -Force

This will remove a content type called “Project Document” from the current web with force

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The name or ID of the content type to remove

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPContentTypeFromDocumentSet

SYNOPSIS

Removes a content type from a document set

SYNTAX

Remove-PnPContentTypeFromDocumentSet -ContentType <ContentTypePipeBind>
                                     -DocumentSet <DocumentSetPipeBind>
                                     [-Web <WebPipeBind>]
                                     [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPContentTypeFromDocumentSet -ContentType "Test CT" -DocumentSet "Test Document Set"

This will remove the content type called ‘Test CT’ from the document set called ‘‘Test Document Set’

——————EXAMPLE 2——————

Remove-PnPContentTypeFromDocumentSet -ContentType 0x0101001F1CEFF1D4126E4CAD10F00B6137E969 -DocumentSet 0x0120D520005DB65D094035A241BAC9AF083F825F3B

This will remove the content type with ID ‘0x0101001F1CEFF1D4126E4CAD10F00B6137E969’ from the document set with ID ‘0x0120D520005DB65D094035A241BAC9AF083F825F3B’

PARAMETERS

-ContentType

The content type to remove. Either specify name, an id, or a content type object.

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-DocumentSet

The document set to remove the content type from. Either specify a name, a document set template object, an id, or a content type object

Type: DocumentSetPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPContentTypeFromList

SYNOPSIS

Removes a content type from a list

SYNTAX

Remove-PnPContentTypeFromList -List <ListPipeBind>
                              -ContentType <ContentTypePipeBind>
                              [-Web <WebPipeBind>]
                              [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPContentTypeFromList -List "Documents" -ContentType "Project Document"

This will remove a content type called “Project Document” from the “Documents” list

PARAMETERS

-ContentType

The name of a content type, its ID or an actual content type object that needs to be removed from the specified list.

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-List

The name of the list, its ID or an actual list object from where the content type needs to be removed from

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPCustomAction

SYNOPSIS

Removes a custom action

SYNTAX

Remove-PnPCustomAction [-Identity <UserCustomActionPipeBind>]
                       [-Scope <CustomActionScope>]
                       [-Force [<SwitchParameter>]]
                       [-Web <WebPipeBind>]
                       [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPCustomAction -Identity aa66f67e-46c0-4474-8a82-42bf467d07f2

Removes the custom action with the id ‘aa66f67e-46c0-4474-8a82-42bf467d07f2’.

——————EXAMPLE 2——————

Remove-PnPCustomAction -Identity aa66f67e-46c0-4474-8a82-42bf467d07f2 -Scope web

Removes the custom action with the id ‘aa66f67e-46c0-4474-8a82-42bf467d07f2’ from the current web.

——————EXAMPLE 3——————

Remove-PnPCustomAction -Identity aa66f67e-46c0-4474-8a82-42bf467d07f2 -Force

Removes the custom action with the id ‘aa66f67e-46c0-4474-8a82-42bf467d07f2’ without asking for confirmation.

——————EXAMPLE 4——————

Get-PnPCustomAction -Scope All | ? Location -eq ScriptLink | Remove-PnPCustomAction

Removes all custom actions that are ScriptLinks

PARAMETERS

-Force

Use the -Force flag to bypass the confirmation question

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The id or name of the CustomAction that needs to be removed or a CustomAction instance itself

Type: UserCustomActionPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Scope

Define if the CustomAction is to be found at the web or site collection scope. Specify All to allow deletion from either web or site collection.

Type: CustomActionScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPDeletedMicrosoft365Group

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Permanently removes one deleted Microsoft 365 Group

SYNTAX

Remove-PnPDeletedMicrosoft365Group -Identity <Microsoft365GroupPipeBind>
                                   [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPDeletedMicrosoft365Group -Identity 38b32e13-e900-4d95-b860-fb52bc07ca7f

Permanently removes a deleted Microsoft 365 Group based on its ID

——————EXAMPLE 2——————

$group = Get-PnPDeletedMicrosoft365Group -Identity 38b32e13-e900-4d95-b860-fb52bc07ca7f
Remove-PnPDeletedMicrosoft365Group -Identity $group

Permanently removes the provided deleted Microsoft 365 Group

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the deleted Microsoft 365 Group

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPDeletedUnifiedGroup

SYNOPSIS

Permanently removes one deleted Office 365 Group (aka Unified Group)

SYNTAX

Remove-PnPDeletedUnifiedGroup -Identity <UnifiedGroupPipeBind>

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPDeletedUnifiedGroup -Identity 38b32e13-e900-4d95-b860-fb52bc07ca7f

Permanently removes a deleted Office 365 Group based on its ID

——————EXAMPLE 2——————

$group = Get-PnPDeletedUnifiedGroup -Identity 38b32e13-e900-4d95-b860-fb52bc07ca7f
Remove-PnPDeletedUnifiedGroup -Identity $group

Permanently removes the provided deleted Office 365 Group

PARAMETERS

-Identity

The Identity of the deleted Office 365 Group

Type: UnifiedGroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPEventReceiver

SYNOPSIS

Remove an eventreceiver

SYNTAX

List

Remove-PnPEventReceiver -Identity <EventReceiverPipeBind>
                        [-List <ListPipeBind>]
                        [-Force [<SwitchParameter>]]
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

DESCRIPTION

Removes/unregisters a specific eventreceiver

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPEventReceiver -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22

This will remove the event receiver with ReceiverId “fb689d0e-eb99-4f13-beb3-86692fd39f22” from the current web

——————EXAMPLE 2——————

Remove-PnPEventReceiver -List ProjectList -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22

This will remove the event receiver with ReceiverId “fb689d0e-eb99-4f13-beb3-86692fd39f22” from the “ProjectList” list

——————EXAMPLE 3——————

Remove-PnPEventReceiver -List ProjectList -Identity MyReceiver

This will remove the event receiver with ReceiverName “MyReceiver” from the “ProjectList” list

——————EXAMPLE 4——————

Remove-PnPEventReceiver -List ProjectList

This will remove all event receivers from the “ProjectList” list

——————EXAMPLE 5——————

Remove-PnPEventReceiver

This will remove all event receivers from the current site

——————EXAMPLE 6——————

Get-PnPEventReceiver | ? ReceiverUrl -Like "*azurewebsites.net*" | Remove-PnPEventReceiver

This will remove all event receivers from the current site which are pointing to a service hosted on Azure Websites

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Guid of the event receiver on the list

Type: EventReceiverPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-List

The list object from where to remove the event receiver object

Type: ListPipeBind
Parameter Sets: List

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPField

SYNOPSIS

Removes a field from a list or a site

SYNTAX

Remove-PnPField -Identity <FieldPipeBind>
                [-Force [<SwitchParameter>]]
                [-List <ListPipeBind>]
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPField -Identity "Speakers"

Removes the speakers field from the site columns

——————EXAMPLE 2——————

Remove-PnPField -List "Demo list" -Identity "Speakers"

Removes the speakers field from the list Demo list

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The field object or name to remove

Type: FieldPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-List

The list object or name where to remove the field from

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: 1
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPFieldFromContentType

SYNOPSIS

Removes a site column from a content type

SYNTAX

Remove-PnPFieldFromContentType -Field <FieldPipeBind>
                               -ContentType <ContentTypePipeBind>
                               [-DoNotUpdateChildren [<SwitchParameter>]]
                               [-Web <WebPipeBind>]
                               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPFieldFromContentType -Field "Project_Name" -ContentType "Project Document"

This will remove the site column with an internal name of “Project_Name” from a content type called “Project Document”

——————EXAMPLE 2——————

Remove-PnPFieldFromContentType -Field "Project_Name" -ContentType "Project Document" -DoNotUpdateChildren

This will remove the site column with an internal name of “Project_Name” from a content type called “Project Document”. It will not update content types that inherit from the “Project Document” content type.

PARAMETERS

-ContentType

The content type where the field is to be removed from

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-DoNotUpdateChildren

If specified, inherited content types will not be updated

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Field

The field to remove

Type: FieldPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPFile

SYNOPSIS

Removes a file.

SYNTAX

Server Relative

Remove-PnPFile -ServerRelativeUrl <String>
               [-Recycle [<SwitchParameter>]]
               [-Force [<SwitchParameter>]]
               [-Web <WebPipeBind>]
               [-Connection <PnPConnection>]

Site Relative

Remove-PnPFile -SiteRelativeUrl <String>
               [-Recycle [<SwitchParameter>]]
               [-Force [<SwitchParameter>]]
               [-Web <WebPipeBind>]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

PS:>Remove-PnPFile -ServerRelativeUrl /sites/project/_catalogs/themes/15/company.spcolor

Removes the file company.spcolor

——————EXAMPLE 2——————

PS:>Remove-PnPFile -SiteRelativeUrl _catalogs/themes/15/company.spcolor

Removes the file company.spcolor

——————EXAMPLE 3——————

PS:>Remove-PnPFile -SiteRelativeUrl _catalogs/themes/15/company.spcolor -Recycle

Removes the file company.spcolor and saves it to the Recycle Bin

PARAMETERS

-Force

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Recycle

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ServerRelativeUrl

Server relative URL to the file

Type: String
Parameter Sets: Server Relative

Required: True
Position: 0
Accept pipeline input: True

-SiteRelativeUrl

Site relative URL to the file

Type: String
Parameter Sets: Site Relative

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPFileFromProvisioningTemplate

SYNOPSIS

Removes a file from a PnP Provisioning Template

SYNTAX

Remove-PnPFileFromProvisioningTemplate -Path <String>
                                       -FilePath <String>
                                       [-TemplateProviderExtensions <ITemplateProviderExtension[]>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPFileFromProvisioningTemplate -Path template.pnp -FilePath filePath

Removes a file from an in-memory PnP Provisioning Template

PARAMETERS

-FilePath

The relative File Path of the file to remove from the in-memory template

Type: String
Parameter Sets: (All)

Required: True
Position: 1
Accept pipeline input: False

-Path

Filename to read the template from, optionally including full path.

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-TemplateProviderExtensions

Allows you to specify ITemplateProviderExtension to execute while saving the template.

Type: ITemplateProviderExtension[]
Parameter Sets: (All)

Required: False
Position: 2
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPFileVersion

SYNOPSIS

Removes all or a specific file version.

SYNTAX

All

Remove-PnPFileVersion -Url <String>
                      [-All [<SwitchParameter>]]
                      [-Recycle [<SwitchParameter>]]
                      [-Force [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

By Id

Remove-PnPFileVersion -Url <String>
                      [-Identity <FileVersionPipeBind>]
                      [-Recycle [<SwitchParameter>]]
                      [-Force [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPFileVersion -Url Documents/MyDocument.docx -Identity 512

Removes the file version with Id 512

——————EXAMPLE 2——————

Remove-PnPFileVersion -Url Documents/MyDocument.docx -Identity "Version 1.0"

Removes the file version with label “Version 1.0”

——————EXAMPLE 3——————

Remove-PnPFileVersion -Url Documents/MyDocument.docx -All

Removes all file versions

PARAMETERS

-All

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: All

Required: False
Position: Named
Accept pipeline input: False

-Force

If provided, no confirmation will be requested and the action will be performed

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Identity

Only applicable to: SharePoint Online

Type: FileVersionPipeBind
Parameter Sets: By Id

Required: False
Position: Named
Accept pipeline input: False

-Recycle

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Url

Only applicable to: SharePoint Online

Type: String
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPFolder

SYNOPSIS

Deletes a folder within a parent folder

SYNTAX

Remove-PnPFolder -Name <String>
                 -Folder <String>
                 [-Recycle [<SwitchParameter>]]
                 [-Force [<SwitchParameter>]]
                 [-Web <WebPipeBind>]
                 [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPFolder -Name NewFolder -Folder _catalogs/masterpage

Removes the folder ‘NewFolder’ from ‘_catalogsmasterpage’

——————EXAMPLE 2——————

Remove-PnPFolder -Name NewFolder -Folder _catalogs/masterpage -Recycle

Removes the folder ‘NewFolder’ from ‘_catalogsmasterpage’ and is saved in the Recycle Bin

PARAMETERS

-Folder

The parent folder in the site

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Force

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Name

The folder name

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Recycle

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPGraphSubscription

SYNOPSIS

Removes an existing Microsoft Graph subscription. Required Azure Active Directory application permission depends on the resource the subscription exists on, see https://docs.microsoft.com/graph/api/subscription-delete#permissions.

SYNTAX

Remove-PnPGraphSubscription -Identity <GraphSubscriptionPipeBind>
                            [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPGraphSubscription -Identity bc204397-1128-4911-9d70-1d8bceee39da

Removes the Microsoft Graph subscription with the id ‘bc204397-1128-4911-9d70-1d8bceee39da’

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The unique id or an instance of a Microsoft Graph Subscription

Type: GraphSubscriptionPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPGroup

SYNOPSIS

Removes a group from a web.

SYNTAX

Remove-PnPGroup [-Identity <GroupPipeBind>]
                [-Force [<SwitchParameter>]]
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPGroup -Identity "My Users"

Removes the group “My Users”

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

A group object, an ID or a name of a group to remove

Type: GroupPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPHomeSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Removes the currently set site as the home site

SYNTAX

Remove-PnPHomeSite [-Force [<SwitchParameter>]]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPHomeSite

Removes the currently set site as the home site

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPHubSiteAssociation

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Disconnects a site from a hubsite.

SYNTAX

Remove-PnPHubSiteAssociation -Site <SitePipeBind>
                             [-Connection <PnPConnection>]

DESCRIPTION

Disconnects an site from a hubsite

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPHubSiteAssociation -Site https://tenant.sharepoint.com/sites/mysite

This example adds the specified site to the hubsite.

PARAMETERS

-Site

The site to disconnect from its hubsite

Type: SitePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPIndexedProperty

SYNOPSIS

Removes a key from propertybag to be indexed by search. The key and it’s value remain in the propertybag, however it will not be indexed anymore.

SYNTAX

Remove-PnPIndexedProperty -Key <String>
                          [-List <ListPipeBind>]
                          [-Web <WebPipeBind>]
                          [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPIndexedProperty -key "MyIndexProperty"

Removes the Indexed property “MyIndexProperty” from the current web

PARAMETERS

-Key

Key of the property bag value to be removed from indexing

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-List

The list object or name from where to remove the indexed properties

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPJavaScriptLink

SYNOPSIS

Removes a JavaScript link or block from a web or sitecollection

SYNTAX

Remove-PnPJavaScriptLink [-Identity <UserCustomActionPipeBind>]
                         [-Force [<SwitchParameter>]]
                         [-Scope <CustomActionScope>]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPJavaScriptLink -Identity jQuery

Removes the injected JavaScript file with the name jQuery from the current web after confirmation

——————EXAMPLE 2——————

Remove-PnPJavaScriptLink -Identity jQuery -Scope Site

Removes the injected JavaScript file with the name jQuery from the current site collection after confirmation

——————EXAMPLE 3——————

Remove-PnPJavaScriptLink -Identity jQuery -Scope Site -Confirm:$false

Removes the injected JavaScript file with the name jQuery from the current site collection and will not ask for confirmation

——————EXAMPLE 4——————

Remove-PnPJavaScriptLink -Scope Site

Removes all the injected JavaScript files from the current site collection after confirmation for each of them

——————EXAMPLE 5——————

Remove-PnPJavaScriptLink -Identity faea0ce2-f0c2-4d45-a4dc-73898f3c2f2e -Scope All

Removes the injected JavaScript file with id faea0ce2-f0c2-4d45-a4dc-73898f3c2f2e from both the Web and Site scopes

——————EXAMPLE 6——————

Get-PnPJavaScriptLink -Scope All | ? Sequence -gt 1000 | Remove-PnPJavaScriptLink

Removes all the injected JavaScript files from both the Web and Site scope that have a sequence number higher than 1000

PARAMETERS

-Force

Use the -Force flag to bypass the confirmation question

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Name or id of the JavaScriptLink to remove. Omit if you want to remove all JavaScript Links.

Type: UserCustomActionPipeBind
Parameter Sets: (All)
Aliases: Key,Name

Required: False
Position: 0
Accept pipeline input: True

-Scope

Define if the JavaScriptLink is to be found at the web or site collection scope. Specify All to allow deletion from either web or site collection.

Type: CustomActionScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPKnowledgeHubSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Removes the Knowledge Hub Site setting for your tenant

SYNTAX

Remove-PnPKnowledgeHubSite [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPKnowledgeHubSite

Removes the Knowledge Hub Site setting for your tenant

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPList

SYNOPSIS

Deletes a list

SYNTAX

Remove-PnPList -Identity <ListPipeBind>
               [-Recycle [<SwitchParameter>]]
               [-Force [<SwitchParameter>]]
               [-Web <WebPipeBind>]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPList -Identity Announcements

Removes the list named ‘Announcements’. Asks for confirmation.

——————EXAMPLE 2——————

Remove-PnPList -Identity Announcements -Force

Removes the list named ‘Announcements’ without asking for confirmation.

——————EXAMPLE 3——————

Remove-PnPList -Title Announcements -Recycle

Removes the list named ‘Announcements’ and saves to the Recycle Bin

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The ID or Title of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Recycle

Defines if the list should be moved to recycle bin or directly deleted.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPListItem

SYNOPSIS

Deletes an item from a list

SYNTAX

Remove-PnPListItem -List <ListPipeBind>
                   -Identity <ListItemPipeBind>
                   [-Recycle [<SwitchParameter>]]
                   [-Force [<SwitchParameter>]]
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPListItem -List "Demo List" -Identity "1" -Force

Removes the listitem with id “1” from the “Demo List” list

——————EXAMPLE 2——————

Remove-PnPListItem -List "Demo List" -Identity "1" -Force -Recycle

Removes the listitem with id “1” from the “Demo List” list and saves it in the Recycle Bin

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The ID of the listitem, or actual ListItem object

Type: ListItemPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-List

The ID, Title or Url of the list

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Recycle

When provided, items will be sent to the recycle bin. When omitted, items will permanently be deleted.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPMicrosoft365Group

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Removes one Microsoft 365 Group

SYNTAX

Remove-PnPMicrosoft365Group -Identity <Microsoft365GroupPipeBind>
                            [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPMicrosoft365Group -Identity $groupId

Removes an Microsoft 365 Group based on its ID

——————EXAMPLE 2——————

Remove-PnPMicrosoft365Group -Identity $group

Removes the provided Microsoft 365 Group

——————EXAMPLE 3——————

Get-PnPMicrosoft365Group | ? Visibility -eq "Public" | Remove-PnPMicrosoft365Group

Removes all the public Microsoft 365 Groups

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Microsoft 365 Group

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPMicrosoft365GroupMember

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Directory.ReadWrite.All, Group.ReadWrite.All, GroupMember.ReadWrite.All

Removes members from a particular Microsoft 365 Group

SYNTAX

Remove-PnPMicrosoft365GroupMember -Identity <Microsoft365GroupPipeBind>
                                  -Users <String[]>
                                  [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPMicrosoft365GroupMember -Identity "Project Team" -Users "john@contoso.onmicrosoft.com","jane@contoso.onmicrosoft.com"

Removes the provided two users as members from the Microsoft 365 Group named “Project Team”

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Microsoft 365 Group to remove members from

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Users

The UPN(s) of the user(s) to remove as members from the Microsoft 365 Group

Type: String[]
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and PracticesDocumentation

applicable: SharePoint Online schema: 2.0.0

Remove-PnPMicrosoft365GroupOwner

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Directory.ReadWrite.All, Group.ReadWrite.All

Removes owners from a particular Microsoft 365 Group

SYNTAX

Remove-PnPMicrosoft365GroupOwner -Identity <Microsoft365GroupPipeBind>
                                 -Users <String[]>
                                 [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPMicrosoft365GroupOwner -Identity "Project Team" -Users "john@contoso.onmicrosoft.com","jane@contoso.onmicrosoft.com"

Removes the provided two users as owners from the Microsoft 365 Group named “Project Team”

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Microsoft 365 Group to remove owners from

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Users

The UPN(s) of the user(s) to remove as owners from the Microsoft 365 Group

Type: String[]
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and PracticesDocumentation

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPNavigationNode

SYNOPSIS

Removes a menu item from either the quicklaunch or top navigation

SYNTAX

Remove a node by ID

Remove-PnPNavigationNode -Identity <NavigationNodePipeBind>
                         [-Force [<SwitchParameter>]]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

All Nodes

Remove-PnPNavigationNode -All [<SwitchParameter>]
                         [-Force [<SwitchParameter>]]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPNavigationNode -Identity 1032

Removes the navigation node with the specified id

——————EXAMPLE 2——————

Get-PnPNavigationNode -Location Footer | Select-Object -First 1 | Remove-PnPNavigationNode -Force

Removes the first node of the footer navigation without asking for confirmation

——————EXAMPLE 3——————

Remove-PnPNavigationNode -Title Recent -Location QuickLaunch

Will remove the recent navigation node from the quick launch in the current web after confirmation has been given that it should be deleted

——————EXAMPLE 4——————

Remove-PnPNavigationNode -Title Home -Location TopNavigationBar -Force

Will remove the home navigation node from the top navigation bar without prompting for a confirmation in the current web

——————EXAMPLE 5——————

Get-PnPNavigationNode -Location QuickLaunch | Remove-PnPNavigationNode -Force

Will remove all the navigation nodes from the quick launch bar without prompting for a confirmation in the current web

PARAMETERS

-All

Specifying the All parameter will remove all the nodes from specified Location.

Type: SwitchParameter
Parameter Sets: All Nodes

Required: True
Position: Named
Accept pipeline input: False

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Id or node object to delete

Type: NavigationNodePipeBind
Parameter Sets: Remove a node by ID

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPOrgAssetsLibrary

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Removes a given document library as a organizational asset source

SYNTAX

Remove-PnPOrgAssetsLibrary -LibraryUrl <String>
                           [-ShouldRemoveFromCdn <Boolean>]
                           [-CdnType <SPOTenantCdnType>]
                           [-Connection <PnPConnection>]

DESCRIPTION

Removes a given document library as a organizational asset source based on its server relative URL in your Sharepoint Online Tenant. It will not remove the document library itself. It may take some time before this change will be reflected in the webinterface.

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPOrgAssetsLibrary -LibraryUrl "sites/branding/logos"

This example removes the document library with the url “logos” residing in the sitecollection with the url “sites/branding/logos” from the list with organizational assets keeping it as an Office 365 CDN source

——————EXAMPLE 2——————

Remove-PnPOrgAssetsLibrary -LibraryUrl "sites/branding/logos" -ShouldRemoveFromCdn $true

This example removes the document library with the url “logos” residing in the sitecollection with the url “sites/branding/logos” from the list with organizational assets also removing it as a Public Office 365 CDN source

——————EXAMPLE 3——————

Remove-PnPOrgAssetsLibrary -LibraryUrl "sites/branding/logos" -ShouldRemoveFromCdn $true -CdnType Private

This example removes the document library with the url “logos” residing in the sitecollection with the url “sites/branding/logos” from the list with organizational assets also removing it as a Private Office 365 CDN source

PARAMETERS

-CdnType

Indicates what type of Office 365 CDN source the document library that will no longer be flagged as an organizational asset was of

Type: SPOTenantCdnType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LibraryUrl

The server relative url of the document library flagged as organizational asset which you want to remove, i.e. “sites/branding/logos”

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ShouldRemoveFromCdn

Boolean indicating if the document library that will no longer be flagged as an organizational asset also needs to be removed as an Office 365 CDN source

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPOrgNewsSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Removes a given site from the list of organizational news sites.

SYNTAX

Remove-PnPOrgNewsSite -OrgNewsSiteUrl <SitePipeBind>
                      [-Connection <PnPConnection>]

DESCRIPTION

Removes a given site from the list of organizational news sites based on its URL in your Sharepoint Online Tenant.

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPOrgNewsSite -OrgNewsSiteUrl https://tenant.sharepoint.com/sites/mysite

This example removes the specified site from list of organization’s news sites.

PARAMETERS

-OrgNewsSiteUrl

The site to be removed from list of organization’s news sites

Type: SitePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPPropertyBagValue

SYNOPSIS

Removes a value from the property bag

SYNTAX

Remove-PnPPropertyBagValue -Key <String>
                           [-Folder <String>]
                           [-Force [<SwitchParameter>]]
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPPropertyBagValue -Key MyKey

This will remove the value with key MyKey from the current web property bag

——————EXAMPLE 2——————

Remove-PnPPropertyBagValue -Key MyKey -Folder /MyFolder

This will remove the value with key MyKey from the folder MyFolder which is located in the root folder of the current web

——————EXAMPLE 3——————

Remove-PnPPropertyBagValue -Key MyKey -Folder /

This will remove the value with key MyKey from the root folder of the current web

PARAMETERS

-Folder

Site relative url of the folder. See examples for use.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Force

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Key

Key of the property bag value to be removed

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPPublishingImageRendition

SYNOPSIS

Removes an existing image rendition

SYNTAX

Remove-PnPPublishingImageRendition -Identity <ImageRenditionPipeBind>
                                   [-Force [<SwitchParameter>]]
                                   [-Web <WebPipeBind>]
                                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPPublishingImageRendition -Name "MyImageRendition" -Width 800 -Height 600

PARAMETERS

-Force

If provided, no confirmation will be asked to remove the Image Rendition.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The display name or id of the Image Rendition.

Type: ImageRenditionPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPRoleDefinition

SYNOPSIS

Remove a Role Definition from a site

SYNTAX

Remove-PnPRoleDefinition -Identity <RoleDefinitionPipeBind>
                         [-Force [<SwitchParameter>]]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPRoleDefinition -Identity MyRoleDefinition

Removes the specified Role Definition (Permission Level) from the current site

PARAMETERS

-Force

Do not ask for confirmation to delete the role definition

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Identity

The identity of the role definition, either a RoleDefinition object or a the name of roledefinition

Type: RoleDefinitionPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPSearchConfiguration

SYNOPSIS

Remove the search configuration

SYNTAX

Config

Remove-PnPSearchConfiguration -Configuration <String>
                              [-Scope <SearchConfigurationScope>]
                              [-Web <WebPipeBind>]
                              [-Connection <PnPConnection>]

Path

Remove-PnPSearchConfiguration -Path <String>
                              [-Scope <SearchConfigurationScope>]
                              [-Web <WebPipeBind>]
                              [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPSearchConfiguration -Configuration $config

Remove the search configuration for the current web (does not remove managed property mappings)

——————EXAMPLE 2——————

Remove-PnPSearchConfiguration -Configuration $config -Scope Site

Remove the search configuration for the current site collection (does not remove managed property mappings)

——————EXAMPLE 3——————

Remove-PnPSearchConfiguration -Configuration $config -Scope Subscription

Remove the search configuration for the current tenant (does not remove managed property mappings)

——————EXAMPLE 4——————

Remove-PnPSearchConfiguration -Path searchconfig.xml -Scope Subscription

Reads the search configuration from the specified XML file and remove it for the current tenant (does not remove managed property mappings)

PARAMETERS

-Configuration

Search configuration string

Type: String
Parameter Sets: Config

Required: True
Position: Named
Accept pipeline input: False

-Path

Path to a search configuration

Type: String
Parameter Sets: Path

Required: True
Position: Named
Accept pipeline input: False

-Scope

Type: SearchConfigurationScope
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPSiteClassification

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Directory.ReadWrite.All

Removes one or more existing site classification values from the list of available values

SYNTAX

Remove-PnPSiteClassification -Classifications <String>
                             [-Confirm [<SwitchParameter>]]
                             [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPSiteClassification -Classifications "HBI"

Removes the “HBI” site classification from the list of available values.

——————EXAMPLE 2——————

Remove-PnPSiteClassification -Classifications "HBI", "Top Secret"

Removes the “HBI” site classification from the list of available values.

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Classifications

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Confirm

Specifying the Confirm parameter will allow the confirmation question to be skipped

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPSiteCollectionAdmin

SYNOPSIS

Removes one or more users as site collection administrators from the site collection in the current context

SYNTAX

Remove-PnPSiteCollectionAdmin -Owners <UserPipeBind>
                              [-Connection <PnPConnection>]

DESCRIPTION

This command allows removing one to many users as site collection administrators from the site collection in the current context. All existing site collection administrators not included in this command will remain site collection administrator.

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPSiteCollectionAdmin -Owners "user@contoso.onmicrosoft.com"

This will remove user@contoso.onmicrosoft.com as a site collection owner from the site collection in the current context

——————EXAMPLE 2——————

Remove-PnPSiteCollectionAdmin -Owners @("user1@contoso.onmicrosoft.com", "user2@contoso.onmicrosoft.com")

This will remove user1@contoso.onmicrosoft.com and user2@contoso.onmicrosoft.com as site collection owners from the site collection in the current context

——————EXAMPLE 3——————

Get-PnPUser | ? Title -Like "*Doe" | Remove-PnPSiteCollectionAdmin

This will remove all users with their title ending with “Doe” as site collection owners from the site collection in the current context

——————EXAMPLE 4——————

Get-PnPSiteCollectionAdmin | Remove-PnPSiteCollectionAdmin

This will remove all existing site collection administrators from the site collection in the current context

PARAMETERS

-Owners

Specifies owner(s) to remove as site collection administrators. Can be both users and groups.

Type: UserPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPSiteCollectionAppCatalog

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Removes a Site Collection scoped App Catalog from a site

SYNTAX

Remove-PnPSiteCollectionAppCatalog -Site <SitePipeBind>
                                   [-Connection <PnPConnection>]

DESCRIPTION

Notice that this will not remove the App Catalog list and its contents from the site.

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPSiteCollectionAppCatalog -Site "https://contoso.sharepoint.com/sites/FinanceTeamsite"

This will remove a SiteCollection app catalog from the specified site

PARAMETERS

-Site

Url of the site to remove the app catalog from.

Type: SitePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPSiteDesign

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Removes a Site Design

SYNTAX

Remove-PnPSiteDesign -Identity <TenantSiteDesignPipeBind>
                     [-Force [<SwitchParameter>]]
                     [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPSiteDesign -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd

Removes the specified site design

PARAMETERS

-Force

If specified you will not be asked to confirm removing the specified Site Design

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The ID of the site design to remove

Type: TenantSiteDesignPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPSiteDesignTask

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Removes a Site Design Task. If the execution of the associated site script has already started the execution will not be terminated.

SYNTAX

Remove-PnPSiteDesignTask -Identity <TenantSiteDesignTaskPipeBind>
                         [-Force [<SwitchParameter>]]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPSiteDesignTask -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd

Removes the specified site design task

PARAMETERS

-Force

If specified you will not be asked to confirm removing the specified Site Design

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The ID of the site design to remove

Type: TenantSiteDesignTaskPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPSiteScript

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Removes a Site Script

SYNTAX

Remove-PnPSiteScript -Identity <TenantSiteScriptPipeBind>
                     [-Force [<SwitchParameter>]]
                     [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPSiteScript -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd

Removes the specified site script

PARAMETERS

-Force

If specified you will not be asked to confirm removing the specified Site Script

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The ID of the Site Script to remove

Type: TenantSiteScriptPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPStorageEntity

SYNOPSIS

Remove Storage Entities / Farm Properties from either the tenant scoped app catalog or the current site collection if the site has a site collection scoped app catalog

SYNTAX

Remove-PnPStorageEntity -Key <String>
                        [-Scope <StorageEntityScope>]
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPStorageEntity -Key MyKey 

Removes an existing storage entity / farm property

——————EXAMPLE 2——————

Remove-PnPStorageEntity -Key MyKey -Scope Site

Removes an existing storage entity from the current site collection

PARAMETERS

-Key

The key of the value to remove.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Scope

Defines the scope of the storage entity. Defaults to Tenant.

Type: StorageEntityScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPStoredCredential

SYNOPSIS

Removes a credential

SYNTAX

Remove-PnPStoredCredential -Name <String>
                           [-Force [<SwitchParameter>]]

DESCRIPTION

Removes a stored credential from the Windows Credential Manager

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPStoredCredential -Name https://tenant.sharepoint.com

Removes the specified credential from the Windows Credential Manager

PARAMETERS

-Force

If specified you will not be asked for confirmation

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Name

The credential to remove

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPTaxonomyItem

SYNOPSIS

Removes a taxonomy item

SYNTAX

Remove-PnPTaxonomyItem -TermPath <String>
                       [-Force [<SwitchParameter>]]
                       [-Connection <PnPConnection>]

PARAMETERS

-Force

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TermPath

The path, delimited by | of the taxonomy item to remove, alike GROUPLABEL|TERMSETLABEL|TERMLABEL

Type: String
Parameter Sets: (All)
Aliases: Term

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPTeamsApp

SYNOPSIS

Required Permissions

  • Microsoft Graph API: AppCatalog.ReadWrite.All

Removes an app from the Teams AppCatalog.

SYNTAX

Remove-PnPTeamsApp -Identity <TeamsAppPipeBind>
                   [-Force [<SwitchParameter>]]
                   [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPTeamsApp -Identity ac139d8b-fa2b-4ffe-88b3-f0b30158b58b

Adds a new channel to the specified Teams instance

——————EXAMPLE 2——————

Remove-PnPTeamsApp -Identity "My Teams App"

Adds a new channel to the specified Teams instance

——————EXAMPLE 3——————

Add-PnPTeamsChannel -Team MyTeam -DisplayName "My Channel" -Private

Adds a new private channel to the specified Teams instance

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The id, externalid or display name of the app.

Type: TeamsAppPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPTeamsChannel

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Removes a channel from a Microsoft Teams instance.

SYNTAX

Remove-PnPTeamsChannel -Team <TeamsTeamPipeBind>
                       -Identity <TeamsChannelPipeBind>
                       [-Force [<SwitchParameter>]]
                       [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPTeamsChannel -Team 4efdf392-8225-4763-9e7f-4edeb7f721aa -DisplayName "My Channel"

Removes the channel specified from the team specified

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Type: TeamsChannelPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Team

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPTeamsTab

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Removes a Microsoft Teams tab in a channel.

SYNTAX

Remove-PnPTeamsTab -Team <TeamsTeamPipeBind>
                   -Channel <TeamsChannelPipeBind>
                   -Identity <TeamsTabPipeBind>
                   [-Force [<SwitchParameter>]]
                   [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPTeamsTab -GroupId 5beb63c5-0571-499e-94d5-3279fdd9b6b5 -ChannelId 19:796d063b63e34497aeaf092c8fb9b44e@thread.skype -Identity Wiki

Removes the tab with the display name ‘Wiki’ from the channel

——————EXAMPLE 2——————

Remove-PnPTeamsTab -GroupId 5beb63c5-0571-499e-94d5-3279fdd9b6b5 -ChannelId 19:796d063b63e34497aeaf092c8fb9b44e@thread.skype -Identity fcef815d-2e8e-47a5-b06b-9bebba5c7852

Removes a tab with the specified id from the channel

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Channel

Specify the channel id or display name of the channel to use.

Type: TeamsChannelPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Specify the id of the tab

Type: TeamsTabPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Team

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPTeamsTeam

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Removes a Microsoft Teams Team instance

SYNTAX

Remove-PnPTeamsTeam -Identity <TeamsTeamPipeBind>
                    [-Force [<SwitchParameter>]]
                    [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPTeamsTeam -Identity 5beb63c5-0571-499e-94d5-3279fdd9b6b5

Removes the specified Team

——————EXAMPLE 2——————

Remove-PnPTeamsTeam -Identity testteam

Removes the specified Team. If there are multiple teams with the same display name it will not proceed deleting the team.

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Either the group id or the mailnickname of the group to remove.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPTeamsUser

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Removes users from a team.

SYNTAX

Remove-PnPTeamsUser -Team <TeamsTeamPipeBind>
                    -User <String>
                    [-Role <String>]
                    [-Force [<SwitchParameter>]]
                    [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPTeamsUser -Team MyTeam -User john@doe.com

Removes the user specified from both owners and members of the team.

——————EXAMPLE 2——————

Get-PnPTeamsUser -Team MyTeam -User john@doe.com -Owner

Removes the user john@doe.com from the owners of the team, but retains the user as a member.

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Role

Specify the role of the user you are removing from the team. Accepts “Owner” and “Member” as possible values. If specified as “Member” then the specified user is removed from the Team completely even if they were the owner of the Team. If “Owner” is specified in the -Role parameter then the specified user is removed as an owner of the team but stays as a team member. Defaults to “Member”. Note: The last owner cannot be removed from the team.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Team

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-User

Specify the UPN (e.g. john@doe.com)

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPTenantCdnOrigin

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Removes an origin from the Public or Private content delivery network (CDN).

SYNTAX

Remove-PnPTenantCdnOrigin -OriginUrl <String>
                          -CdnType <SPOTenantCdnType>
                          [-Connection <PnPConnection>]

DESCRIPTION

Removes an origin from the Public or Private content delivery network (CDN).

You must be a SharePoint Online global administrator to run the cmdlet.

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPTenantCdnOrigin -OriginUrl /sites/site/subfolder -CdnType Public

This example removes the specified origin from the public CDN

PARAMETERS

-CdnType

The cdn type to remove the origin from.

Type: SPOTenantCdnType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-OriginUrl

The origin to remove.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPTenantSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Removes a site collection

SYNTAX

Remove-PnPTenantSite -Url <String>
                     [-SkipRecycleBin [<SwitchParameter>]]
                     [-Force [<SwitchParameter>]]
                     [-Connection <PnPConnection>]

DESCRIPTION

Removes a site collection which is listed in your tenant administration site.

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/contoso

This will remove the site collection with the url ‘https://tenant.sharepoint.com/sites/contoso' and put it in the recycle bin.

——————EXAMPLE 2——————

Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/contoso -Force -SkipRecycleBin

This will remove the site collection with the url ‘https://tenant.sharepoint.com/sites/contoso' with force and it will skip the recycle bin.

——————EXAMPLE 3——————

Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/contoso -FromRecycleBin

This will remove the site collection with the url ‘https://tenant.sharepoint.com/sites/contoso' from the recycle bin.

PARAMETERS

-Force

Do not ask for confirmation.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SkipRecycleBin

Do not add to the tenant scoped recycle bin when selected.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)
Aliases: SkipTrash

Required: False
Position: Named
Accept pipeline input: False

-Url

Specifies the full URL of the site collection that needs to be deleted

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPTenantTheme

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Removes a theme

SYNTAX

Remove-PnPTenantTheme -Identity <ThemePipeBind>
                      [-Connection <PnPConnection>]

DESCRIPTION

Removes the specified theme from the tenant configuration

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPTenantTheme -Name "MyCompanyTheme"

Removes the specified theme.

PARAMETERS

-Identity

The name of the theme to retrieve

Type: ThemePipeBind
Parameter Sets: (All)
Aliases: Name

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPTermGroup

SYNOPSIS

Removes a taxonomy term group and all its containing termsets

SYNTAX

Remove-PnPTermGroup -GroupName <String>
                    [-TermStoreName <String>]
                    [-Force [<SwitchParameter>]]
                    [-Connection <PnPConnection>]

PARAMETERS

-Force

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-GroupName

Name of the taxonomy term group to delete.

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-TermStoreName

Term store to use; if not specified the default term store is used.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPUnifiedGroup

SYNOPSIS

Removes one Office 365 Group (aka Unified Group). Requires the Azure Active Directory application permission ‘Group.ReadWrite.All’.

SYNTAX

Remove-PnPUnifiedGroup -Identity <UnifiedGroupPipeBind>

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPUnifiedGroup -Identity $groupId

Removes an Office 365 Group based on its ID

——————EXAMPLE 2——————

Remove-PnPUnifiedGroup -Identity $group

Removes the provided Office 365 Group

——————EXAMPLE 3——————

Get-PnPUnifiedGroup | ? Visibility -eq "Public" | Remove-PnPUnifiedGroup

Removes all the public Office 365 Groups

PARAMETERS

-Identity

The Identity of the Office 365 Group

Type: UnifiedGroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPUser

SYNOPSIS

Removes a specific user from the site collection User Information List

SYNTAX

Remove-PnPUser -Identity <UserPipeBind>
               [-Force [<SwitchParameter>]]
               [-Confirm [<SwitchParameter>]]
               [-Web <WebPipeBind>]
               [-Connection <PnPConnection>]

DESCRIPTION

This command will allow the removal of a specific user from the User Information List

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPUser -Identity 23

Remove the user with Id 23 from the User Information List of the current site collection

——————EXAMPLE 2——————

Remove-PnPUser -Identity i:0#.f|membership|user@tenant.onmicrosoft.com

Remove the user with LoginName i:0#.f|membership|user@tenant.onmicrosoft.com from the User Information List of the current site collection

——————EXAMPLE 3——————

Get-PnPUser | ? Email -eq "user@tenant.onmicrosoft.com" | Remove-PnPUser

Remove the user with e-mail address user@tenant.onmicrosoft.com from the User Information List of the current site collection

——————EXAMPLE 4——————

Remove-PnPUser -Identity i:0#.f|membership|user@tenant.onmicrosoft.com -Confirm:$false

Remove the user with LoginName i:0#.f|membership|user@tenant.onmicrosoft.com from the User Information List of the current site collection without asking to confirm the removal first

PARAMETERS

-Confirm

Specifying the Confirm parameter will allow the confirmation question to be skipped

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Force

Specifying the Force parameter will skip the confirmation question

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

User ID or login name

Type: UserPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.User

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPUserFromGroup

SYNOPSIS

Removes a user from a group

SYNTAX

Remove-PnPUserFromGroup -LoginName <String>
                        -Identity <GroupPipeBind>
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPUserFromGroup -LoginName user@company.com -GroupName 'Marketing Site Members'

Removes the user user@company.com from the Group ‘Marketing Site Members’

PARAMETERS

-Identity

A group object, an ID or a name of a group

Type: GroupPipeBind
Parameter Sets: (All)
Aliases: GroupName

Required: True
Position: Named
Accept pipeline input: False

-LoginName

A valid login name of a user (user@company.com)

Type: String
Parameter Sets: (All)
Aliases: LogonName

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPView

SYNOPSIS

Deletes a view from a list

SYNTAX

Remove-PnPView -Identity <ViewPipeBind>
               -List <ListPipeBind>
               [-Force [<SwitchParameter>]]
               [-Web <WebPipeBind>]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPView -List "Demo List" -Identity "All Items"

Removes the view with title “All Items” from the “Demo List” list.

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The ID or Title of the view.

Type: ViewPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-List

The ID or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 1
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPWeb

SYNOPSIS

Removes a subweb in the current web

SYNTAX

ByUrl

Remove-PnPWeb -Url <String>
              [-Force [<SwitchParameter>]]
              [-Web <WebPipeBind>]
              [-Connection <PnPConnection>]

ByIdentity

Remove-PnPWeb -Identity <WebPipeBind>
              [-Force [<SwitchParameter>]]
              [-Web <WebPipeBind>]
              [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPWeb -Url projectA

Remove a web

——————EXAMPLE 2——————

Remove-PnPWeb -Identity 5fecaf67-6b9e-4691-a0ff-518fc9839aa0

Remove a web specified by its ID

——————EXAMPLE 3——————

Get-PnPSubWebs | Remove-PnPWeb -Force

Remove all subwebs and do not ask for confirmation

PARAMETERS

-Force

Do not ask for confirmation to delete the subweb

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Identity

Identity/Id/Web object to delete

Type: WebPipeBind
Parameter Sets: ByIdentity

Required: True
Position: Named
Accept pipeline input: True

-Url

The site relative url of the web, e.g. ‘Subweb1’

Type: String
Parameter Sets: ByUrl

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Remove-PnPWebhookSubscription

SYNOPSIS

Removes a Webhook subscription from the resource

SYNTAX

Remove-PnPWebhookSubscription -Identity <WebhookSubscriptionPipeBind>
                              [-List <ListPipeBind>]
                              [-Force [<SwitchParameter>]]
                              [-Web <WebPipeBind>]
                              [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPWebhookSubscription -List MyList -Identity ea1533a8-ff03-415b-a7b6-517ee50db8b6

Removes the Webhook subscription with the specified id from the list MyList

——————EXAMPLE 2——————

$subscriptions = Get-PnPWebhookSubscriptions -List MyList
Remove-PnPWebhookSubscription -Identity $subscriptions[0] -List MyList

Removes the first Webhook subscription from the list MyList

——————EXAMPLE 3——————

$subscriptions = Get-PnPWebhookSubscriptions -List MyList
$subscriptions[0] | Remove-PnPWebhookSubscription -List MyList

Removes the first Webhook subscription from the list MyList

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The identity of the Webhook subscription to remove

Type: WebhookSubscriptionPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-List

The list object or name which the Webhook subscription will be removed from

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

OfficeDevPnP.Core.Entities.WebhookSubscription

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPWebPart

SYNOPSIS

Removes a web part from a page

SYNTAX

ID

Remove-PnPWebPart -Identity <GuidPipeBind>
                  -ServerRelativePageUrl <String>
                  [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

NAME

Remove-PnPWebPart -Title <String>
                  -ServerRelativePageUrl <String>
                  [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPWebPart -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Identity a2875399-d6ff-43a0-96da-be6ae5875f82

This will remove the web part specified by ID to the specified page in the first row and the first column of the HTML table present on the page

——————EXAMPLE 2——————

Remove-PnPWebPart -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Title MyWebpart

This will remove the web part specified by title to the specified page in the first row and the first column of the HTML table present on the page

PARAMETERS

-Identity

The Guid of the web part

Type: GuidPipeBind
Parameter Sets: ID

Required: True
Position: Named
Accept pipeline input: False

-ServerRelativePageUrl

Server relative url of the web part page, e.g. /sites/demo/sitepages/home.aspx

Type: String
Parameter Sets: __AllParameterSets
Aliases: PageUrl

Required: True
Position: Named
Accept pipeline input: False

-Title

The name of the web part

Type: String
Parameter Sets: NAME
Aliases: Name

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPWikiPage

SYNOPSIS

Removes a wiki page

SYNTAX

SERVER

Remove-PnPWikiPage -ServerRelativePageUrl <String>
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

SITE

Remove-PnPWikiPage -SiteRelativePageUrl <String>
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPWikiPage -PageUrl '/pages/wikipage.aspx'

Removes the page ‘/pages/wikipage.aspx’

PARAMETERS

-ServerRelativePageUrl

Type: String
Parameter Sets: SERVER
Aliases: PageUrl

Required: True
Position: 0
Accept pipeline input: True

-SiteRelativePageUrl

Type: String
Parameter Sets: SITE

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPWorkflowDefinition

SYNOPSIS

Removes a workflow definition

SYNTAX

Remove-PnPWorkflowDefinition -Identity <WorkflowDefinitionPipeBind>
                             [-Web <WebPipeBind>]
                             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPWorkflowDefinition -Identity $wfDef

Removes the workflow, retrieved by Get-PnPWorkflowDefinition, from the site.

——————EXAMPLE 2——————

Get-PnPWorkflowDefinition -Name MyWorkflow | Remove-PnPWorkflowDefinition

Get the workflow MyWorkFlow and remove from the site.

PARAMETERS

-Identity

The definition to remove

Type: WorkflowDefinitionPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Remove-PnPWorkflowSubscription

SYNOPSIS

Removes a SharePoint 2010/2013 workflow subscription

SYNTAX

Remove-PnPWorkflowSubscription -Identity <WorkflowSubscriptionPipeBind>
                               [-Web <WebPipeBind>]
                               [-Connection <PnPConnection>]

DESCRIPTION

Removes a previously registered SharePoint 2010/2013 workflow subscription

EXAMPLES

——————EXAMPLE 1——————

Remove-PnPWorkflowSubscription -Identity $wfSub

Removes the workflowsubscription, retrieved by Get-PnPWorkflowSubscription.

——————EXAMPLE 2——————

Get-PnPWorkflowSubscription -Name MyWorkflow | Remove-PnPWorkflowSubscription

Get the workflowSubscription MyWorkFlow and remove it.

PARAMETERS

-Identity

The subscription to remove

Type: WorkflowSubscriptionPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Rename-PnPFile

SYNOPSIS

Renames a file in its current location

SYNTAX

SERVER

Rename-PnPFile -ServerRelativeUrl <String>
               -TargetFileName <String>
               [-OverwriteIfAlreadyExists [<SwitchParameter>]]
               [-Force [<SwitchParameter>]]
               [-Web <WebPipeBind>]
               [-Connection <PnPConnection>]

SITE

Rename-PnPFile -SiteRelativeUrl <String>
               -TargetFileName <String>
               [-OverwriteIfAlreadyExists [<SwitchParameter>]]
               [-Force [<SwitchParameter>]]
               [-Web <WebPipeBind>]
               [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

PS:>Rename-PnPFile -ServerRelativeUrl /sites/project/Documents/company.docx -TargetFileName mycompany.docx

Renames a file named company.docx located in the document library called Documents located in the projects sitecollection under the managed path sites to mycompany.docx. If a file named mycompany.aspx already exists, it won’t perform the rename.

——————EXAMPLE 2——————

PS:>Rename-PnPFile -SiteRelativeUrl Documents/company.aspx -TargetFileName mycompany.docx

Renames a file named company.docx located in the document library called Documents located in the current site to mycompany.aspx. If a file named mycompany.aspx already exists, it won’t perform the rename.

——————EXAMPLE 3——————

PS:>Rename-PnPFile -ServerRelativeUrl /sites/project/Documents/company.docx -TargetFileName mycompany.docx -OverwriteIfAlreadyExists

Renames a file named company.docx located in the document library called Documents located in the projects sitecollection under the managed path sites to mycompany.aspx. If a file named mycompany.aspx already exists, it will still perform the rename and replace the original mycompany.aspx file.

PARAMETERS

-Force

If provided, no confirmation will be requested and the action will be performed

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-OverwriteIfAlreadyExists

If provided, if a file already exist with the provided TargetFileName, it will be overwritten. If omitted, the rename operation will be canceled if a file already exists with the TargetFileName file name.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ServerRelativeUrl

Server relative Url specifying the file to rename. Must include the file name.

Type: String
Parameter Sets: SERVER

Required: True
Position: 0
Accept pipeline input: True

-SiteRelativeUrl

Site relative Url specifying the file to rename. Must include the file name.

Type: String
Parameter Sets: SITE

Required: True
Position: 0
Accept pipeline input: True

-TargetFileName

File name to rename the file to. Should only be the file name and not include the path to its location. Use Move-PnPFile to move the file to another location.

Type: String
Parameter Sets: (All)

Required: True
Position: 1
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Rename-PnPFolder

SYNOPSIS

Renames a folder

SYNTAX

Rename-PnPFolder -Folder <String>
                 -TargetFolderName <String>
                 [-Web <WebPipeBind>]
                 [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Rename-PnPFolder -Folder Documents/Reports -TargetFolderName 'Archived Reports'

This will rename the folder Reports in the Documents library to ‘Archived Reports’

PARAMETERS

-Folder

The folder to rename

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-TargetFolderName

The new folder name

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Request-PnPAccessToken

SYNOPSIS

Requests an OAuth Access token

SYNTAX

Request-PnPAccessToken [-ClientId <String>]
                       [-Resource <String>]
                       [-Scopes <String>]
                       [-Decoded [<SwitchParameter>]]
                       [-SetAsCurrent [<SwitchParameter>]]
                       [-Credentials <PSCredential>]
                       [-TenantUrl <String>]

DESCRIPTION

Returns an access token using the password grant, using the PnP O365 Management Shell client id by default and the AllSites.FullControl scope by default.

EXAMPLES

——————EXAMPLE 1——————

Request-PnPAccessToken

Returns the access token using the default client id and scope

——————EXAMPLE 2——————

Request-PnPAccessToken -ClientId 26e29fec-aa10-4f99-8381-d96cddc650c2

Returns the access token using the specified client id and the default scope of AllSites.FullControl

——————EXAMPLE 3——————

Request-PnPAccessToken -ClientId 26e29fec-aa10-4f99-8381-d96cddc650c2 -Scopes Group.ReadWrite.All

Returns the access token using the specified client id and the specified scope

——————EXAMPLE 4——————

Request-PnPAccessToken -ClientId 26e29fec-aa10-4f99-8381-d96cddc650c2 -Scopes Group.ReadWrite.All, AllSites.FullControl

Returns the access token using the specified client id and the specified scopes

——————EXAMPLE 5——————

$token = Request-PnPAccessToken -ClientId 26e29fec-aa10-4f99-8381-d96cddc650c2 -Resource https://contoso.sharepoint.com -Credentials (Get-Credential) -TenantUrl https://contoso.sharepoint.com
    Connect-PnPOnline -AccessToken $token

Returns the access token using the specified client id and the specified scopes while using the credentials and tenanturl specified to authentication against Azure AD

PARAMETERS

-ClientId

The Azure Application Client Id to use to retrieve the token. Defaults to the PnP Office 365 Management Shell

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Credentials

Optional credentials to use when retrieving the access token. If not present you need to connect first with Connect-PnPOnline.

Only applicable to: SharePoint Online

Type: PSCredential
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Decoded

Returns the token in a decoded / human readible manner

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Resource

The scopes to retrieve the token for. Defaults to AllSites.FullControl

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Scopes

The scopes to retrieve the token for. Defaults to AllSites.FullControl

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SetAsCurrent

Set this token as the current token to use when performing Azure AD based authentication requests with PnP PowerShell

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TenantUrl

Optional tenant URL to use when retrieving the access token. The Url should be in the shape of https://yourtenant.sharepoint.com. See examples for more info.

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Request-PnPReIndexList

SYNOPSIS

Marks the list for full indexing during the next incremental crawl

SYNTAX

Request-PnPReIndexList -Identity <ListPipeBind>
                       [-Web <WebPipeBind>]
                       [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Request-PnPReIndexList -Identity "Demo List"

PARAMETERS

-Identity

The ID, Title or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Request-PnPReIndexWeb

SYNOPSIS

Marks the web for full indexing during the next incremental crawl

SYNTAX

Request-PnPReIndexWeb [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Reset-PnPFileVersion

SYNOPSIS

Resets a file to its previous version

SYNTAX

Reset-PnPFileVersion -ServerRelativeUrl <String>
                     [-CheckinType <CheckinType>]
                     [-CheckInComment <String>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Reset-PnPFileVersion -ServerRelativeUrl "/sites/test/office365.png"

——————EXAMPLE 2——————

Reset-PnPFileVersion -ServerRelativeUrl "/sites/test/office365.png" -CheckinType MajorCheckin -Comment "Restored to previous version"

PARAMETERS

-CheckInComment

The comment added to the checkin. Defaults to ‘Restored to previous version’.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CheckinType

The check in type to use. Defaults to Major.

Type: CheckinType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ServerRelativeUrl

The server relative URL of the file.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Reset-PnPLabel

SYNOPSIS

Resets a retention label on the specified list or library to None

SYNTAX

Reset-PnPLabel -List <ListPipeBind>
               [-SyncToItems <Boolean>]
               [-Web <WebPipeBind>]
               [-Connection <PnPConnection>]

DESCRIPTION

Removes the retention label on a list or library and its items. Does not work for sensitivity labels.

EXAMPLES

——————EXAMPLE 1——————

Reset-PnPLabel -List "Demo List"

This resets an O365 label on the specified list or library to None

——————EXAMPLE 2——————

Reset-PnPLabel -List "Demo List" -SyncToItems $true

This resets an O365 label on the specified list or library to None and resets the label on all the items in the list and library except Folders and where the label has been manually or previously automatically assigned

PARAMETERS

-List

The ID or Url of the list

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-SyncToItems

Reset label on existing items in the library

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Reset-PnPMicrosoft365GroupExpiration

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Directory.ReadWrite.All, Group.ReadWrite.All

Renews the Microsoft 365 Group by extending its expiration with the number of days defined in the group expiration policy set on the Azure Active Directory

SYNTAX

Reset-PnPMicrosoft365GroupExpiration -Identity <Microsoft365GroupPipeBind>
                                     [-ByPassPermissionCheck [<SwitchParameter>]]

DESCRIPTION

Renews the Microsoft 365 Group by extending its expiration with the number of days defined in the group expiration policy set on the Azure Active Directory

EXAMPLES

——————EXAMPLE 1——————

Reset-PnPMicrosoft365GroupExpiration

Renews the Microsoft 365 Group by extending its expiration with the number of days defined in the group expiration policy set on the Azure Active Directory

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Microsoft 365 Group

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and PracticesDocumentation

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Reset-PnPUserOneDriveQuotaToDefault

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Resets the current quota set on the OneDrive for Business site for a specific user to the tenant default

SYNTAX

Reset-PnPUserOneDriveQuotaToDefault -Account <String>
                                    [-Connection <PnPConnection>]

DESCRIPTION

This command allows you to reset the quota set on the OneDrive for Business site of a specific user to the default as set on the tenant. You must connect to the tenant admin website (https://:-admin.sharepoint.com) with Connect-PnPOnline in order to use this cmdlet.

EXAMPLES

——————EXAMPLE 1——————

Reset-PnPUserOneDriveQuotaToDefault -Account 'user@domain.com'

Resets the quota set on the OneDrive for Business site for the specified user to the tenant default

PARAMETERS

-Account

The account of the user, formatted either as a login name, or as a claims identity, e.g. i:0#.f|membership|user@domain.com

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Resolve-PnPFolder

SYNOPSIS

Returns a folder from a given site relative path, and will create it if it does not exist.

SYNTAX

Resolve-PnPFolder -SiteRelativePath <String>
                  [-Includes <String[]>]
                  [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

DESCRIPTION

Returns a folder from a given site relative path, and will create it if it does not exist. If you do not want the folder to be created, for instance just to test if a folder exists, use Get-PnPFolder

EXAMPLES

——————EXAMPLE 1——————

Resolve-PnPFolder -SiteRelativePath "demofolder/subfolder"

Creates a folder called subfolder in a folder called demofolder located in the root folder of the site. If the folder hierarchy does not exist, it will be created.

PARAMETERS

-Includes

Specify properties to include when retrieving objects from the server.

Type: String[]
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-SiteRelativePath

Site Relative Folder Path

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Web

The web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Folder

SharePoint Developer Patterns and PracticesGet-PnPFolder

applicable: SharePoint Online schema: 2.0.0

Restore-PnPDeletedMicrosoft365Group

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Restores one deleted Microsoft 365 Group

SYNTAX

Restore-PnPDeletedMicrosoft365Group -Identity <Microsoft365GroupPipeBind>
                                    [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Restore-PnPDeletedMicrosoft365Group -Identity 38b32e13-e900-4d95-b860-fb52bc07ca7f

Restores a deleted Microsoft 365 Group based on its ID

——————EXAMPLE 2——————

$group = Get-PnPDeletedMicrosoft365Group -Identity 38b32e13-e900-4d95-b860-fb52bc07ca7f
Restore-PnPDeletedMicrosoft365Group -Identity $group

Restores the provided deleted Microsoft 365 Group

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the deleted Microsoft 365 Group

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and PracticesDocumentation

applicable: SharePoint Online schema: 2.0.0

Restore-PnPDeletedUnifiedGroup

SYNOPSIS

Restores one deleted Office 365 Group (aka Unified Group)

SYNTAX

Restore-PnPDeletedUnifiedGroup -Identity <UnifiedGroupPipeBind>

EXAMPLES

——————EXAMPLE 1——————

Restore-PnPDeletedUnifiedGroup -Identity 38b32e13-e900-4d95-b860-fb52bc07ca7f

Restores a deleted Office 365 Group based on its ID

——————EXAMPLE 2——————

$group = Get-PnPDeletedUnifiedGroup -Identity 38b32e13-e900-4d95-b860-fb52bc07ca7f
Restore-PnPDeletedUnifiedGroup -Identity $group

Restores the provided deleted Office 365 Group

PARAMETERS

-Identity

The Identity of the deleted Office 365 Group

Type: UnifiedGroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Restore-PnPFileVersion

SYNOPSIS

Restores a specific file version.

SYNTAX

Restore-PnPFileVersion -Url <String>
                       [-Identity <FileVersionPipeBind>]
                       [-Force [<SwitchParameter>]]
                       [-Web <WebPipeBind>]
                       [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Restore-PnPFileVersion -Url Documents/MyDocument.docx -Identity 512

Restores the file version with Id 512

——————EXAMPLE 2——————

Restore-PnPFileVersion -Url Documents/MyDocument.docx -Identity "Version 1.0"

Restores the file version with label “Version 1.0”

PARAMETERS

-Force

If provided, no confirmation will be requested and the action will be performed

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Only applicable to: SharePoint Online

Type: FileVersionPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Url

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Restore-PnPRecycleBinItem

SYNOPSIS

Restores the provided recycle bin item to its original location

SYNTAX

All

Restore-PnPRecycleBinItem [-Force [<SwitchParameter>]]
                          [-RowLimit <Int>]
                          [-Connection <PnPConnection>]

Identity

Restore-PnPRecycleBinItem -Identity <RecycleBinItemPipeBind>
                          [-Force [<SwitchParameter>]]
                          [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Restore-PnpRecycleBinItem -Identity 72e4d749-d750-4989-b727-523d6726e442

Restores the recycle bin item with Id 72e4d749-d750-4989-b727-523d6726e442 to its original location

——————EXAMPLE 2——————

Get-PnPRecycleBinItem | ? -Property LeafName -like "*.docx" | Restore-PnpRecycleBinItem

Restores all the items in the first and second stage recycle bins to their original location of which the filename ends with the .docx extension

——————EXAMPLE 3——————

Restore-PnPRecycleBinItem -All -RowLimit 10000

Permanently restores up to 10,000 items in the recycle bin

PARAMETERS

-Force

If provided, no confirmation will be asked to restore the recycle bin item

Type: SwitchParameter
Parameter Sets: Identity, All

Required: False
Position: Named
Accept pipeline input: False

-Identity

Id of the recycle bin item or the recycle bin item object itself to restore

Type: RecycleBinItemPipeBind
Parameter Sets: Identity

Required: True
Position: Named
Accept pipeline input: True

-RowLimit

Limits restoration to specified number of items

Only applicable to: SharePoint Online, SharePoint Server 2019, SharePoint Server 2016

Type: Int
Parameter Sets: All

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Restore-PnPTenantRecycleBinItem

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Restores a site collection from the tenant scoped recycle bin

SYNTAX

Restore-PnPTenantRecycleBinItem -Url <String>
                                [-Wait [<SwitchParameter>]]
                                [-Force [<SwitchParameter>]]
                                [-Connection <PnPConnection>]

DESCRIPTION

The Restore-PnPTenantRecycleBinItem cmdlet allows a site collection that has been deleted and still exists in the tenant recycle bin to be restored to its original location.

EXAMPLES

——————EXAMPLE 1——————

Restore-PnPTenantRecycleBinItem -Url https://tenant.sharepoint.com/sites/contoso

This will restore the deleted site collection with the url ‘https://tenant.sharepoint.com/sites/contoso' to its original location

——————EXAMPLE 2——————

Restore-PnPTenantRecycleBinItem -Url https://tenant.sharepoint.com/sites/contoso -Wait

This will restore the deleted site collection with the url ‘https://tenant.sharepoint.com/sites/contoso' to its original location and will wait with executing further PowerShell commands until the site collection restore has completed

PARAMETERS

-Force

If provided, no confirmation will be asked to restore the site collection from the tenant recycle bin

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Url

Url of the site collection to restore from the tenant recycle bin

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Wait

If provided, the PowerShell execution will halt until the site restore process has completed

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Resume-PnPWorkflowInstance

SYNOPSIS

Resume a workflow

SYNTAX

Resume-PnPWorkflowInstance -Identity <WorkflowInstancePipeBind>
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

DESCRIPTION

Resumes a previously stopped workflow instance

EXAMPLES

——————EXAMPLE 1——————

Resume-PnPWorkflowInstance -identity $wfInstance

Resumes the workflow instance, this can be the Guid of the instance or the instance itself.

PARAMETERS

-Identity

The instance to resume

Type: WorkflowInstancePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Revoke-PnPHubSiteRights

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Revoke permissions to the permissions already in place to associate sites to Hub Sites for one or more specific users

SYNTAX

Revoke-PnPHubSiteRights [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Revoke-PnPHubSiteRights -Identity https://contoso.sharepoint.com/sites/hubsite -Principals "myuser@mydomain.com","myotheruser@mydomain.com"

This example shows how to revoke the rights of myuser and myotheruser to associate their sites with the provided Hub Site

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Revoke-PnPSiteDesignRights

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Revokes the specified principals rights to use the site design.

SYNTAX

Revoke-PnPSiteDesignRights -Identity <TenantSiteDesignPipeBind>
                           -Principals <String[]>
                           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Revoke-PnPSiteDesignRights -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd -Principals "myuser@mydomain.com","myotheruser@mydomain.com"

Revokes rights to the specified principals on the site design specified

——————EXAMPLE 2——————

Get-PnPSiteDesign -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd | Revoke-PnPSiteDesignRights -Principals "myuser@mydomain.com","myotheruser@mydomain.com"

Revokes rights to the specified principals on the site design specified

PARAMETERS

-Identity

The site design to use.

Type: TenantSiteDesignPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Principals

One or more principals to revoke.

Type: String[]
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Revoke-PnPTenantServicePrincipalPermission

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Revokes a permission that was previously granted to the “SharePoint Online Client” service principal.

SYNTAX

Revoke-PnPTenantServicePrincipalPermission -ObjectId <String>
                                           [-Force [<SwitchParameter>]]
                                           [-Connection <PnPConnection>]

DESCRIPTION

Revokes a permission that was previously granted to the “SharePoint Online Client” service principal.

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ObjectId

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Save-PnPClientSidePageConversionLog

SYNOPSIS

Persists the current client side page conversion log data to the loggers linked to the last used page transformation run. Needs to be used in conjunction with the -LogSkipFlush flag on the ConvertTo-PnPClientSidePage cmdlet

SYNTAX

Save-PnPClientSidePageConversionLog [-Web <WebPipeBind>]
                                    [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Save-PnPClientSidePageConversionLog

Persists the current client side page conversion log data to the loggers linked to the last used page transformation run. Needs to be used in conjunction with the -LogSkipFlush flag on the ConvertTo-PnPClientSidePage cmdlet

PARAMETERS

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Save-PnPProvisioningTemplate

SYNOPSIS

Saves a PnP site template to the file system

SYNTAX

Save-PnPProvisioningTemplate -Template <ProvisioningTemplatePipeBind>
                             -Out <String>
                             [-Schema <XMLPnPSchemaVersion>]
                             [-Force [<SwitchParameter>]]
                             [-TemplateProviderExtensions <ITemplateProviderExtension[]>]

EXAMPLES

——————EXAMPLE 1——————

Save-PnPProvisioningTemplate -Template .\template.xml -Out .\template.pnp

Saves a PnP provisioning template to the file system as a PnP file.

——————EXAMPLE 2——————

$template = Read-PnPProvisioningTemplate -Path template.xml
Save-PnPProvisioningTemplate -Template $template -Out .\template.pnp

Saves a PnP site template to the file system as a PnP file. The schema used will the latest released schema when creating the PnP file regardless of the original schema

——————EXAMPLE 3——————

$template = Read-PnPProvisioningTemplate -Path template.xml
Save-PnPProvisioningTemplate -Template $template -Out .\template.pnp -Schema V202002

Saves a PnP site template to the file system as a PnP file and converts the template in the PnP file to the specified schema.

——————EXAMPLE 4——————

Read-PnPProvisioningTemplate -Path template.xml | Save-PnPProvisioningTemplate -Out .\template.pnp

Saves a PnP site template to the file system as a PnP file.

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Out

Filename to write to, optionally including full path.

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Schema

The optional schema to use when creating the PnP file. Always defaults to the latest schema.

Type: XMLPnPSchemaVersion
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Template

Allows you to provide an in-memory instance of the ProvisioningTemplate type of the PnP Core Component. When using this parameter, the -Out parameter refers to the path for saving the template and storing any supporting file for the template.

Type: ProvisioningTemplatePipeBind
Parameter Sets: (All)
Aliases: InputInstance

Required: True
Position: Named
Accept pipeline input: True

-TemplateProviderExtensions

Allows you to specify the ITemplateProviderExtension to execute while saving a template.

Type: ITemplateProviderExtension[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Save-PnPTenantTemplate

SYNOPSIS

Saves a PnP provisioning hierarchy to the file system

SYNTAX

Save-PnPTenantTemplate -Template <ProvisioningHierarchyPipeBind>
                       -Out <String>
                       [-Schema <XMLPnPSchemaVersion>]
                       [-Force [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Save-PnPTenantTemplate -Template template.xml -Out .\tenanttemplate.pnp

Saves a PnP tenant template to the file system

——————EXAMPLE 2——————

$template = Read-PnPTenantTemplate -Path template.xml
Save-PnPTenantTemplate -Template $template -Out .\template.pnp

Saves a PnP tenant template to the file system as a PnP file. The schema used will the latest released schema when creating the PnP file regardless of the original schema

——————EXAMPLE 3——————

$template = Read-PnPTenantTemplate -Path template.xml
Save-PnPTenantTemplate -Template $template -Out .\template.pnp -Schema V202002

Saves a PnP tenant template to the file system as a PnP file and converts the template in the PnP file to the specified schema.

——————EXAMPLE 4——————

Read-PnPTenantTemplate -Path template.xml | Save-PnPTenantTemplate -Out .\template.pnp

Saves a PnP tenant template to the file system as a PnP file.

PARAMETERS

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Out

Filename to write to, optionally including full path.

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Schema

The optional schema to use when creating the PnP file. Always defaults to the latest schema.

Type: XMLPnPSchemaVersion
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Template

Allows you to provide an in-memory instance of a Tenant Template or a filename of a template file in XML format. When using this parameter, the -Out parameter refers to the path for saving the template and storing any supporting file for the template.

Type: ProvisioningHierarchyPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Send-PnPMail

SYNOPSIS

Sends an email using the Office 365 SMTP Service or SharePoint, depending on the parameters specified. See detailed help for more information.

SYNTAX

Send-PnPMail -To <String[]>
             -Subject <String>
             -Body <String>
             [-Server <String>]
             [-From <String>]
             [-Password <String>]
             [-Cc <String[]>]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Send-PnPMail -To address@tenant.sharepointonline.com -Subject test -Body test

Sends an e-mail using the SharePoint SendEmail method using the current context. E-mail is sent from the system account and can only be sent to accounts in the same tenant

——————EXAMPLE 2——————

Send-PnPMail -To address@contoso.com -Subject test -Body test -From me@tenant.onmicrosoft.com -Password xyz

Sends an e-mail via Office 365 SMTP and requires a from address and password. E-mail is sent from the from user and can be sent to both internal and external addresses.

——————EXAMPLE 3——————

Send-PnPMail -To address@contoso.com -Subject test -Body test -From me@server.net -Password xyz -Server yoursmtp.server.net

Sends an e-mail via a custom SMTP server and requires a from address and password. E-mail is sent from the from user.

PARAMETERS

-Body

Body of the email. Accepts simple HTML as &lt;h1&gt;&lt;/h1&gt;, &lt;br/&gt; etc.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Cc

List of recipients on CC

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-From

If using from address, you also have to provide a password

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Password

If using a password, you also have to provide the associated from address

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Server

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Subject

Subject of the email

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-To

List of recipients

Type: String[]
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Set-PnPApplicationCustomizer

SYNOPSIS

Updates a SharePoint Framework client side extension application customizer

SYNTAX

Custom Action Id

Set-PnPApplicationCustomizer [-Identity <UserCustomActionPipeBind>]
                             [-Scope <CustomActionScope>]
                             [-Title <String>]
                             [-Description <String>]
                             [-Sequence <Int>]
                             [-ClientSideComponentProperties <String>]
                             [-Web <WebPipeBind>]
                             [-Connection <PnPConnection>]

Client Side Component Id

Set-PnPApplicationCustomizer [-ClientSideComponentId <GuidPipeBind>]
                             [-Scope <CustomActionScope>]
                             [-Title <String>]
                             [-Description <String>]
                             [-Sequence <Int>]
                             [-ClientSideComponentProperties <String>]
                             [-Web <WebPipeBind>]
                             [-Connection <PnPConnection>]

DESCRIPTION

Updates a SharePoint Framework client side extension application customizer by updating its custom action. Only the properties that will be provided will be updated. Others will remain as they are.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPApplicationCustomizer -Identity aa66f67e-46c0-4474-8a82-42bf467d07f2

Updates the custom action representing the client side extension registration with the id ‘aa66f67e-46c0-4474-8a82-42bf467d07f2’.

——————EXAMPLE 2——————

Set-PnPApplicationCustomizer -ClientSideComponentId aa66f67e-46c0-4474-8a82-42bf467d07f2 -Scope web -ClientSideComponentProperties "{`"sourceTermSet`":`"PnP-CollabFooter-SharedLinks`",`"personalItemsStorageProperty`":`"PnP-CollabFooter-MyLinks`"}

Updates the custom action(s) properties being registered for a SharePoint Framework solution having the id ‘aa66f67e-46c0-4474-8a82-42bf467d07f2’ in its manifest from the current web.

PARAMETERS

-ClientSideComponentId

The Client Side Component Id of the SharePoint Framework client side extension application customizer found in the manifest for which existing custom action(s) should be updated

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: GuidPipeBind
Parameter Sets: Client Side Component Id

Required: False
Position: Named
Accept pipeline input: False

-ClientSideComponentProperties

The Client Side Component Properties of the application customizer to update. Specify values as a json string : “{Property1 : ‘Value1’, Property2: ‘Value2’}”. Omit to not update this property.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The description of the application customizer. Omit to not update this property.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The id or name of the CustomAction representing the client side extension registration that needs to be updated or a CustomAction instance itself

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: UserCustomActionPipeBind
Parameter Sets: Custom Action Id

Required: False
Position: 0
Accept pipeline input: True

-Scope

Define if the CustomAction representing the client side extension registration is to be found at the web or site collection scope. Specify All to update the component on both web and site collection level.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: CustomActionScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Sequence

Sequence of this application customizer being injected. Use when you have a specific sequence with which to have multiple application customizers being added to the page. Omit to not update this property.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

The title of the application customizer. Omit to not update this property.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPAppSideLoading

SYNOPSIS

Enables the App SideLoading Feature on a site

SYNTAX

On

Set-PnPAppSideLoading -On [<SwitchParameter>]
                      [-Connection <PnPConnection>]

Off

Set-PnPAppSideLoading -Off [<SwitchParameter>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPAppSideLoading -On

This will turn on App side loading

——————EXAMPLE 2——————

Set-PnPAppSideLoading -Off

This will turn off App side loading

PARAMETERS

-Off

Type: SwitchParameter
Parameter Sets: Off

Required: True
Position: Named
Accept pipeline input: False

-On

Type: SwitchParameter
Parameter Sets: On

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPAuditing

SYNOPSIS

Set Auditing setting for a site

SYNTAX

Specific flags

Set-PnPAuditing [-RetentionTime <Int>]
                [-TrimAuditLog [<SwitchParameter>]]
                [-EditItems [<SwitchParameter>]]
                [-CheckOutCheckInItems [<SwitchParameter>]]
                [-MoveCopyItems [<SwitchParameter>]]
                [-DeleteRestoreItems [<SwitchParameter>]]
                [-EditContentTypesColumns [<SwitchParameter>]]
                [-SearchContent [<SwitchParameter>]]
                [-EditUsersPermissions [<SwitchParameter>]]
                [-Connection <PnPConnection>]

Enable all

Set-PnPAuditing -EnableAll [<SwitchParameter>]
                [-RetentionTime <Int>]
                [-TrimAuditLog [<SwitchParameter>]]
                [-Connection <PnPConnection>]

Disable All

Set-PnPAuditing -DisableAll [<SwitchParameter>]
                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPAuditing -EnableAll

Enables all auditing settings for the current site

——————EXAMPLE 2——————

Set-PnPAuditing -DisableAll

Disables all auditing settings for the current site

——————EXAMPLE 3——————

Set-PnPAuditing -RetentionTime 7

Sets the audit log trimming to 7 days, this also enables the automatic trimming of the audit log

——————EXAMPLE 4——————

Set-PnPAuditing -TrimAuditLog

Enables the automatic trimming of the audit log

——————EXAMPLE 5——————

Set-PnPAuditing -RetentionTime 7 -CheckOutCheckInItems -MoveCopyItems -SearchContent

Sets the audit log trimming to 7 days, this also enables the automatic trimming of the audit log.

Do auditing for:

  • Checking out or checking in items
  • Moving or copying items to another location in the site
  • Searching site content

PARAMETERS

-CheckOutCheckInItems

Audit checking out or checking in items

Type: SwitchParameter
Parameter Sets: Specific flags

Required: False
Position: Named
Accept pipeline input: False

-DeleteRestoreItems

Audit deleting or restoring items

Type: SwitchParameter
Parameter Sets: Specific flags

Required: False
Position: Named
Accept pipeline input: False

-DisableAll

Disable all audit flags

Type: SwitchParameter
Parameter Sets: Disable All

Required: True
Position: Named
Accept pipeline input: False

-EditContentTypesColumns

Audit editing content types and columns

Type: SwitchParameter
Parameter Sets: Specific flags

Required: False
Position: Named
Accept pipeline input: False

-EditItems

Audit editing items

Type: SwitchParameter
Parameter Sets: Specific flags

Required: False
Position: Named
Accept pipeline input: False

-EditUsersPermissions

Audit editing users and permissions

Type: SwitchParameter
Parameter Sets: Specific flags

Required: False
Position: Named
Accept pipeline input: False

-EnableAll

Enable all audit flags

Type: SwitchParameter
Parameter Sets: Enable all

Required: True
Position: Named
Accept pipeline input: False

-MoveCopyItems

Audit moving or copying items to another location in the site.

Type: SwitchParameter
Parameter Sets: Specific flags

Required: False
Position: Named
Accept pipeline input: False

-RetentionTime

Set the retention time

Type: Int
Parameter Sets: Specific flags, Enable all

Required: False
Position: Named
Accept pipeline input: False

-SearchContent

Audit searching site content

Type: SwitchParameter
Parameter Sets: Specific flags

Required: False
Position: Named
Accept pipeline input: False

-TrimAuditLog

Trim the audit log

Type: SwitchParameter
Parameter Sets: Specific flags, Enable all

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPAvailablePageLayouts

SYNOPSIS

Sets the available page layouts for the current site

SYNTAX

SPECIFIC

Set-PnPAvailablePageLayouts -PageLayouts <String[]>
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

ALL

Set-PnPAvailablePageLayouts -AllowAllPageLayouts [<SwitchParameter>]
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

INHERIT

Set-PnPAvailablePageLayouts -InheritPageLayouts [<SwitchParameter>]
                            [-Web <WebPipeBind>]
                            [-Connection <PnPConnection>]

PARAMETERS

-AllowAllPageLayouts

An array of page layout files to set as available page layouts for the site.

Type: SwitchParameter
Parameter Sets: ALL

Required: True
Position: Named
Accept pipeline input: False

-InheritPageLayouts

Set the available page layouts to inherit from the parent site.

Type: SwitchParameter
Parameter Sets: INHERIT

Required: True
Position: Named
Accept pipeline input: False

-PageLayouts

An array of page layout files to set as available page layouts for the site.

Type: String[]
Parameter Sets: SPECIFIC

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Set-PnPClientSidePage

SYNOPSIS

Sets parameters of a Client-Side Page

SYNTAX

Custom Header

Set-PnPClientSidePage -Identity <ClientSidePagePipeBind>
                      [-ServerRelativeImageUrl <String>]
                      [-TranslateX <Double>]
                      [-TranslateY <Double>]
                      [-Name <String>]
                      [-Title <String>]
                      [-LayoutType <ClientSidePageLayoutType>]
                      [-PromoteAs <ClientSidePagePromoteType>]
                      [-CommentsEnabled [<SwitchParameter>]]
                      [-Publish [<SwitchParameter>]]
                      [-HeaderType <ClientSidePageHeaderType>]
                      [-ContentType <ContentTypePipeBind>]
                      [-ThumbnailUrl <String>]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPClientSidePage -Identity "MyPage" -LayoutType Home -Title "My Page"

Updates the properties of the Client-Side page named ‘MyPage’

——————EXAMPLE 2——————

Set-PnPClientSidePage -Identity "MyPage" -CommentsEnabled

Enables the comments on the Client-Side page named ‘MyPage’

——————EXAMPLE 3——————

Set-PnPClientSidePage -Identity "MyPage" -CommentsEnabled:$false

Disables the comments on the Client-Side page named ‘MyPage’

——————EXAMPLE 4——————

Set-PnPClientSidePage -Identity "MyPage" -HeaderType Default

Sets the header of the page to the default header

——————EXAMPLE 5——————

Set-PnPClientSidePage -Identity "MyPage" -HeaderType None

Removes the header of the page

——————EXAMPLE 6——————

Set-PnPClientSidePage -Identity "MyPage" -HeaderType Custom -ServerRelativeImageUrl "/sites/demo1/assets/myimage.png" -TranslateX 10.5 -TranslateY 11.0

Sets the header of the page to custom header, using the specified image and translates the location of the image in the header given the values specified

PARAMETERS

-CommentsEnabled

Enables or Disables the comments on the page

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ContentType

Specify either the name, ID or an actual content type.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-HeaderType

Sets the page header type

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePageHeaderType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The name/identity of the page

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-LayoutType

Sets the layout type of the page. (Default = Article)

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePageLayoutType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Name

Sets the name of the page.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PromoteAs

Allows to promote the page for a specific purpose (None | HomePage | NewsArticle | Template)

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePromoteType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Publish

Publishes the page once it is saved.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ServerRelativeImageUrl

The URL of the image to show in the header

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: Custom Header

Required: False
Position: 0
Accept pipeline input: False

-ThumbnailUrl

Thumbnail Url

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

Sets the title of the page.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TranslateX

A value defining how to translate the image on the x-axis

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Double
Parameter Sets: Custom Header

Required: False
Position: 0
Accept pipeline input: False

-TranslateY

A value defining how to translate the image on the y-axis

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: Double
Parameter Sets: Custom Header

Required: False
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Set-PnPClientSideText

SYNOPSIS

Set Client-Side Text Component properties

SYNTAX

Set-PnPClientSideText -Page <ClientSidePagePipeBind>
                      -InstanceId <GuidPipeBind>
                      -Text <String>
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

DESCRIPTION

Sets the rendered text in existing client side text component

EXAMPLES

——————EXAMPLE 1——————

Set-PnPSetClientSideText -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -Text "MyText"

Sets the text of the client side text component.

PARAMETERS

-InstanceId

The instance id of the text component

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: GuidPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Page

The name of the page

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Text

Text to set

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Set-PnPClientSideWebPart

SYNOPSIS

Set Client-Side Web Part properties

SYNTAX

Set-PnPClientSideWebPart -Page <ClientSidePagePipeBind>
                         -Identity <ClientSideWebPartPipeBind>
                         [-Title <String>]
                         [-PropertiesJson <String>]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

DESCRIPTION

Sets specific client side web part properties. Notice that the title parameter will only set the -internal- title of web part. The title which is shown in the UI will, if possible, have to be set using the PropertiesJson parameter. Use Get-PnPClientSideComponent to retrieve the instance id and properties of a web part.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPClientSideWebPart -Page Home -Identity a2875399-d6ff-43a0-96da-be6ae5875f82 -PropertiesJson $myproperties

Sets the properties of the client side web part given in the $myproperties variable.

PARAMETERS

-Identity

The identity of the web part. This can be the web part instance id or the title of a web part

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSideWebPartPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Page

The name of the page

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: ClientSidePagePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-PropertiesJson

Sets the properties as a JSON string.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Title

Sets the internal title of the web part. Notice that this will NOT set a visible title.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPContext

SYNOPSIS

Set the ClientContext

SYNTAX

Set-PnPContext -Context <ClientContext>

DESCRIPTION

Sets the Client Context to use by the cmdlets, which allows easy context switching. See examples for details.

EXAMPLES

——————EXAMPLE 1——————

Connect-PnPOnline -Url $siteAurl -Credentials $credentials
$ctx = Get-PnPContext
Get-PnPList # returns the lists from site specified with $siteAurl
Connect-PnPOnline -Url $siteBurl -Credentials $credentials
Get-PnPList # returns the lists from the site specified with $siteBurl
Set-PnPContext -Context $ctx # switch back to site A
Get-PnPList # returns the lists from site A

PARAMETERS

-Context

The ClientContext to set

Type: ClientContext
Parameter Sets: (All)

Required: True
Position: 1
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPDefaultColumnValues

SYNOPSIS

Sets default column values for a document library

SYNTAX

Set-PnPDefaultColumnValues -List <ListPipeBind>
                           -Field <FieldPipeBind>
                           -Value <String[]>
                           [-Folder <String>]
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

DESCRIPTION

Sets default column values for a document library, per folder, or for the root folder if the folder parameter has not been specified. Supports both text and taxonomy fields.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPDefaultColumnValues -List Documents -Field TaxKeyword -Value "Company|Locations|Stockholm"

Sets a default value for the enterprise keywords field on a library to a term called “Stockholm”, located in the “Locations” term set, which is part of the “Company” term group

——————EXAMPLE 2——————

Set-PnPDefaultColumnValues -List Documents -Field TaxKeyword -Value "15c4c4e4-4b67-4894-a1d8-de5ff811c791"

Sets a default value for the enterprise keywords field on a library to a term with the id “15c4c4e4-4b67-4894-a1d8-de5ff811c791”. You need to ensure the term is valid for the field.

——————EXAMPLE 3——————

Set-PnPDefaultColumnValues -List Documents -Field MyTextField -Value "DefaultValue" -Folder "My folder"

Sets a default value for the MyTextField text field on the folder “My folder” in a library to a value of “DefaultValue”

——————EXAMPLE 4——————

Set-PnPDefaultColumnValues -List Documents -Field MyPeopleField -Value "1;#Foo Bar"

Sets a default value for the MyPeopleField people field on a library to a value of “Foo Bar” using the id from the user information list.

——————EXAMPLE 5——————

$user = New-PnPUser -LoginName foobar@contoso.com
Set-PnPDefaultColumnValues -List Documents -Field MyPeopleField -Value "$($user.Id);#$($user.LoginName)"

Sets a default value for the MyPeopleField people field on a library to a value of “Foo Bar” using the id from the user information list.

——————EXAMPLE 6——————

$user1 = New-PnPUser -LoginName user1@contoso.com
$user2 = New-PnPUser -LoginName user2@contoso.com
Set-PnPDefaultColumnValues -List Documents -Field MyMultiPeopleField -Value "$($user1.Id);#$($user1.LoginName)","$($user2.Id);#$($user2.LoginName)"

Sets a default value for the MyMultiPeopleField people field on a library to a value of “User 1” and “User 2” using the id from the user information list.

PARAMETERS

-Field

The internal name, id or a reference to a field

Type: FieldPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Folder

A library relative folder path, if not specified it will set the default column values on the root folder of the library ('/')

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

The ID, Name or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Value

A list of values. In case of a text field the values will be concatenated, separated by a semi-colon. In case of a taxonomy field multiple values will added. In case of people field multiple values will be added.

Type: String[]
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPDefaultContentTypeToList

SYNOPSIS

Sets the default content type for a list

SYNTAX

Set-PnPDefaultContentTypeToList -List <ListPipeBind>
                                -ContentType <ContentTypePipeBind>
                                [-Web <WebPipeBind>]
                                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPDefaultContentTypeToList -List "Project Documents" -ContentType "Project"

This will set the Project content type (which has already been added to a list) as the default content type

PARAMETERS

-ContentType

The content type object that needs to be set as the default content type on the list. Content Type needs to be present on the list.

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-List

The name of a list, an ID or the actual list object to update

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPDefaultPageLayout

SYNOPSIS

Sets a specific page layout to be the default page layout for a publishing site

SYNTAX

TITLE

Set-PnPDefaultPageLayout -Title <String>
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

INHERIT

Set-PnPDefaultPageLayout -InheritFromParentSite [<SwitchParameter>]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPDefaultPageLayout -Title projectpage.aspx

Sets projectpage.aspx to be the default page layout for the current web

——————EXAMPLE 2——————

Set-PnPDefaultPageLayout -Title test/testpage.aspx

Sets a page layout in a folder in the Master Page & Page Layout gallery, such as _catalog/masterpage/test/testpage.aspx, to be the default page layout for the current web

——————EXAMPLE 3——————

Set-PnPDefaultPageLayout -InheritFromParentSite

Sets the default page layout to be inherited from the parent site

PARAMETERS

-InheritFromParentSite

Set the default page layout to be inherited from the parent site.

Type: SwitchParameter
Parameter Sets: INHERIT

Required: True
Position: Named
Accept pipeline input: False

-Title

Title of the page layout

Type: String
Parameter Sets: TITLE

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPDocumentSetField

SYNOPSIS

Sets a site column from the available content types to a document set

SYNTAX

Set-PnPDocumentSetField -DocumentSet <DocumentSetPipeBind>
                        -Field <FieldPipeBind>
                        [-SetSharedField [<SwitchParameter>]]
                        [-SetWelcomePageField [<SwitchParameter>]]
                        [-RemoveSharedField [<SwitchParameter>]]
                        [-RemoveWelcomePageField [<SwitchParameter>]]
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPDocumentSetField -Field "Test Field" -DocumentSet "Test Document Set" -SetSharedField -SetWelcomePageField

This will set the field, available in one of the available content types, as a Shared Field and as a Welcome Page Field.

——————EXAMPLE 2——————

Set-PnPDocumentSetField -Field "Test Field" -DocumentSet "Test Document Set" -RemoveSharedField -RemoveWelcomePageField

This will remove the field, available in one of the available content types, as a Shared Field and as a Welcome Page Field.

PARAMETERS

-DocumentSet

The document set in which to set the field. Either specify a name, a document set template object, an id, or a content type object

Type: DocumentSetPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Field

The field to set. The field needs to be available in one of the available content types. Either specify a name, an id or a field object

Type: FieldPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-RemoveSharedField

Removes the field as a Shared Field

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RemoveWelcomePageField

Removes the field as a Welcome Page Field

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SetSharedField

Set the field as a Shared Field

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SetWelcomePageField

Set the field as a Welcome Page field

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPField

SYNOPSIS

Changes one or more properties of a field in a specific list or for the whole web

SYNTAX

Set-PnPField -Identity <FieldPipeBind>
             -Values <Hashtable>
             [-List <ListPipeBind>]
             [-UpdateExistingLists [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPField -Identity AssignedTo -Values @{JSLink="customrendering.js";Group="My fields"}

Updates the AssignedTo field on the current web to use customrendering.js for the JSLink and sets the group name the field is categorized in to “My Fields”. Lists that are already using the AssignedTo field will not be updated.

——————EXAMPLE 2——————

Set-PnPField -Identity AssignedTo -Values @{JSLink="customrendering.js";Group="My fields"} -UpdateExistingLists

Updates the AssignedTo field on the current web to use customrendering.js for the JSLink and sets the group name the field is categorized in to “My Fields”. Lists that are already using the AssignedTo field will also be updated.

——————EXAMPLE 3——————

Set-PnPField -List "Tasks" -Identity "AssignedTo" -Values @{JSLink="customrendering.js"}

Updates the AssignedTo field on the Tasks list to use customrendering.js for the JSLink

PARAMETERS

-Identity

The field object, internal field name (case sensitive) or field id to update

Type: FieldPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-List

The list object, name or id where to update the field. If omitted the field will be updated on the web.

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: True

-UpdateExistingLists

If provided, the field will be updated on existing lists that use it as well. If not provided or set to $false, existing lists using the field will remain unchanged but new lists will get the updated field.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Values

Hashtable of properties to update on the field. Use the syntax @{property1=“value”;property2=“value”}.

Type: Hashtable
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Field

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPFileCheckedIn

SYNOPSIS

Checks in a file

SYNTAX

Set-PnPFileCheckedIn -Url <String>
                     [-CheckinType <CheckinType>]
                     [-Comment <String>]
                     [-Approve [<SwitchParameter>]]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

PS:>Set-PnPFileCheckedIn -Url "/Documents/Contract.docx"

Checks in the file “Contract.docx” in the “Documents” library

——————EXAMPLE 2——————

PS:>Set-PnPFileCheckedIn -Url "/Documents/Contract.docx" -CheckinType MinorCheckin -Comment "Smaller changes"

Checks in the file “Contract.docx” in the “Documents” library as a minor version and adds the check in comment “Smaller changes”

PARAMETERS

-Approve

Approve file

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CheckinType

The check in type to use. Defaults to Major

Type: CheckinType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Comment

The check in comment

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Url

The server relative url of the file to check in

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPFileCheckedOut

SYNOPSIS

Checks out a file

SYNTAX

Set-PnPFileCheckedOut -Url <String>
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

PS:>Set-PnPFileCheckedOut -Url "/sites/testsite/subsite/Documents/Contract.docx"

Checks out the file “Contract.docx” in the “Documents” library.

PARAMETERS

-Url

The server relative url of the file to check out

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPFolderPermission

SYNOPSIS

Sets folder permissions. Use Get-PnPRoleDefinition to retrieve all available roles you can add or remove using this cmdlet.

SYNTAX

Inherit

Set-PnPFolderPermission -List <ListPipeBind>
                        -Identity <FolderPipeBind>
                        [-InheritPermissions [<SwitchParameter>]]
                        [-SystemUpdate [<SwitchParameter>]]
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

Group

Set-PnPFolderPermission -Group <GroupPipeBind>
                        -List <ListPipeBind>
                        -Identity <FolderPipeBind>
                        [-AddRole <String>]
                        [-RemoveRole <String>]
                        [-ClearExisting [<SwitchParameter>]]
                        [-SystemUpdate [<SwitchParameter>]]
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

User

Set-PnPFolderPermission -User <String>
                        -List <ListPipeBind>
                        -Identity <FolderPipeBind>
                        [-AddRole <String>]
                        [-RemoveRole <String>]
                        [-ClearExisting [<SwitchParameter>]]
                        [-SystemUpdate [<SwitchParameter>]]
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPFolderPermission -List 'Shared Documents' -Identity 'Shared Documents\Folder' -User 'user@contoso.com' -AddRole 'Contribute'

Adds the ‘Contribute’ permission to the user ‘user@contoso.com’ for the folder named ‘Folder’ located in the root of the library ‘Shared Documents’

——————EXAMPLE 2——————

Set-PnPFolderPermission -List 'Documents' -Identity 'Shared Documents\Folder\Subfolder' -User 'user@contoso.com' -RemoveRole 'Contribute'

Removes the ‘Contribute’ permission to the user ‘user@contoso.com’ for the folder named ‘Subfolder’ located in the folder ‘Folder’ which is located in the root of the library ‘Shared Documents’

——————EXAMPLE 3——————

Set-PnPFolderPermission -List 'Documents' -Identity 'Shared Documents\Folder' -User 'user@contoso.com' -AddRole 'Contribute' -ClearExisting

Adds the ‘Contribute’ permission to the user ‘user@contoso.com’ for the folder named ‘Folder’ located in the root of the library ‘Shared Documents’ and removes all other permissions

——————EXAMPLE 4——————

Get-PnPFolder -Url 'Shared Documents\Folder' | Set-PnPFolderPermission -List 'Documents' -InheritPermissions

Resets permissions for the folder named ‘Folder’ located in the root of the library ‘Shared Documents’ to inherit permissions from the library ‘Shared Documents’

PARAMETERS

-AddRole

The role that must be assigned to the group or user

Type: String
Parameter Sets: User, Group

Required: False
Position: Named
Accept pipeline input: False

-ClearExisting

Clear all existing permissions

Type: SwitchParameter
Parameter Sets: User, Group

Required: False
Position: Named
Accept pipeline input: False

-Group

Type: GroupPipeBind
Parameter Sets: Group

Required: True
Position: Named
Accept pipeline input: False

-Identity

The ID of the folder, the server relative URL to the folder or actual Folder object

Type: FolderPipeBind
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: True

-InheritPermissions

Inherit permissions from the parent, removing unique permissions

Type: SwitchParameter
Parameter Sets: Inherit

Required: False
Position: Named
Accept pipeline input: False

-List

The ID, Title or Url of the list the folder is part of

Type: ListPipeBind
Parameter Sets: __AllParameterSets

Required: True
Position: 0
Accept pipeline input: False

-RemoveRole

The role that must be removed from the group or user

Type: String
Parameter Sets: User, Group

Required: False
Position: Named
Accept pipeline input: False

-SystemUpdate

Update the folder permissions without creating a new version or triggering MS Flow.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-User

Type: String
Parameter Sets: User

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPFooter

SYNOPSIS

Configures the footer of the current web

SYNTAX

Set-PnPFooter [-Enabled [<SwitchParameter>]]
              [-Layout <FooterLayoutType>]
              [-BackgroundTheme <FooterVariantThemeType>]
              [-Title <String>]
              [-LogoUrl <String>]
              [-Web <WebPipeBind>]
              [-Connection <PnPConnection>]

DESCRIPTION

Allows the footer to be enabled or disabled and fine tuned in the current web. For modifying the navigation links shown in the footer, use Add-PnPNavigationNode -Location Footer.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPFooter -Enabled:$true

Enables the footer to be shown on the current web

——————EXAMPLE 2——————

Set-PnPFooter -Enabled:$true -Layout Extended -BackgroundTheme Neutral

Enables the footer to be shown on the current web with the extended layout using a neutral background

——————EXAMPLE 3——————

Set-PnPFooter -Title "Contoso Inc." -LogoUrl "/sites/communication/Shared Documents/logo.png"

Sets the title and logo shown in the footer

——————EXAMPLE 4——————

Set-PnPFooter -LogoUrl ""

Removes the current logo shown in the footer

PARAMETERS

-BackgroundTheme

Defines the background emphasis of the content in the footer

Type: FooterVariantThemeType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Enabled

Indicates if the footer should be shown on the current web ($true) or if it should be hidden ($false)

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Layout

Defines how the footer should look like

Type: FooterLayoutType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LogoUrl

Defines the server relative URL to the logo to be displayed in the footer. Provide an empty string to remove the current logo.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

Defines the title displayed in the footer

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPGraphSubscription

SYNOPSIS

Updates an existing Microsoft Graph subscription. Required Azure Active Directory application permission depends on the resource the subscription exists on, see https://docs.microsoft.com/graph/api/subscription-delete#permissions.

SYNTAX

Set-PnPGraphSubscription -Identity <GraphSubscriptionPipeBind>
                         -ExpirationDate <DateTime>
                         [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPGraphSubscription -Identity bc204397-1128-4911-9d70-1d8bceee39da -ExpirationDate "2020-11-22T18:23:45.9356913Z"

Updates the Microsoft Graph subscription with the id ‘bc204397-1128-4911-9d70-1d8bceee39da’ to expire at the mentioned date

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ExpirationDate

Date and time to set the expiration to. Take notice of the maximum allowed lifetime of the subscription endponts as documented at https://docs.microsoft.com/graph/api/resources/subscription#maximum-length-of-subscription-per-resource-type

Type: DateTime
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Identity

The unique id or an instance of a Microsoft Graph Subscription

Type: GraphSubscriptionPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPGroup

SYNOPSIS

Updates a group

SYNTAX

Set-PnPGroup -Identity <GroupPipeBind>
             [-SetAssociatedGroup <AssociatedGroupType>]
             [-AddRole <String>]
             [-RemoveRole <String>]
             [-Title <String>]
             [-Owner <String>]
             [-Description <String>]
             [-AllowRequestToJoinLeave <Boolean>]
             [-AutoAcceptRequestToJoinLeave <Boolean>]
             [-AllowMembersEditMembership <Boolean>]
             [-OnlyAllowMembersViewMembership <Boolean>]
             [-RequestToJoinEmail <String>]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPGroup -Identity 'My Site Members' -SetAssociatedGroup Members

Sets the SharePoint group with the name ‘My Site Members’ as the associated members group

——————EXAMPLE 2——————

Set-PnPGroup -Identity 'My Site Members' -Owner 'site owners'

Sets the SharePoint group with the name ‘site owners’ as the owner of the SharePoint group with the name ‘My Site Members’

PARAMETERS

-AddRole

Name of the permission set to add to this SharePoint group

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-AllowMembersEditMembership

A switch parameter that specifies whether group members can modify membership in the group

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-AllowRequestToJoinLeave

A switch parameter that specifies whether to allow users to request membership in the group and to allow users to request to leave the group

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-AutoAcceptRequestToJoinLeave

A switch parameter that specifies whether users are automatically added or removed when they make a request

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The description for the group

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

A group object, an ID or a name of a group

Type: GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-OnlyAllowMembersViewMembership

A switch parameter that specifies whether only group members are allowed to view the list of members in the group

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owner

The owner for the group, which can be a user or another group

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RemoveRole

Name of the permission set to remove from this SharePoint group

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RequestToJoinEmail

The e-mail address to which membership requests are sent

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SetAssociatedGroup

One of the associated group types (Visitors, Members, Owners

Type: AssociatedGroupType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

The title for the group

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPGroupPermissions

SYNOPSIS

Adds and/or removes permissions of a specific SharePoint group

SYNTAX

ByName

Set-PnPGroupPermissions -Identity <GroupPipeBind>
                        [-List <ListPipeBind>]
                        [-AddRole <String[]>]
                        [-RemoveRole <String[]>]
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPGroupPermissions -Identity 'My Site Members' -AddRole Contribute

Adds the ‘Contribute’ permission to the SharePoint group with the name ‘My Site Members’

——————EXAMPLE 2——————

Set-PnPGroupPermissions -Identity 'My Site Members' -RemoveRole 'Full Control' -AddRole 'Read'

Removes the ‘Full Control’ from and adds the ‘Contribute’ permissions to the SharePoint group with the name ‘My Site Members’

——————EXAMPLE 3——————

Set-PnPGroupPermissions -Identity 'My Site Members' -AddRole @('Contribute', 'Design')

Adds the ‘Contribute’ and ‘Design’ permissions to the SharePoint group with the name ‘My Site Members’

——————EXAMPLE 4——————

Set-PnPGroupPermissions -Identity 'My Site Members' -RemoveRole @('Contribute', 'Design')

Removes the ‘Contribute’ and ‘Design’ permissions from the SharePoint group with the name ‘My Site Members’

——————EXAMPLE 5——————

Set-PnPGroupPermissions -Identity 'My Site Members' -List 'MyList' -RemoveRole @('Contribute')

Removes the ‘Contribute’ permissions from the list ‘MyList’ for the group with the name ‘My Site Members’

PARAMETERS

-AddRole

Name of the permission set to add to this SharePoint group

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Get the permissions of a specific group by name

Type: GroupPipeBind
Parameter Sets: ByName
Aliases: Name

Required: True
Position: 0
Accept pipeline input: True

-List

The list to apply the command to.

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RemoveRole

Name of the permission set to remove from this SharePoint group

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPHideDefaultThemes

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Defines if the default / OOTB themes should be visible to users or not.

SYNTAX

Set-PnPHideDefaultThemes -HideDefaultThemes <Boolean>
                         [-Connection <PnPConnection>]

DESCRIPTION

Use this cmdlet to hide or show the default themes to users

You must be a SharePoint Online global administrator to run the cmdlet.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPHideDefaultThemes -HideDefaultThemes $true

This example hides the default themes

——————EXAMPLE 2——————

Set-PnPHideDefaultThemes -HideDefaultThemes $false

This example shows the default themes

PARAMETERS

-HideDefaultThemes

Defines if the default themes should be visible or hidden

Type: Boolean
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPHomePage

SYNOPSIS

Sets the home page of the current web.

SYNTAX

Set-PnPHomePage -RootFolderRelativeUrl <String>
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPHomePage -RootFolderRelativeUrl SitePages/Home.aspx

Sets the home page to the home.aspx file which resides in the SitePages library

PARAMETERS

-RootFolderRelativeUrl

The root folder relative url of the homepage, e.g. ‘sitepages/home.aspx’

Type: String
Parameter Sets: (All)
Aliases: Path

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPHomeSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Sets the home site for your tenant

SYNTAX

Set-PnPHomeSite -Url <String>
                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPHomeSite -Url https://yourtenant.sharepoint.com/sites/myhome

Sets the home site to the provided site collection url

PARAMETERS

-Url

The url of the site to set as the home site

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPHubSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Sets hub site properties

SYNTAX

Set-PnPHubSite [-SiteDesignId <GuidPipeBind>]
               [-HideNameInNavigation [<SwitchParameter>]]
               [-RequiresJoinApproval [<SwitchParameter>]]
               [-Connection <PnPConnection>]

DESCRIPTION

Allows configuring a hub site

EXAMPLES

——————EXAMPLE 1——————

Set-PnPHubSite -Identity https://tenant.sharepoint.com/sites/myhubsite -Title "My New Title"

Sets the title of the hub site

——————EXAMPLE 2——————

Set-PnPHubSite -Identity https://tenant.sharepoint.com/sites/myhubsite -Description "My updated description"

Sets the description of the hub site

——————EXAMPLE 3——————

Set-PnPHubSite -Identity https://tenant.sharepoint.com/sites/myhubsite -SiteDesignId df8a3ef1-9603-44c4-abd9-541aea2fa745

Sets the site design which should be applied to sites joining the the hub site

——————EXAMPLE 4——————

Set-PnPHubSite -Identity https://tenant.sharepoint.com/sites/myhubsite -LogoUrl "https://tenant.sharepoint.com/SiteAssets/Logo.png"

Sets the logo of the hub site

PARAMETERS

-HideNameInNavigation

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RequiresJoinApproval

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SiteDesignId

GUID of the SharePoint Site Design which should be applied when a site joins the hub site

Type: GuidPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPIndexedProperties

SYNOPSIS

Marks values of the propertybag to be indexed by search. Notice that this will overwrite the existing flags, i.e. only the properties you define with the cmdlet will be indexed.

SYNTAX

Set-PnPIndexedProperties -Keys <String>
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

PARAMETERS

-Keys

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPInPlaceRecordsManagement

SYNOPSIS

Activates or deactivates in the place records management feature.

SYNTAX

Enable or Disable

Set-PnPInPlaceRecordsManagement -Enabled <Boolean>
                                [-Web <WebPipeBind>]
                                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPInPlaceRecordsManagement -Enabled $true

Activates In Place Records Management

——————EXAMPLE 2——————

Set-PnPInPlaceRecordsManagement -Enabled $false

Deactivates In Place Records Management

PARAMETERS

-Enabled

Type: Boolean
Parameter Sets: Enable or Disable

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPKnowledgeHubSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Sets the Knowledge Hub Site for your tenant

SYNTAX

Set-PnPKnowledgeHubSite -KnowledgeHubSiteUrl <String>
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPKnowledgeHubSite -KnowledgeHubSiteUrl https://yoursite.sharepoint.com/sites/knowledge

Sets the Knowledge Hub Site for your tenant

PARAMETERS

-KnowledgeHubSiteUrl

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPLabel

SYNOPSIS

Sets a retention label on the specified list or library. Use Reset-PnPLabel to remove the label again.

SYNTAX

Set-PnPLabel -List <ListPipeBind>
             -Label <String>
             [-SyncToItems <Boolean>]
             [-BlockDeletion <Boolean>]
             [-BlockEdit <Boolean>]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

DESCRIPTION

Allows setting a retention label on a list or library and its items. Does not work for sensitivity labels.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPLabel -List "Demo List" -Label "Project Documentation"

This sets an O365 label on the specified list or library.

——————EXAMPLE 2——————

Set-PnPLabel -List "Demo List" -Label "Project Documentation" -SyncToItems $true

This sets an O365 label on the specified list or library and sets the label to all the items in the list and library as well.

——————EXAMPLE 3——————

Set-PnPLabel -List "Demo List" -Label "Project Documentation" -BlockDelete $true -BlockEdit $true

This sets an O365 label on the specified list or library. Next, it also blocks the ability to either edit or delete the item.

PARAMETERS

-BlockDeletion

Block deletion of items in the library

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-BlockEdit

Block editing of items in the library

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Label

The name of the retention label

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-List

The ID or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-SyncToItems

Apply label to existing items in the library

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPList

SYNOPSIS

Updates list settings

SYNTAX

Set-PnPList -Identity <ListPipeBind>
            [-EnableContentTypes <Boolean>]
            [-BreakRoleInheritance [<SwitchParameter>]]
            [-ResetRoleInheritance [<SwitchParameter>]]
            [-CopyRoleAssignments [<SwitchParameter>]]
            [-ClearSubscopes [<SwitchParameter>]]
            [-Title <String>]
            [-Description <String>]
            [-Hidden <Boolean>]
            [-ForceCheckout <Boolean>]
            [-ListExperience <ListExperience>]
            [-EnableAttachments <Boolean>]
            [-EnableFolderCreation <Boolean>]
            [-EnableVersioning <Boolean>]
            [-EnableMinorVersions <Boolean>]
            [-MajorVersions <UInt32>]
            [-MinorVersions <UInt32>]
            [-EnableModeration <Boolean>]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPList -Identity "Demo List" -EnableContentTypes $true

Switches the Enable Content Type switch on the list

——————EXAMPLE 2——————

Set-PnPList -Identity "Demo List" -Hidden $true

Hides the list from the SharePoint UI.

——————EXAMPLE 3——————

Set-PnPList -Identity "Demo List" -EnableVersioning $true

Turns on major versions on a list

——————EXAMPLE 4——————

Set-PnPList -Identity "Demo List" -EnableVersioning $true -MajorVersions 20

Turns on major versions on a list and sets the maximum number of Major Versions to keep to 20.

——————EXAMPLE 5——————

Set-PnPList -Identity "Demo Library" -EnableVersioning $true -EnableMinorVersions $true -MajorVersions 20 -MinorVersions 5

Turns on major versions on a document library and sets the maximum number of Major versions to keep to 20 and sets the maximum of Minor versions to 5.

——————EXAMPLE 6——————

Set-PnPList -Identity "Demo List" -EnableAttachments $true

Turns on attachments on a list

PARAMETERS

-BreakRoleInheritance

If used the security inheritance is broken for this list

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ClearSubscopes

If used the unique permissions are cleared from child objects and they can inherit role assignments from this object

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CopyRoleAssignments

If used the roles are copied from the parent web

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The description of the list

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableAttachments

Enable or disable attachments. Set to $true to enable, $false to disable.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableContentTypes

Set to $true to enable content types, set to $false to disable content types

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableFolderCreation

Enable or disable folder creation. Set to $true to enable, $false to disable.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableMinorVersions

Enable or disable minor versions versioning. Set to $true to enable, $false to disable.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableModeration

Enable or disable whether content approval is enabled for the list. Set to $true to enable, $false to disable.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableVersioning

Enable or disable versioning. Set to $true to enable, $false to disable.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ForceCheckout

Enable or disable force checkout. Set to $true to enable, $false to disable.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Hidden

Hide the list from the SharePoint UI. Set to $true to hide, $false to show.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The ID, Title or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ListExperience

Set the list experience: Auto, NewExperience or ClassicExperience

Only applicable to: SharePoint Online

Type: ListExperience
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-MajorVersions

Maximum major versions to keep

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-MinorVersions

Maximum minor versions to keep

Type: UInt32
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ResetRoleInheritance

If used the security inheritance is reset for this list (inherited from parent)

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

The title of the list

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPListInformationRightsManagement

SYNOPSIS

Get the site closure status of the site which has a site policy applied

SYNTAX

Set-PnPListInformationRightsManagement -List <ListPipeBind>
                                       [-Enable <Boolean>]
                                       [-EnableExpiration <Boolean>]
                                       [-EnableRejection <Boolean>]
                                       [-AllowPrint <Boolean>]
                                       [-AllowScript <Boolean>]
                                       [-AllowWriteCopy <Boolean>]
                                       [-DisableDocumentBrowserView <Boolean>]
                                       [-DocumentAccessExpireDays <Int>]
                                       [-DocumentLibraryProtectionExpireDate <DateTime>]
                                       [-EnableDocumentAccessExpire <Boolean>]
                                       [-EnableDocumentBrowserPublishingView <Boolean>]
                                       [-EnableGroupProtection <Boolean>]
                                       [-EnableLicenseCacheExpire <Boolean>]
                                       [-LicenseCacheExpireDays <Int>]
                                       [-GroupName <String>]
                                       [-PolicyDescription <String>]
                                       [-PolicyTitle <String>]
                                       [-TemplateId <String>]
                                       [-Web <WebPipeBind>]
                                       [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPListInformationRightsManagement -List "Documents" -Enabled $true

Enables Information Rights Management (IRM) on the list.

PARAMETERS

-AllowPrint

Sets a value indicating whether the viewer can print the downloaded document.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-AllowScript

Sets a value indicating whether the viewer can run a script on the downloaded document.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-AllowWriteCopy

Sets a value indicating whether the viewer can write on a copy of the downloaded document.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisableDocumentBrowserView

Sets a value indicating whether to block Office Web Application Companion applications (WACs) from showing this document.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DocumentAccessExpireDays

Sets the number of days after which the downloaded document will expire.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DocumentLibraryProtectionExpireDate

Sets the date after which the Information Rights Management (IRM) protection of this document library will stop.

Type: DateTime
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Enable

Specifies whether Information Rights Management (IRM) is enabled for the list.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableDocumentAccessExpire

Sets a value indicating whether the downloaded document will expire.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableDocumentBrowserPublishingView

Sets a value indicating whether to enable Office Web Application Companion applications (WACs) to publishing view.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableExpiration

Specifies whether Information Rights Management (IRM) expiration is enabled for the list.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableGroupProtection

Sets a value indicating whether the permission of the downloaded document is applicable to a group.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableLicenseCacheExpire

Sets whether a user must verify their credentials after some interval.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableRejection

Specifies whether Information Rights Management (IRM) rejection is enabled for the list.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-GroupName

Sets the group name (email address) that the permission is also applicable to.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LicenseCacheExpireDays

Sets the number of days that the application that opens the document caches the IRM license. When these elapse, the application will connect to the IRM server to validate the license.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

The list to set Information Rights Management (IRM) settings for.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-PolicyDescription

Sets the permission policy description.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PolicyTitle

Sets the permission policy title.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateId

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPListItem

SYNOPSIS

Updates a list item

SYNTAX

Set-PnPListItem -List <ListPipeBind>
                -Identity <ListItemPipeBind>
                [-ContentType <ContentTypePipeBind>]
                [-Values <Hashtable>]
                [-SystemUpdate [<SwitchParameter>]]
                [-Label <String>]
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPListItem -List "Demo List" -Identity 1 -Values @{"Title" = "Test Title"; "Category"="Test Category"}

Sets fields value in the list item with ID 1 in the “Demo List”. It sets both the Title and Category fields with the specified values. Notice, use the internal names of fields.

——————EXAMPLE 2——————

Set-PnPListItem -List "Demo List" -Identity 1 -ContentType "Company" -Values @{"Title" = "Test Title"; "Category"="Test Category"}

Sets fields value in the list item with ID 1 in the “Demo List”. It sets the content type of the item to “Company” and it sets both the Title and Category fields with the specified values. Notice, use the internal names of fields.

——————EXAMPLE 3——————

Set-PnPListItem -List "Demo List" -Identity $item -Values @{"Title" = "Test Title"; "Category"="Test Category"}

Sets fields value in the list item which has been retrieved by for instance Get-PnPListItem. It sets the content type of the item to “Company” and it sets both the Title and Category fields with the specified values. Notice, use the internal names of fields.

——————EXAMPLE 4——————

Set-PnPListItem -List "Demo List" -Identity 1 -Label "Public"

Sets the retention label in the list item with ID 1 in the “Demo List”.

PARAMETERS

-ContentType

Specify either the name, ID or an actual content type

Type: ContentTypePipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The ID of the listitem, or actual ListItem object

Type: ListItemPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Label

The name of the retention label.

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

The ID, Title or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-SystemUpdate

Update the item without creating a new version.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Values

Use the internal names of the fields when specifying field names.

Single line of text: -Values @{“TextField” = “Title New”}

Multiple lines of text: -Values @{“MultiTextField” = “New text\n\nMore text”}

Rich text: -Values @{“MultiTextField” = “<strong>New</strong> text”}

Choice: -Values @{“ChoiceField” = “Value 1”}

Number: -Values @{“NumberField” = “10”}

Currency: -Values @{“NumberField” = “10”}

Currency: -Values @{“CurrencyField” = “10”}

Date and Time: -Values @{“DateAndTimeField” = “03/13/2015 14:16”}

Lookup (id of lookup value): -Values @{“LookupField” = “2”}

Multi value lookup (id of lookup values as array 1): -Values @{“MultiLookupField” = “1”,“2”}

Multi value lookup (id of lookup values as array 2): -Values @{“MultiLookupField” = 1,2}

Multi value lookup (id of lookup values as string): -Values @{“MultiLookupField” = “1,2”}

Yes/No: -Values @{“YesNoField” = $false}

Person/Group (id of user/group in Site User Info List or email of the user, separate multiple values with a comma): -Values @{“PersonField” = “user1@domain.com”,“21”}

Managed Metadata (single value with path to term): -Values @{“MetadataField” = “CORPORATE|DEPARTMENTS|FINANCE”}

Managed Metadata (single value with id of term): -Values @{“MetadataField” = “fe40a95b-2144-4fa2-b82a-0b3d0299d818”} with Id of term

Managed Metadata (multiple values with paths to terms): -Values @{“MetadataField” = (“CORPORATE|DEPARTMENTS|FINANCE”,“CORPORATE|DEPARTMENTS|HR”)}

Managed Metadata (multiple values with ids of terms): -Values @{“MetadataField” = (“fe40a95b-2144-4fa2-b82a-0b3d0299d818”,“52d88107-c2a8-4bf0-adfa-04bc2305b593”)}

Hyperlink or Picture: -Values @{“HyperlinkField” = “https://github.com/OfficeDev/, OfficePnp”}

Type: Hashtable
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.ListItem

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPListItemAsRecord

SYNOPSIS

Declares a list item as a record, for more information, see https://docs.microsoft.com/sharepoint/governance/records-management-in-sharepoint-server

SYNTAX

Set-PnPListItemAsRecord -List <ListPipeBind>
                        -Identity <ListItemPipeBind>
                        [-DeclarationDate <DateTime>]
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPListItemAsRecord -List "Documents" -Identity 4

Declares the document in the documents library with id 4 as a record

——————EXAMPLE 2——————

Set-PnPListItemAsRecord -List "Documents" -Identity 4 -DeclarationDate $date

Declares the document in the documents library with id as a record

PARAMETERS

-DeclarationDate

The declaration date

Type: DateTime
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The ID of the listitem, or actual ListItem object

Type: ListItemPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-List

The ID, Title or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPListItemPermission

SYNOPSIS

Sets list item permissions. Use Get-PnPRoleDefinition to retrieve all available roles you can add or remove using this cmdlet.

SYNTAX

Inherit

Set-PnPListItemPermission -List <ListPipeBind>
                          -Identity <ListItemPipeBind>
                          [-InheritPermissions [<SwitchParameter>]]
                          [-SystemUpdate [<SwitchParameter>]]
                          [-Web <WebPipeBind>]
                          [-Connection <PnPConnection>]

Group

Set-PnPListItemPermission -Group <GroupPipeBind>
                          -List <ListPipeBind>
                          -Identity <ListItemPipeBind>
                          [-AddRole <String>]
                          [-RemoveRole <String>]
                          [-ClearExisting [<SwitchParameter>]]
                          [-SystemUpdate [<SwitchParameter>]]
                          [-Web <WebPipeBind>]
                          [-Connection <PnPConnection>]

User

Set-PnPListItemPermission -User <String>
                          -List <ListPipeBind>
                          -Identity <ListItemPipeBind>
                          [-AddRole <String>]
                          [-RemoveRole <String>]
                          [-ClearExisting [<SwitchParameter>]]
                          [-SystemUpdate [<SwitchParameter>]]
                          [-Web <WebPipeBind>]
                          [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPListItemPermission -List 'Documents' -Identity 1 -User 'user@contoso.com' -AddRole 'Contribute'

Adds the ‘Contribute’ permission to the user ‘user@contoso.com’ for listitem with id 1 in the list ‘Documents’

——————EXAMPLE 2——————

Set-PnPListItemPermission -List 'Documents' -Identity 1 -User 'user@contoso.com' -RemoveRole 'Contribute'

Removes the ‘Contribute’ permission to the user ‘user@contoso.com’ for listitem with id 1 in the list ‘Documents’

——————EXAMPLE 3——————

Set-PnPListItemPermission -List 'Documents' -Identity 1 -User 'user@contoso.com' -AddRole 'Contribute' -ClearExisting

Adds the ‘Contribute’ permission to the user ‘user@contoso.com’ for listitem with id 1 in the list ‘Documents’ and removes all other permissions

——————EXAMPLE 4——————

Set-PnPListItemPermission -List 'Documents' -Identity 1 -InheritPermissions

Resets permissions for listitem with id 1 to inherit permissions from the list ‘Documents’

PARAMETERS

-AddRole

The role that must be assigned to the group or user

Type: String
Parameter Sets: User, Group

Required: False
Position: Named
Accept pipeline input: False

-ClearExisting

Clear all existing permissions

Type: SwitchParameter
Parameter Sets: User, Group

Required: False
Position: Named
Accept pipeline input: False

-Group

Type: GroupPipeBind
Parameter Sets: Group

Required: True
Position: Named
Accept pipeline input: False

-Identity

The ID of the listitem, or actual ListItem object

Type: ListItemPipeBind
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: True

-InheritPermissions

Inherit permissions from the list, removing unique permissions

Type: SwitchParameter
Parameter Sets: Inherit

Required: False
Position: Named
Accept pipeline input: False

-List

The ID, Title or Url of the list.

Type: ListPipeBind
Parameter Sets: __AllParameterSets

Required: True
Position: 0
Accept pipeline input: True

-RemoveRole

The role that must be removed from the group or user

Type: String
Parameter Sets: User, Group

Required: False
Position: Named
Accept pipeline input: False

-SystemUpdate

Update the item permissions without creating a new version or triggering MS Flow.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-User

Type: String
Parameter Sets: User

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPListPermission

SYNOPSIS

Sets list permissions

SYNTAX

Group

Set-PnPListPermission -Group <GroupPipeBind>
                      -Identity <ListPipeBind>
                      [-AddRole <String>]
                      [-RemoveRole <String>]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

User

Set-PnPListPermission -User <String>
                      -Identity <ListPipeBind>
                      [-AddRole <String>]
                      [-RemoveRole <String>]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPListPermission -Identity 'Documents' -User 'user@contoso.com' -AddRole 'Contribute'

Adds the ‘Contribute’ permission to the user ‘user@contoso.com’ for the list ‘Documents’

——————EXAMPLE 2——————

Set-PnPListPermission -Identity 'Documents' -User 'user@contoso.com' -RemoveRole 'Contribute'

Removes the ‘Contribute’ permission to the user ‘user@contoso.com’ for the list ‘Documents’

PARAMETERS

-AddRole

The role that must be assigned to the group or user

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Group

Type: GroupPipeBind
Parameter Sets: Group

Required: True
Position: Named
Accept pipeline input: False

-Identity

The ID or Title of the list.

Type: ListPipeBind
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

-RemoveRole

The role that must be removed from the group or user

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-User

Type: String
Parameter Sets: User

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPListRecordDeclaration

SYNOPSIS

The RecordDeclaration parameter supports 4 values:

AlwaysAllowManualDeclaration NeverAllowManualDeclaration UseSiteCollectionDefaults

SYNTAX

Set-PnPListRecordDeclaration -List <ListPipeBind>
                             [-ManualRecordDeclaration <EcmListManualRecordDeclaration>]
                             [-AutoRecordDeclaration <Boolean>]
                             [-Web <WebPipeBind>]
                             [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPListRecordDeclaration -List "Documents" -ManualRecordDeclaration NeverAllowManualDeclaration

Sets the manual record declaration to never allow

——————EXAMPLE 2——————

Set-PnPListRecordDeclaration -List "Documents" -AutoRecordDeclaration $true

Turns on auto record declaration for the list

PARAMETERS

-AutoRecordDeclaration

Defines if you want to set auto record declaration on the list

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

The List to set the manual record declaration settings for

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ManualRecordDeclaration

Defines the manual record declaration setting for the lists

Type: EcmListManualRecordDeclaration
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPMasterPage

SYNOPSIS

Set the masterpage

SYNTAX

Server Relative

Set-PnPMasterPage [-MasterPageServerRelativeUrl <String>]
                  [-CustomMasterPageServerRelativeUrl <String>]
                  [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

Site Relative

Set-PnPMasterPage [-MasterPageSiteRelativeUrl <String>]
                  [-CustomMasterPageSiteRelativeUrl <String>]
                  [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

DESCRIPTION

Sets the default master page of the current web.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPMasterPage -MasterPageServerRelativeUrl /sites/projects/_catalogs/masterpage/oslo.master

Sets the master page based on a server relative URL

——————EXAMPLE 2——————

Set-PnPMasterPage -MasterPageServerRelativeUrl /sites/projects/_catalogs/masterpage/oslo.master -CustomMasterPageServerRelativeUrl /sites/projects/_catalogs/masterpage/oslo.master

Sets the master page and custom master page based on a server relative URL

——————EXAMPLE 3——————

Set-PnPMasterPage -MasterPageSiteRelativeUrl _catalogs/masterpage/oslo.master

Sets the master page based on a site relative URL

——————EXAMPLE 4——————

Set-PnPMasterPage -MasterPageSiteRelativeUrl _catalogs/masterpage/oslo.master -CustomMasterPageSiteRelativeUrl _catalogs/masterpage/oslo.master

Sets the master page and custom master page based on a site relative URL

PARAMETERS

-CustomMasterPageServerRelativeUrl

Specifies the custom Master page URL based on the server relative URL

Type: String
Parameter Sets: Server Relative
Aliases: CustomMasterPageUrl

Required: False
Position: Named
Accept pipeline input: False

-CustomMasterPageSiteRelativeUrl

Specifies the custom Master page URL based on the site relative URL

Type: String
Parameter Sets: Site Relative

Required: False
Position: Named
Accept pipeline input: False

-MasterPageServerRelativeUrl

Specifies the Master page URL based on the server relative URL

Type: String
Parameter Sets: Server Relative
Aliases: MasterPageUrl

Required: False
Position: Named
Accept pipeline input: False

-MasterPageSiteRelativeUrl

Specifies the Master page URL based on the site relative URL

Type: String
Parameter Sets: Site Relative

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPMicrosoft365Group

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Sets Microsoft 365 Group properties

SYNTAX

Set-PnPMicrosoft365Group -Identity <Microsoft365GroupPipeBind>
                         [-DisplayName <String>]
                         [-Description <String>]
                         [-Owners <String[]>]
                         [-Members <String[]>]
                         [-IsPrivate [<SwitchParameter>]]
                         [-GroupLogoPath <String>]
                         [-CreateTeam [<SwitchParameter>]]
                         [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPMicrosoft365Group -Identity $group -DisplayName "My Displayname"

Sets the display name of the group where $group is a Group entity

——————EXAMPLE 2——————

Set-PnPMicrosoft365Group -Identity $groupId -Descriptions "My Description" -DisplayName "My DisplayName"

Sets the display name and description of a group based upon its ID

——————EXAMPLE 3——————

Set-PnPMicrosoft365Group -Identity $group -GroupLogoPath ".\MyLogo.png"

Sets a specific Microsoft 365 Group logo

——————EXAMPLE 4——————

Set-PnPMicrosoft365Group -Identity $group -IsPrivate:$false

Sets a group to be Public if previously Private

——————EXAMPLE 5——————

Set-PnPMicrosoft365Group -Identity $group -Owners demo@contoso.com

Sets demo@contoso.com as owner of the group

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CreateTeam

Creates a Microsoft Teams team associated with created group

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The Description of the group to set

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisplayName

The DisplayName of the group to set

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-GroupLogoPath

The path to the logo file of to set. Logo must be at least 48 pixels wide and may be at most 4 MB in size. Requires Site.ReadWrite.All permissions.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Microsoft 365 Group

Type: Microsoft365GroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-IsPrivate

Makes the group private when selected

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Members

The array UPN values of members to set to the group. Note: Will replace members.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owners

The array UPN values of owners to set to the group. Note: Will replace owners.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and PracticesDocumentation

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPMinimalDownloadStrategy

SYNOPSIS

Activates or deactivates the minimal downloading strategy.

SYNTAX

On

Set-PnPMinimalDownloadStrategy -On [<SwitchParameter>]
                               [-Force [<SwitchParameter>]]
                               [-Web <WebPipeBind>]
                               [-Connection <PnPConnection>]

Off

Set-PnPMinimalDownloadStrategy -Off [<SwitchParameter>]
                               [-Force [<SwitchParameter>]]
                               [-Web <WebPipeBind>]
                               [-Connection <PnPConnection>]

DESCRIPTION

Activates or deactivates the minimal download strategy feature of a site

EXAMPLES

——————EXAMPLE 1——————

Set-PnPMinimalDownloadStrategy -Off

Will deactivate minimal download strategy (MDS) for the current web.

——————EXAMPLE 2——————

Set-PnPMinimalDownloadStrategy -On

Will activate minimal download strategy (MDS) for the current web.

PARAMETERS

-Force

Specifies whether to overwrite (when activating) or continue (when deactivating) an existing feature with the same feature identifier. This parameter is ignored if there are no errors.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Off

Turn minimal download strategy off

Type: SwitchParameter
Parameter Sets: Off

Required: True
Position: Named
Accept pipeline input: False

-On

Turn minimal download strategy on

Type: SwitchParameter
Parameter Sets: On

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPPropertyBagValue

SYNOPSIS

Sets a property bag value

SYNTAX

Folder

Set-PnPPropertyBagValue -Key <String>
                        -Value <String>
                        [-Folder <String>]
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

Web

Set-PnPPropertyBagValue -Key <String>
                        -Value <String>
                        -Indexed [<SwitchParameter>]
                        [-Web <WebPipeBind>]
                        [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPPropertyBagValue -Key MyKey -Value MyValue

This sets or adds a value to the current web property bag

——————EXAMPLE 2——————

Set-PnPPropertyBagValue -Key MyKey -Value MyValue -Folder /

This sets or adds a value to the root folder of the current web

——————EXAMPLE 3——————

Set-PnPPropertyBagValue -Key MyKey -Value MyValue -Folder /MyFolder

This sets or adds a value to the folder MyFolder which is located in the root folder of the current web

PARAMETERS

-Folder

Site relative url of the folder. See examples for use.

Type: String
Parameter Sets: Folder

Required: False
Position: Named
Accept pipeline input: False

-Indexed

Type: SwitchParameter
Parameter Sets: Web

Required: True
Position: Named
Accept pipeline input: False

-Key

Type: String
Parameter Sets: Web, Folder

Required: True
Position: Named
Accept pipeline input: False

-Value

Type: String
Parameter Sets: Web, Folder, 

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPProvisioningTemplateMetadata

SYNOPSIS

Sets metadata of a provisioning template

SYNTAX

Set-PnPProvisioningTemplateMetadata -Path <String>
                                    [-TemplateDisplayName <String>]
                                    [-TemplateImagePreviewUrl <String>]
                                    [-TemplateProperties <Hashtable>]
                                    [-TemplateProviderExtensions <ITemplateProviderExtension[]>]
                                    [-Web <WebPipeBind>]
                                    [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPProvisioningTemplateMetadata -Path template.xml -TemplateDisplayName "DisplayNameValue"

Sets the DisplayName property of a site template in XML format.

——————EXAMPLE 2——————

Set-PnPProvisioningTemplateMetadata -Path template.pnp -TemplateDisplayName "DisplayNameValue"

Sets the DisplayName property of a site template in Office Open XML format.

——————EXAMPLE 3——————

Set-PnPProvisioningTemplateMetadata -Path template.xml -TemplateImagePreviewUrl "Full URL of the Image Preview"

Sets the Url to the preview image of a site template in XML format.

——————EXAMPLE 4——————

Set-PnPProvisioningTemplateMetadata -Path template.pnp -TemplateImagePreviewUrl "Full URL of the Image Preview"

Sets the to the preview image of a site template in Office Open XML format.

——————EXAMPLE 5——————

Set-PnPProvisioningTemplateMetadata -Path template.xml -TemplateProperties @{"Property1" = "Test Value 1"; "Property2"="Test Value 2"}

Sets the property ‘Property1’ to the value ‘Test Value 1’ of a site template in XML format.

——————EXAMPLE 6——————

Set-PnPProvisioningTemplateMetadata -Path template.pnp -TemplateProperties @{"Property1" = "Test Value 1"; "Property2"="Test Value 2"}

Sets the property ‘Property1’ to the value ‘Test Value 1’ of a site template in Office Open XML format.

PARAMETERS

-Path

Path to the xml or pnp file containing the site template.

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-TemplateDisplayName

It can be used to specify the DisplayName of the template file that will be updated.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateImagePreviewUrl

It can be used to specify the ImagePreviewUrl of the template file that will be updated.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateProperties

It can be used to specify custom Properties for the template file that will be updated.

Type: Hashtable
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-TemplateProviderExtensions

Allows you to specify ITemplateProviderExtension to execute while extracting a template.

Type: ITemplateProviderExtension[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPRequestAccessEmails

SYNOPSIS

Sets Request Access Email on a web

SYNTAX

Set-PnPRequestAccessEmails [-Emails <String[]>]
                           [-Disabled [<SwitchParameter>]]
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

DESCRIPTION

Enables or disables access requests to be sent and configures which e-mail address should receive these requests. The web you apply this on must have unique rights.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPRequestAccessEmails -Emails someone@example.com 

This will enable requesting access and send the requests to the provided e-mail address

——————EXAMPLE 2——————

Set-PnPRequestAccessEmails -Disabled

This will disable the ability to request access to the site

——————EXAMPLE 3——————

Set-PnPRequestAccessEmails -Disabled:$false

This will enable the ability to request access to the site and send the requests to the default owners of the site

PARAMETERS

-Disabled

Enables or disables access to be requested

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Emails

Email address to send the access requests to

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPSearchConfiguration

SYNOPSIS

Sets the search configuration

SYNTAX

Config

Set-PnPSearchConfiguration -Configuration <String>
                           [-Scope <SearchConfigurationScope>]
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

Path

Set-PnPSearchConfiguration -Path <String>
                           [-Scope <SearchConfigurationScope>]
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPSearchConfiguration -Configuration $config

Sets the search configuration for the current web

——————EXAMPLE 2——————

Set-PnPSearchConfiguration -Configuration $config -Scope Site

Sets the search configuration for the current site collection

——————EXAMPLE 3——————

Set-PnPSearchConfiguration -Configuration $config -Scope Subscription

Sets the search configuration for the current tenant

——————EXAMPLE 4——————

Set-PnPSearchConfiguration -Path searchconfig.xml -Scope Subscription

Reads the search configuration from the specified XML file and sets it for the current tenant

PARAMETERS

-Configuration

Search configuration string

Type: String
Parameter Sets: Config

Required: True
Position: Named
Accept pipeline input: False

-Path

Path to a search configuration

Type: String
Parameter Sets: Path

Required: True
Position: Named
Accept pipeline input: False

-Scope

Type: SearchConfigurationScope
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPSearchSettings

SYNOPSIS

Sets search settings for a site

SYNTAX

Set-PnPSearchSettings [-SearchBoxInNavBar <SearchBoxInNavBarType>]
                      [-SearchPageUrl <String>]
                      [-SearchScope <SearchScopeType>]
                      [-Scope <SearchSettingsScope>]
                      [-Force [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPSearchSettings -SearchBoxInNavBar Hidden -Scope Site

Hide the suite bar search box on all pages and sites in the site collection

——————EXAMPLE 2——————

Set-PnPSearchSettings -SearchBoxInNavBar Hidden -Scope Web

Hide the suite bar search box on all pages in the current site

——————EXAMPLE 3——————

Set-PnPSearchSettings -SearchPageUrl "https://contoso.sharepoint.com/sites/mysearch/SitePages/search.aspx"

Redirect the suite bar search box in the site to a custom URL

——————EXAMPLE 4——————

Set-PnPSearchSettings -SearchPageUrl ""

Clear the suite bar search box URL and revert to the default behavior

——————EXAMPLE 5——————

Set-PnPSearchSettings -SearchPageUrl "https://contoso.sharepoint.com/sites/mysearch/SitePages/search.aspx" -Scope Site

Redirect classic search to a custom URL

——————EXAMPLE 6——————

Set-PnPSearchSettings -SearchScope Tenant

Set default behavior of the suite bar search box to show tenant wide results instead of site or hub scoped results

——————EXAMPLE 7——————

Set-PnPSearchSettings -SearchScope Hub

Set default behavior of the suite bar search box to show hub results instead of site results on an associated hub site

PARAMETERS

-Force

Do not ask for confirmation.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Scope

Scope to apply the setting to. Possible values: Web (default), Site\r\n\r\nFor a root site, the scope does not matter.

Type: SearchSettingsScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SearchBoxInNavBar

Set the scope of which the suite bar search box shows. Possible values: Inherit, AllPages, ModernOnly, Hidden

Type: SearchBoxInNavBarType
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-SearchPageUrl

Set the URL where the search box should redirect to.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-SearchScope

Set the search scope of the suite bar search box. Possible values: DefaultScope, Tenant, Hub, Site

Type: SearchScopeType
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPSite

SYNOPSIS

Sets Site Collection properties.

SYNTAX

Set Properties

Set-PnPSite [-Classification <String>]
            [-DisableFlows [<SwitchParameter>]]
            [-LogoFilePath <String>]
            [-Sharing <SharingCapabilities>]
            [-StorageMaximumLevel <Int>]
            [-StorageWarningLevel <Int>]
            [-AllowSelfServiceUpgrade [<SwitchParameter>]]
            [-NoScriptSite [<SwitchParameter>]]
            [-Owners <String>]
            [-CommentsOnSitePagesDisabled [<SwitchParameter>]]
            [-DefaultLinkPermission <SharingPermissionType>]
            [-DefaultSharingLinkType <SharingLinkType>]
            [-DisableAppViews <AppViewsPolicy>]
            [-DisableCompanyWideSharingLinks <CompanyWideSharingLinksPolicy>]
            [-DisableSharingForNonOwners [<SwitchParameter>]]
            [-LocaleId <UInt32>]
            [-RestrictedToGeo <RestrictedToRegion>]
            [-SocialBarOnSitePagesDisabled [<SwitchParameter>]]
            [-Identity <String>]
            [-Connection <PnPConnection>]

Set Lock State

Set-PnPSite [-LockState <SiteLockState>]
            [-Wait [<SwitchParameter>]]
            [-Identity <String>]
            [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPSite -Classification "HBI"

Sets the current site classification to HBI

——————EXAMPLE 2——————

Set-PnPSite -Classification $null

Unsets the current site classification

——————EXAMPLE 3——————

Set-PnPSite -DisableFlows

Disables Microsoft Flow for this site, and also hides the Flow button from the ribbon

——————EXAMPLE 4——————

Set-PnPSite -DisableFlows:$false

Enables Microsoft Flow for this site

——————EXAMPLE 5——————

Set-PnPSite -LogoFilePath c:\images\mylogo.png

Sets the logo if the site is a modern team site

PARAMETERS

-AllowSelfServiceUpgrade

Specifies if the site administrator can upgrade the site collection

Type: SwitchParameter
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-Classification

The classification to set

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: String
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-CommentsOnSitePagesDisabled

Specifies if comments on site pages are enabled or disabled

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-DefaultLinkPermission

Specifies the default link permission for the site collection. None - Respect the organization default link permission. View - Sets the default link permission for the site to “view” permissions. Edit - Sets the default link permission for the site to “edit” permissions

Only applicable to: SharePoint Online

Type: SharingPermissionType
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-DefaultSharingLinkType

Specifies the default link type for the site collection. None - Respect the organization default sharing link type. AnonymousAccess - Sets the default sharing link for this site to an Anonymous Access or Anyone link. Internal - Sets the default sharing link for this site to the “organization” link or company shareable link. Direct - Sets the default sharing link for this site to the “Specific people” link

Only applicable to: SharePoint Online

Type: SharingLinkType
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-DisableAppViews

Only applicable to: SharePoint Online

Type: AppViewsPolicy
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

Only applicable to: SharePoint Online

Type: CompanyWideSharingLinksPolicy
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-DisableFlows

Disables Microsoft Flow for this site

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-DisableSharingForNonOwners

Specifies to prevent non-owners from inviting new users to the site

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-Identity

Type: String
Parameter Sets: (All)
Aliases: Url

Required: False
Position: Named
Accept pipeline input: False

-LocaleId

Specifies the language of this site collection.

Type: UInt32
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-LockState

Sets the lockstate of a site

Only applicable to: SharePoint Online

Type: SiteLockState
Parameter Sets: Set Lock State

Required: False
Position: Named
Accept pipeline input: False

-LogoFilePath

Sets the logo of the site if it concerns a modern team site. Provide a full path to a local image file on your disk which you want to use as the site logo. The logo will be uploaded automatically to SharePoint. If you want to set the logo for a classic site, use Set-PnPWeb -SiteLogoUrl.

Only applicable to: SharePoint Online

Type: String
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-NoScriptSite

Specifies if a site allows custom script or not. See https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f for more information.

Type: SwitchParameter
Parameter Sets: Set Properties
Aliases: DenyAndAddCustomizePages

Required: False
Position: Named
Accept pipeline input: False

-Owners

Specifies owner(s) to add as site collection administrators. They will be added as additional site collection administrators. Existing administrators will stay. Can be both users and groups.

Type: String
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-RestrictedToGeo

Specifies the Geo/Region restrictions of this site.

Only applicable to: SharePoint Online

Type: RestrictedToRegion
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-Sharing

Specifies what the sharing capabilities are for the site. Possible values: Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly

Only applicable to: SharePoint Online

Type: SharingCapabilities
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-SocialBarOnSitePagesDisabled

Disables or enables the Social Bar for Site Collection.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-StorageMaximumLevel

Specifies the storage quota for this site collection in megabytes. This value must not exceed the company’s available quota.

Only applicable to: SharePoint Online

Type: Int
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-StorageWarningLevel

Specifies the warning level for the storage quota in megabytes. This value must not exceed the values set for the StorageMaximumLevel parameter

Only applicable to: SharePoint Online

Type: Int
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-Wait

Wait for the operation to complete

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Set Lock State

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPSiteClosure

SYNOPSIS

Opens or closes a site which has a site policy applied

SYNTAX

Set-PnPSiteClosure -State <ClosureState>
                   [-Web <WebPipeBind>]
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPSiteClosure -State Open

This opens a site which has been closed and has a site policy applied.

——————EXAMPLE 2——————

Set-PnPSiteClosure -State Closed

This closes a site which is open and has a site policy applied.

PARAMETERS

-State

The state of the site

Type: ClosureState
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPSiteDesign

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Updates a Site Design on the current tenant.

SYNTAX

Set-PnPSiteDesign -Identity <TenantSiteDesignPipeBind>
                  [-Title <String>]
                  [-SiteScriptIds <GuidPipeBind[]>]
                  [-Description <String>]
                  [-IsDefault [<SwitchParameter>]]
                  [-PreviewImageAltText <String>]
                  [-PreviewImageUrl <String>]
                  [-WebTemplate <SiteWebTemplate>]
                  [-Version <Int>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPSiteDesign -Identity 046e2e76-67ba-46ca-a5f6-8eb418a7821e -Title "My Updated Company Design"

Updates an existing Site Design and sets a new title.

——————EXAMPLE 2——————

$design = Get-PnPSiteDesign -Identity 046e2e76-67ba-46ca-a5f6-8eb418a7821e
Set-PnPSiteDesign -Identity $design -Title "My Updated Company Design"

Updates an existing Site Design and sets a new title.

PARAMETERS

-Description

The description of the site design

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The guid or an object representing the site design

Type: TenantSiteDesignPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-IsDefault

Specifies if the site design is a default site design

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PreviewImageAltText

Sets the text for the preview image

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PreviewImageUrl

Sets the url to the preview image

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SiteScriptIds

An array of guids of site scripts

Type: GuidPipeBind[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

The title of the site design

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Version

Specifies the version of the design

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-WebTemplate

Specifies the type of site to which this design applies

Type: SiteWebTemplate
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPSitePolicy

SYNOPSIS

Sets a site policy

SYNTAX

Set-PnPSitePolicy -Name <String>
                  [-Web <WebPipeBind>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPSitePolicy -Name "Contoso HBI"

This applies a site policy with the name “Contoso HBI” to the current site. The policy needs to be available in the site.

PARAMETERS

-Name

The name of the site policy to apply

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPSiteScript

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Updates an existing Site Script on the current tenant.

SYNTAX

Set-PnPSiteScript -Identity <TenantSiteScriptPipeBind>
                  [-Title <String>]
                  [-Description <String>]
                  [-Content <String>]
                  [-Version <Int>]
                  [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPSiteScript -Identity f1d55d9b-b116-4f54-bc00-164a51e7e47f -Title "My Site Script"

Updates an existing Site Script and changes the title.

——————EXAMPLE 2——————

$script = Get-PnPSiteScript -Identity f1d55d9b-b116-4f54-bc00-164a51e7e47f 
Set-PnPSiteScript -Identity $script -Title "My Site Script"

Updates an existing Site Script and changes the title.

PARAMETERS

-Content

A JSON string containing the site script

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The description of the site script

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The guid or an object representing the site script

Type: TenantSiteScriptPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Title

The title of the site script

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Version

Specifies the version of the site script

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPStorageEntity

SYNOPSIS

Set Storage Entities / Farm Properties in either the tenant scoped app catalog or the site collection app catalog.

SYNTAX

Set-PnPStorageEntity -Key <String>
                     -Value <String>
                     [-Comment <String>]
                     [-Description <String>]
                     [-Scope <StorageEntityScope>]
                     [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPStorageEntity -Key MyKey -Value "MyValue" -Comment "My Comment" -Description "My Description"

Sets an existing or adds a new storage entity / farm property at tenant level.

——————EXAMPLE 2——————

Set-PnPStorageEntity -Scope Site -Key MyKey -Value "MyValue" -Comment "My Comment" -Description "My Description"

Sets an existing or adds a new storage entity site collection level.

PARAMETERS

-Comment

The comment to set.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The description to set.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Key

The key of the value to set.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Scope

Defines the scope of the storage entity. Defaults to Tenant.

Type: StorageEntityScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Value

The value to set.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPTaxonomyFieldValue

SYNOPSIS

Sets a taxonomy term value in a listitem field

SYNTAX

ITEMS

Set-PnPTaxonomyFieldValue -ListItem <ListItem>
                          -InternalFieldName <String>
                          [-Terms <Hashtable>]
                          [-Connection <PnPConnection>]

ITEM

Set-PnPTaxonomyFieldValue -TermId <GuidPipeBind>
                          -ListItem <ListItem>
                          -InternalFieldName <String>
                          [-Label <String>]
                          [-Connection <PnPConnection>]

PATH

Set-PnPTaxonomyFieldValue -TermPath <String>
                          -ListItem <ListItem>
                          -InternalFieldName <String>
                          [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTaxonomyFieldValue -ListItem $item -InternalFieldName 'Department' -TermId 863b832b-6818-4e6a-966d-2d3ee057931c

Sets the field called ‘Department’ to the value of the term with the ID specified

——————EXAMPLE 2——————

Set-PnPTaxonomyFieldValue -ListItem $item -InternalFieldName 'Department' -TermPath 'CORPORATE|DEPARTMENTS|HR'

Sets the field called ‘Department’ to the term called HR which is located in the DEPARTMENTS termset, which in turn is located in the CORPORATE termgroup.

——————EXAMPLE 3——————

Set-PnPTaxonomyFieldValue -ListItem $item -InternalFieldName 'Department' -Terms @{"TermId1"="Label1";"TermId2"="Label2"}

Sets the field called ‘Department’ with multiple terms by ID and label. You can refer to those terms with the {ID:label} token.

PARAMETERS

-InternalFieldName

The internal name of the field

Type: String
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

-Label

The Label value of the term

Type: String
Parameter Sets: ITEM

Required: False
Position: Named
Accept pipeline input: False

-ListItem

The list item to set the field value to

Type: ListItem
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

-TermId

The Id of the Term

Type: GuidPipeBind
Parameter Sets: ITEM

Required: True
Position: Named
Accept pipeline input: False

-TermPath

A path in the form of GROUPLABEL|TERMSETLABEL|TERMLABEL

Type: String
Parameter Sets: PATH

Required: True
Position: Named
Accept pipeline input: False

-Terms

Allows you to specify terms with key value pairs that can be referred to in the template by means of the {id:label} token. See examples on how to use this parameter.

Type: Hashtable
Parameter Sets: ITEMS

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPTeamsChannel

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Updates an existing Teams Channel

SYNTAX

Set-PnPTeamsChannel -Team <TeamsTeamPipeBind>
                    -Identity <TeamsChannelPipeBind>
                    [-DisplayName <String>]
                    [-Description <String>]
                    [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTeamsChannel -Team "MyTeam" -Channel "MyChannel" -DisplayName "My Channel"

Updates the channel called ‘MyChannel’ to have the display name set to ‘My Channel’

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

Changes the description of the specified channel.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisplayName

Changes the display name of the specified channel.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Specify the channel id of the team to retrieve.

Type: TeamsChannelPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Team

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPTeamsTab

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Updates Teams Tab settings

SYNTAX

Set-PnPTeamsTab -Team <TeamsTeamPipeBind>
                -Channel <TeamsChannelPipeBind>
                [-Identity <TeamsTabPipeBind>]
                [-DisplayName <String>]
                [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTeamsTab -Team "MyTeam" -Channel "My Channel" -Identity "Wiki" -DisplayName "Channel Wiki"

Updates the tab named ‘Wiki’ and changes the display name of the tab to ‘Channel Wiki’

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Channel

Specify the channel id of the team to retrieve.

Type: TeamsChannelPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-DisplayName

The new name of the tab.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Identity of the tab.

Type: TeamsTabPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Team

Specify the group id of the team to retrieve.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPTeamsTeam

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Updates an existing Team.

SYNTAX

Set-PnPTeamsTeam -Identity <TeamsTeamPipeBind>
                 [-DisplayName <String>]
                 [-Description <String>]
                 [-Visibility <TeamVisibility>]
                 [-AllowAddRemoveApps <Boolean>]
                 [-AllowChannelMentions <Boolean>]
                 [-AllowCreateUpdateChannels <Boolean>]
                 [-AllowCreateUpdateRemoveConnectors <Boolean>]
                 [-AllowCreateUpdateRemoveTabs <Boolean>]
                 [-AllowCustomMemes <Boolean>]
                 [-AllowDeleteChannels <Boolean>]
                 [-AllowGiphy <Boolean>]
                 [-AllowGuestCreateUpdateChannels <Boolean>]
                 [-AllowGuestDeleteChannels <Boolean>]
                 [-AllowOwnerDeleteMessages <Boolean>]
                 [-AllowStickersAndMemes <Boolean>]
                 [-AllowTeamMentions <Boolean>]
                 [-AllowUserDeleteMessages <Boolean>]
                 [-AllowUserEditMessages <Boolean>]
                 [-GiphyContentRating <TeamGiphyContentRating>]
                 [-ShowInTeamsSearchAndSuggestions <Boolean>]
                 [-Classification <String>]
                 [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTeamsChannel -Team "MyTeam" -DisplayName "My Team"

Updates the team called ‘MyTeam’ to have the display name set to ‘My Team’

PARAMETERS

-AllowAddRemoveApps

Boolean value that determines whether or not members (not only owners) are allowed to add apps to the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowChannelMentions

Boolean value that determines whether or not channels in the team can be @ mentioned so that all users who follow the channel are notified.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowCreateUpdateChannels

Setting that determines whether or not members (and not just owners) are allowed to create channels.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowCreateUpdateRemoveConnectors

Setting that determines whether or not members (and not only owners) can manage connectors in the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowCreateUpdateRemoveTabs

Setting that determines whether or not members (and not only owners) can manage tabs in channels.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowCustomMemes

Setting that determines whether or not members can use the custom memes functionality in teams.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowDeleteChannels

Setting that determines whether or not members (and not only owners) can delete channels in the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowGiphy

Setting that determines whether or not giphy can be used in the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowGuestCreateUpdateChannels

Setting that determines whether or not guests can create channels in the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowGuestDeleteChannels

Setting that determines whether or not guests can delete in the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowOwnerDeleteMessages

Setting that determines whether or not owners can delete messages that they or other members of the team have posted.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowStickersAndMemes

Setting that determines whether stickers and memes usage is allowed in the team.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowTeamMentions

Setting that determines whether the entire team can be @ mentioned (which means that all users will be notified)

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowUserDeleteMessages

Setting that determines whether or not members can delete messages that they have posted.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-AllowUserEditMessages

Setting that determines whether or not users can edit messages that they have posted.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Classification

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Description

Changes the description of the specified team.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisplayName

Changes the display name of the specified team.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-GiphyContentRating

Setting that determines the level of sensitivity of giphy usage that is allowed in the team. Accepted values are “Strict” or “Moderate”

Type: TeamGiphyContentRating
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Identity

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-ShowInTeamsSearchAndSuggestions

Setting that determines whether or not private teams should be searchable from Teams clients for users who do not belong to that team. Set to $false to make those teams not discoverable from Teams clients.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Visibility

Changes the visibility of the specified team.

Type: TeamVisibility
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPTeamsTeamArchivedState

SYNOPSIS

Required Permissions

  • Microsoft Graph API : One of Directory.ReadWrite.All, Group.ReadWrite.All

Sets the archived state of a team.

SYNTAX

Set-PnPTeamsTeamArchivedState -Identity <TeamsTeamPipeBind>
                              -Archived <Boolean>
                              [-SetSiteReadOnlyForMembers <Boolean>]
                              [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTeamsTeamArchivedState -Identity "My Team" -Archived $true

Archives the team as identified.

——————EXAMPLE 2——————

Set-PnPTeamsTeamArchivedState -Identity "My Team" -Archived $false

Unarchives the team as identified.

——————EXAMPLE 3——————

Set-PnPTeamsTeamArchivedState -Identity "My Team" -Archived $true -SetSiteReadOnlyForMembers $true

Archives the team as identified and sets the underlying SharePoint Online Site Collection as read only for members

PARAMETERS

-Archived

Type: Boolean
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Specify the name, id or external id of the app.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-SetSiteReadOnlyForMembers

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPTeamsTeamPicture

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Sets the picture of an existing team.

SYNTAX

Set-PnPTeamsTeamPicture -Team <TeamsTeamPipeBind>
                        -Path <String>
                        [-ByPassPermissionCheck [<SwitchParameter>]]

DESCRIPTION

Notice that this cmdlet will immediately return but it can take a few hours before the changes are reflected in Microsoft Teams.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTeamsTeamPicture -Team "MyTeam" -Path "c:\myimage.jpg"

Updates the channel called ‘MyChannel’ to have the display name set to ‘My Channel’

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Path

The path to the image file.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Team

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPTenant

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Sets organization-level site collection properties

SYNTAX

Set-PnPTenant [-MinCompatibilityLevel <Int>]
              [-MaxCompatibilityLevel <Int>]
              [-ExternalServicesEnabled <Boolean>]
              [-NoAccessRedirectUrl <String>]
              [-SharingCapability <SharingCapabilities>]
              [-DisplayStartASiteOption <Boolean>]
              [-StartASiteFormUrl <String>]
              [-ShowEveryoneClaim <Boolean>]
              [-ShowAllUsersClaim <Boolean>]
              [-ShowEveryoneExceptExternalUsersClaim <Boolean>]
              [-SearchResolveExactEmailOrUPN <Boolean>]
              [-OfficeClientADALDisabled <Boolean>]
              [-LegacyAuthProtocolsEnabled <Boolean>]
              [-RequireAcceptingAccountMatchInvitedAccount <Boolean>]
              [-ProvisionSharedWithEveryoneFolder <Boolean>]
              [-SignInAccelerationDomain <String>]
              [-EnableGuestSignInAcceleration <Boolean>]
              [-UsePersistentCookiesForExplorerView <Boolean>]
              [-BccExternalSharingInvitations <Boolean>]
              [-BccExternalSharingInvitationsList <String>]
              [-UserVoiceForFeedbackEnabled <Boolean>]
              [-PublicCdnEnabled <Boolean>]
              [-PublicCdnAllowedFileTypes <String>]
              [-RequireAnonymousLinksExpireInDays <Int>]
              [-SharingAllowedDomainList <String>]
              [-SharingBlockedDomainList <String>]
              [-SharingDomainRestrictionMode <SharingDomainRestrictionModes>]
              [-OneDriveStorageQuota <Int>]
              [-OneDriveForGuestsEnabled <Boolean>]
              [-IPAddressEnforcement <Boolean>]
              [-IPAddressAllowList <String>]
              [-IPAddressWACTokenLifetime <Int>]
              [-UseFindPeopleInPeoplePicker <Boolean>]
              [-DefaultSharingLinkType <SharingLinkType>]
              [-ODBMembersCanShare <SharingState>]
              [-ODBAccessRequests <SharingState>]
              [-PreventExternalUsersFromResharing <Boolean>]
              [-ShowPeoplePickerSuggestionsForGuestUsers <Boolean>]
              [-FileAnonymousLinkType <AnonymousLinkType>]
              [-FolderAnonymousLinkType <AnonymousLinkType>]
              [-NotifyOwnersWhenItemsReshared <Boolean>]
              [-NotifyOwnersWhenInvitationsAccepted <Boolean>]
              [-NotificationsInOneDriveForBusinessEnabled <Boolean>]
              [-NotificationsInSharePointEnabled <Boolean>]
              [-OwnerAnonymousNotification <Boolean>]
              [-CommentsOnSitePagesDisabled <Boolean>]
              [-SocialBarOnSitePagesDisabled <Boolean>]
              [-OrphanedPersonalSitesRetentionPeriod <Int>]
              [-DisallowInfectedFileDownload <Boolean>]
              [-DefaultLinkPermission <SharingPermissionType>]
              [-ConditionalAccessPolicy <SPOConditionalAccessPolicyType>]
              [-AllowDownloadingNonWebViewableFiles <Boolean>]
              [-AllowEditing <Boolean>]
              [-ApplyAppEnforcedRestrictionsToAdHocRecipients <Boolean>]
              [-FilePickerExternalImageSearchEnabled <Boolean>]
              [-EmailAttestationRequired <Boolean>]
              [-EmailAttestationReAuthDays <Int>]
              [-HideDefaultThemes <Boolean>]
              [-DisabledWebPartIds <Guid[]>]
              [-EnableAIPIntegration <Boolean>]
              [-Connection <PnPConnection>]

DESCRIPTION

Sets organization-level site collection properties such as StorageQuota, StorageQuotaAllocated, ResourceQuota, ResourceQuotaAllocated, and SiteCreationMode.

You must have the SharePoint Online admin or Global admin role to run the cmdlet.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTenantSite -Identity https://contoso.sharepoint.com/sites/team1 -LockState NoAccess
Set-PnPTenant -NoAccessRedirectUrl 'http://www.contoso.com'

This example blocks access to https://contoso.sharepoint.com/sites/team1 and redirects traffic to http://www.contoso.com.

——————EXAMPLE 2——————

Set-PnPTenant -ShowEveryoneExceptExternalUsersClaim $false

This example hides the “Everyone Except External Users” claim in People Picker.

——————EXAMPLE 3——————

Set-PnPTenant -ShowAllUsersClaim $false

This example hides the “All Users” claim group in People Picker.

——————EXAMPLE 4——————

Set-PnPTenant -UsePersistentCookiesForExplorerView $true

This example enables the use of special persisted cookie for Open with Explorer.

PARAMETERS

-AllowDownloadingNonWebViewableFiles

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-AllowEditing

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ApplyAppEnforcedRestrictionsToAdHocRecipients

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-BccExternalSharingInvitations

When the feature is enabled, all external sharing invitations that are sent will blind copy the e-mail messages listed in the BccExternalSharingInvitationsList.

The valid values are: False (default) - BCC for external sharing is disabled. True - All external sharing invitations that are sent will blind copy the e-mail messages listed in the BccExternalSharingInvitationsList.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-BccExternalSharingInvitationsList

Specifies a list of e-mail addresses to be BCC’d when the BCC for External Sharing feature is enabled. Multiple addresses can be specified by creating a comma separated list with no spaces.

The valid values are: "" (default) - Blank by default, this will also clear any value that has been set. Single or Multiple e-mail addresses - joe@contoso.com or joe@contoso.com,bob@contoso.com

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CommentsOnSitePagesDisabled

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ConditionalAccessPolicy

Type: SPOConditionalAccessPolicyType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DefaultLinkPermission

Type: SharingPermissionType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DefaultSharingLinkType

Lets administrators choose what type of link appears is selected in the “Get a link” sharing dialog box in OneDrive for Business and SharePoint Online.

For additional information about how to change the default link type, see Change the default link type when users get links for sharing.

Note: Setting this value to “none” will default “get a link” to the most permissive link available (that is, if anonymous links are enabled, the default link will be anonymous access; if they are disabled then the default link will be internal.

The values are: None Direct Internal AnonymousAccess

Type: SharingLinkType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisabledWebPartIds

Guids of out of the box modern web part id’s to hide

Type: Guid[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisallowInfectedFileDownload

Prevents the Download button from being displayed on the Virus Found warning page.

Accepts a value of true (enabled) to hide the Download button or false (disabled) to display the Download button. By default this feature is set to false.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisplayStartASiteOption

Determines whether tenant users see the Start a Site menu option.

The valid values are: True (default) - Tenant users will see the Start a Site menu option. False - Start a Site is hidden from the menu.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EmailAttestationReAuthDays

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EmailAttestationRequired

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableAIPIntegration

Boolean indicating if Azure Information Protection (AIP) should be enabled on the tenant. For more information, see https://docs.microsoft.com/microsoft-365/compliance/sensitivity-labels-sharepoint-onedrive-files#use-powershell-to-enable-support-for-sensitivity-labels

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-EnableGuestSignInAcceleration

Accelerates guest-enabled site collections as well as member-only site collections when the SignInAccelerationDomain parameter is set.

Note: If enabled, your identity provider must be capable of authenticating guest users. If it is not, guest users will be unable to log in and access content that was shared with them.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ExternalServicesEnabled

Enables external services for a tenant. External services are defined as services that are not in the Office 365 datacenters.

The valid values are: True (default) - External services are enabled for the tenant. False - External services that are outside of the Office 365 datacenters cannot interact with SharePoint.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-FileAnonymousLinkType

Type: AnonymousLinkType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-FilePickerExternalImageSearchEnabled

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-FolderAnonymousLinkType

Type: AnonymousLinkType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-HideDefaultThemes

Defines if the default themes are visible or hidden

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IPAddressAllowList

Configures multiple IP addresses or IP address ranges (IPv4 or IPv6).

Use commas to separate multiple IP addresses or IP address ranges. Verify there are no overlapping IP addresses and ensure IP ranges use Classless Inter-Domain Routing (CIDR) notation. For example, 172.16.0.0, 192.168.1.0/27.

Note: The IPAddressAllowList parameter only lets administrators set IP addresses or ranges that are recognized as trusted. To only grant access from these IP addresses or ranges, set the IPAddressEnforcement parameter to $true.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IPAddressEnforcement

Allows access from network locations that are defined by an administrator.

The values are $true and $false. The default value is $false which means the setting is disabled.

Before the IPAddressEnforcement parameter is set, make sure you add a valid IPv4 or IPv6 address to the IPAddressAllowList parameter.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-IPAddressWACTokenLifetime

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-LegacyAuthProtocolsEnabled

By default this value is set to $true.

Setting this parameter prevents Office clients using non-modern authentication protocols from accessing SharePoint Online resources.

A value of $true - Enables Office clients using non-modern authentication protocols(such as, Forms-Based Authentication (FBA) or Identity Client Runtime Library (IDCRL)) to access SharePoint resources.

A value of $false - Prevents Office clients using non-modern authentication protocols from accessing SharePoint Online resources.

Note: This may also prevent third-party apps from accessing SharePoint Online resources.Also, this will also block apps using the SharePointOnlineCredentials class to access SharePoint Online resources.For additional information about SharePointOnlineCredentials, see SharePointOnlineCredentials class.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-MaxCompatibilityLevel

Specifies the upper bound on the compatibility level for new sites.

Type: Int
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-MinCompatibilityLevel

Specifies the lower bound on the compatibility level for new sites.

Type: Int
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-NoAccessRedirectUrl

Specifies the URL of the redirected site for those site collections which have the locked state “NoAccess”

The valid values are: “"(default) - Blank by default, this will also remove or clear any value that has been set. Full URL - Example: https://contoso.sharepoint.com/Pages/Locked.aspx

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-NotificationsInOneDriveForBusinessEnabled

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-NotificationsInSharePointEnabled

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-NotifyOwnersWhenInvitationsAccepted

When this parameter is set to $true and when an external user accepts an invitation to a resource in a user’s OneDrive for Business, the OneDrive for Business owner is notified by e-mail.

For additional information about how to configure notifications for external sharing, see Configure notifications for external sharing for OneDrive for Business.

The values are $true and $false.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-NotifyOwnersWhenItemsReshared

When this parameter is set to $true and another user re-shares a document from a user’s OneDrive for Business, the OneDrive for Business owner is notified by e-mail.

For additional information about how to configure notifications for external sharing, see Configure notifications for external sharing for OneDrive for Business.

The values are $true and $false.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ODBAccessRequests

Lets administrators set policy on access requests and requests to share in OneDrive for Business.

Values:

On- Users without permission to share can trigger sharing requests to the OneDrive for Business owner when they attempt to share. Also, users without permission to a file or folder can trigger access requests to the OneDrive for Business owner when they attempt to access an item they do not have permissions to.

Off- Prevent access requests and requests to share on OneDrive for Business.

Unspecified- Let each OneDrive for Business owner enable or disable access requests and requests to share on their OneDrive.

Type: SharingState
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ODBMembersCanShare

Lets administrators set policy on re-sharing behavior in OneDrive for Business.

Values:

On- Users with edit permissions can re-share.

Off- Only OneDrive for Business owner can share. The value of ODBAccessRequests defines whether a request to share gets sent to the owner.

Unspecified- Let each OneDrive for Business owner enable or disable re-sharing behavior on their OneDrive.

Type: SharingState
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-OfficeClientADALDisabled

When set to true this will disable the ability to use Modern Authentication that leverages ADAL across the tenant.

The valid values are: False (default) - Modern Authentication is enabled/allowed. True - Modern Authentication via ADAL is disabled.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-OneDriveForGuestsEnabled

Lets OneDrive for Business creation for administrator managed guest users. Administrator managed Guest users use credentials in the resource tenant to access the resources.

The valid values are the following:

$true-Administrator managed Guest users can be given OneDrives, provided needed licenses are assigned.

$false- Administrator managed Guest users can’t be given OneDrives as functionality is turned off.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-OneDriveStorageQuota

Sets a default OneDrive for Business storage quota for the tenant. It will be used for new OneDrive for Business sites created.

A typical use will be to reduce the amount of storage associated with OneDrive for Business to a level below what the License entitles the users. For example, it could be used to set the quota to 10 gigabytes (GB) by default.

If value is set to 0, the parameter will have no effect.

If the value is set larger than the Maximum allowed OneDrive for Business quota, it will have no effect.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-OrphanedPersonalSitesRetentionPeriod

Specifies the number of days after a user’s Active Directory account is deleted that their OneDrive for Business content will be deleted.

The value range is in days, between 30 and 3650. The default value is 30.

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-OwnerAnonymousNotification

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PreventExternalUsersFromResharing

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ProvisionSharedWithEveryoneFolder

Creates a Shared with Everyone folder in every user’s new OneDrive for Business document library.

The valid values are: True (default) - The Shared with Everyone folder is created. False - No folder is created when the site and OneDrive for Business document library is created.

The default behavior of the Shared with Everyone folder changed in August 2015. For additional information about the change, see Provision the Shared with Everyone folder in OneDrive for Business (https://support.office.com/en-us/article/Provision-the-Shared-with-Everyone-folder-in-OneDrive-for-Business-6bb02c91-fd0b-42ba-9457-3921cb6dc5b2?ui=en-US&rs=en-US&ad=US)

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PublicCdnAllowedFileTypes

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PublicCdnEnabled

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RequireAcceptingAccountMatchInvitedAccount

Ensures that an external user can only accept an external sharing invitation with an account matching the invited email address.

Administrators who desire increased control over external collaborators should consider enabling this feature.

Note, this only applies to new external users accepting new sharing invitations. Also, the resource owner must share with an organizational or Microsoft account or the external user will be unable to access the resource.

The valid values are: False (default) - When a document is shared with an external user, bob@contoso.com, it can be accepted by any user with access to the invitation link in the original e-mail. True - User must accept this invitation with bob@contoso.com.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-RequireAnonymousLinksExpireInDays

Specifies all anonymous links that have been created (or will be created) will expire after the set number of days .

To remove the expiration requirement, set the value to zero (0).

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SearchResolveExactEmailOrUPN

Removes the search capability from People Picker. Note, recently resolved names will still appear in the list until browser cache is cleared or expired.

SharePoint Administrators will still be able to use starts with or partial name matching when enabled.

The valid values are: False (default) - Starts with / partial name search functionality is available. True - Disables starts with / partial name search functionality for all SharePoint users, except SharePoint Admins.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SharingAllowedDomainList

Specifies a list of email domains that is allowed for sharing with the external collaborators. Use the space character as the delimiter for entering multiple values. For example, “contoso.com fabrikam.com”.

For additional information about how to restrict a domain sharing, see Restricted Domains Sharing in Office 365 SharePoint Online and OneDrive for Business

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SharingBlockedDomainList

Specifies a list of email domains that is blocked or prohibited for sharing with the external collaborators. Use space character as the delimiter for entering multiple values. For example, “contoso.com fabrikam.com”.

For additional information about how to restrict a domain sharing, see Restricted Domains Sharing in Office 365 SharePoint Online and OneDrive for Business

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SharingCapability

Determines what level of sharing is available for the site.

The valid values are: ExternalUserAndGuestSharing (default) - External user sharing (share by email) and guest link sharing are both enabled. Disabled - External user sharing (share by email) and guest link sharing are both disabled. ExternalUserSharingOnly - External user sharing (share by email) is enabled, but guest link sharing is disabled.

For more information about sharing, see Manage external sharing for your SharePoint online environment (http://office.microsoft.com/en-us/office365-sharepoint-online-enterprise-help/manage-external-sharing-for-your-sharepoint-online-environment-HA102849864.aspx).

Type: SharingCapabilities
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SharingDomainRestrictionMode

Specifies the external sharing mode for domains.

The following values are: None AllowList BlockList

For additional information about how to restrict a domain sharing, see Restricted Domains Sharing in Office 365 SharePoint Online and OneDrive for Business.

Type: SharingDomainRestrictionModes
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ShowAllUsersClaim

Enables the administrator to hide the All Users claim groups in People Picker.

When users share an item with “All Users (x)”, it is accessible to all organization members in the tenant’s Azure Active Directory who have authenticated with via this method. When users share an item with “All Users (x)” it is accessible to all organization members in the tenant that used NTLM to authentication with SharePoint.

Note, the All Users(authenticated) group is equivalent to the Everyone claim, and shows as Everyone.To change this, see - ShowEveryoneClaim.

The valid values are: True(default) - The All Users claim groups are displayed in People Picker. False - The All Users claim groups are hidden in People Picker.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ShowEveryoneClaim

Enables the administrator to hide the Everyone claim in the People Picker. When users share an item with Everyone, it is accessible to all authenticated users in the tenant’s Azure Active Directory, including any active external users who have previously accepted invitations.

Note, that some SharePoint system resources such as templates and pages are required to be shared to Everyone and this type of sharing does not expose any user data or metadata.

The valid values are: True (default) - The Everyone claim group is displayed in People Picker. False - The Everyone claim group is hidden from the People Picker.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ShowEveryoneExceptExternalUsersClaim

Enables the administrator to hide the “Everyone except external users” claim in the People Picker. When users share an item with “Everyone except external users”, it is accessible to all organization members in the tenant’s Azure Active Directory, but not to any users who have previously accepted invitations.

The valid values are: True(default) - The Everyone except external users is displayed in People Picker. False - The Everyone except external users claim is not visible in People Picker.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ShowPeoplePickerSuggestionsForGuestUsers

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SignInAccelerationDomain

Specifies the home realm discovery value to be sent to Azure Active Directory (AAD) during the user sign-in process.

When the organization uses a third-party identity provider, this prevents the user from seeing the Azure Active Directory Home Realm Discovery web page and ensures the user only sees their company’s Identity Provider’s portal. This value can also be used with Azure Active Directory Premium to customize the Azure Active Directory login page.

Acceleration will not occur on site collections that are shared externally.

This value should be configured with the login domain that is used by your company (that is, example@contoso.com).

If your company has multiple third-party identity providers, configuring the sign-in acceleration value will break sign-in for your organization.

The valid values are: "” (default) - Blank by default, this will also remove or clear any value that has been set. Login Domain - For example: “contoso.com”

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SocialBarOnSitePagesDisabled

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-StartASiteFormUrl

Specifies URL of the form to load in the Start a Site dialog.

The valid values are: "" (default) - Blank by default, this will also remove or clear any value that has been set. Full URL - Example: “https://contoso.sharepoint.com/path/to/form"

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-UseFindPeopleInPeoplePicker

Note: When set to $true, users aren’t able to share with security groups or SharePoint groups.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-UsePersistentCookiesForExplorerView

Lets SharePoint issue a special cookie that will allow this feature to work even when “Keep Me Signed In” is not selected.

“Open with Explorer” requires persisted cookies to operate correctly. When the user does not select “Keep Me Signed in” at the time of sign -in, “Open with Explorer” will fail.

This special cookie expires after 30 minutes and cannot be cleared by closing the browser or signing out of SharePoint Online.To clear this cookie, the user must log out of their Windows session.

The valid values are: False(default) - No special cookie is generated and the normal Office 365 sign -in length / timing applies. True - Generates a special cookie that will allow “Open with Explorer” to function if the “Keep Me Signed In” box is not checked at sign -in.

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-UserVoiceForFeedbackEnabled

Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPTenantAppCatalogUrl

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Sets the url of the tenant scoped app catalog

SYNTAX

Set-PnPTenantAppCatalogUrl -Url <String>
                           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTenantAppCatalogUrl -Url https://yourtenant.sharepoint.com/sites/appcatalog

Sets the tenant scoped app catalog to the provided site collection url

PARAMETERS

-Url

The url of the site to set as the tenant scoped app catalog

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPTenantCdnEnabled

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Enables or disabled the public or private Office 365 Content Delivery Network (CDN).

SYNTAX

Set-PnPTenantCdnEnabled -Enable <Boolean>
                        -CdnType <CdnType>
                        [-Connection <PnPConnection>]

DESCRIPTION

Enables or disabled the public or private Office 365 Content Delivery Network (CDN).

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTenantCdnEnabled -CdnType Public -Enable $true

This example sets the Public CDN enabled.

PARAMETERS

-CdnType

The type of cdn to enable or disable

Type: CdnType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Enable

Specify to enable or disable

Type: Boolean
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPTenantCdnPolicy

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Sets the CDN Policies for the specified CDN (Public | Private).

SYNTAX

Set-PnPTenantCdnPolicy -CdnType <SPOTenantCdnType>
                       -PolicyType <SPOTenantCdnPolicyType>
                       -PolicyValue <String>
                       [-Connection <PnPConnection>]

DESCRIPTION

Sets the CDN Policies for the specified CDN (Public | Private).

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTenantCdnPolicy -CdnType Public -PolicyType IncludeFileExtensions -PolicyValue "CSS,EOT,GIF,ICO,JPEG,JPG,JS,MAP,PNG,SVG,TTF,WOFF"

This example sets the IncludeFileExtensions policy to the specified value.

PARAMETERS

-CdnType

The type of cdn to retrieve the policies from

Type: SPOTenantCdnType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-PolicyType

The type of the policy to set

Type: SPOTenantCdnPolicyType
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-PolicyValue

The value of the policy to set

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPTenantSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Updates settings of a site collection

SYNTAX

Set Properties

Set-PnPTenantSite -Url <String>
                  [-Title <String>]
                  [-LocaleId <UInt32>]
                  [-AllowSelfServiceUpgrade [<SwitchParameter>]]
                  [-Owners <String>]
                  [-DenyAddAndCustomizePages [<SwitchParameter>]]
                  [-SharingCapability <SharingCapabilities>]
                  [-StorageMaximumLevel <Int>]
                  [-StorageWarningLevel <Int>]
                  [-DefaultLinkPermission <SharingPermissionType>]
                  [-DefaultSharingLinkType <SharingLinkType>]
                  [-SharingAllowedDomainList <String>]
                  [-SharingBlockedDomainList <String>]
                  [-BlockDownloadOfNonViewableFiles [<SwitchParameter>]]
                  [-SharingDomainRestrictionMode <SharingDomainRestrictionModes>]
                  [-CommentsOnSitePagesDisabled [<SwitchParameter>]]
                  [-DisableAppViews <AppViewsPolicy>]
                  [-DisableCompanyWideSharingLinks <CompanyWideSharingLinksPolicy>]
                  [-DisableFlows <FlowsPolicy>]
                  [-Wait [<SwitchParameter>]]
                  [-Connection <PnPConnection>]

Set Lock State

Set-PnPTenantSite -Url <String>
                  [-LockState <SiteLockState>]
                  [-Wait [<SwitchParameter>]]
                  [-Connection <PnPConnection>]

DESCRIPTION

Allows settings of a site collection to be updated

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTenantSite -Url https://contoso.sharepoint.com -Title "Contoso Website" -Sharing Disabled

This will set the title of the site collection with the URL ‘https://contoso.sharepoint.com’ to ‘Contoso Website’ and disable sharing on this site collection.

——————EXAMPLE 2——————

Set-PnPTenantSite -Url https://contoso.sharepoint.com -Title "Contoso Website" -StorageWarningLevel 8000 -StorageMaximumLevel 10000

This will set the title of the site collection with the URL ‘https://contoso.sharepoint.com’ to ‘Contoso Website’, set the storage warning level to 8GB and set the storage maximum level to 10GB.

——————EXAMPLE 3——————

Set-PnPTenantSite -Url https://contoso.sharepoint.com/sites/sales -Owners "user@contoso.onmicrosoft.com"

This will add user@contoso.onmicrosoft.com as an additional site collection owner at ‘https://contoso.sharepoint.com/sites/sales'.

——————EXAMPLE 4——————

Set-PnPTenantSite -Url https://contoso.sharepoint.com/sites/sales -Owners @("user1@contoso.onmicrosoft.com", "user2@contoso.onmicrosoft.com")

This will add user1@contoso.onmicrosoft.com and user2@contoso.onmicrosoft.com as additional site collection owners at ‘https://contoso.sharepoint.com/sites/sales'.

——————EXAMPLE 5——————

Set-PnPTenantSite -Url https://contoso.sharepoint.com/sites/sales -NoScriptSite:$false

This will enable script support for the site ‘https://contoso.sharepoint.com/sites/sales' if disabled.

PARAMETERS

-AllowSelfServiceUpgrade

Specifies if the site administrator can upgrade the site collection

Type: SwitchParameter
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-BlockDownloadOfNonViewableFiles

Specifies if non web viewable files can be downloaded.

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-CommentsOnSitePagesDisabled

Specifies if comments on site pages are enabled

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-DefaultLinkPermission

Specifies the default link permission for the site collection. None - Respect the organization default link permission. View - Sets the default link permission for the site to “view” permissions. Edit - Sets the default link permission for the site to “edit” permissions

Only applicable to: SharePoint Online

Type: SharingPermissionType
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-DefaultSharingLinkType

Specifies the default link type for the site collection. None - Respect the organization default sharing link type. AnonymousAccess - Sets the default sharing link for this site to an Anonymous Access or Anyone link. Internal - Sets the default sharing link for this site to the “organization” link or company shareable link. Direct - Sets the default sharing link for this site to the “Specific people” link

Only applicable to: SharePoint Online

Type: SharingLinkType
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-DenyAddAndCustomizePages

Determines whether the Add And Customize Pages right is denied on the site collection. For more information about permission levels, see User permissions and permission levels in SharePoint.

Type: SwitchParameter
Parameter Sets: Set Properties
Aliases: NoScriptSite

Required: False
Position: Named
Accept pipeline input: False

-DisableAppViews

-

Only applicable to: SharePoint Online

Type: AppViewsPolicy
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-

Only applicable to: SharePoint Online

Type: CompanyWideSharingLinksPolicy
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-DisableFlows

-

Only applicable to: SharePoint Online

Type: FlowsPolicy
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-LocaleId

Specifies the language of this site collection. For more information, see Locale IDs supported by SharePoint at https://github.com/pnp/PnP-PowerShell/wiki/Supported-LCIDs-by-SharePoint. To get the list of supported languages on a SharePoint environment use: (Get-PnPWeb -Includes RegionalSettings.InstalledLanguages).RegionalSettings.InstalledLanguages.

Type: UInt32
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-LockState

Sets the lockstate of a site

Only applicable to: SharePoint Online

Type: SiteLockState
Parameter Sets: Set Lock State

Required: False
Position: Named
Accept pipeline input: False

-Owners

Specifies owner(s) to add as site collection administrators. They will be added as additional site collection administrators. Existing administrators will stay. Can be both users and groups.

Type: String
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-SharingAllowedDomainList

Specifies a list of email domains that is allowed for sharing with the external collaborators. Use the space character as the delimiter for entering multiple values. For example, “contoso.com fabrikam.com”.

Only applicable to: SharePoint Online

Type: String
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-SharingBlockedDomainList

Specifies a list of email domains that is blocked for sharing with the external collaborators. Use the space character as the delimiter for entering multiple values. For example, “contoso.com fabrikam.com”.

Only applicable to: SharePoint Online

Type: String
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-SharingCapability

Specifies what the sharing capabilities are for the site. Possible values: Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly

Only applicable to: SharePoint Online

Type: SharingCapabilities
Parameter Sets: Set Properties
Aliases: Sharing

Required: False
Position: Named
Accept pipeline input: False

-SharingDomainRestrictionMode

Specifies the external sharing mode for domains.

Only applicable to: SharePoint Online

Type: SharingDomainRestrictionModes
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-StorageMaximumLevel

Specifies the storage quota for this site collection in megabytes. This value must not exceed the company’s available quota.

Only applicable to: SharePoint Online

Type: Int
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-StorageWarningLevel

Specifies the warning level for the storage quota in megabytes. This value must not exceed the values set for the StorageMaximumLevel parameter

Only applicable to: SharePoint Online

Type: Int
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-Title

Specifies the title of the site

Type: String
Parameter Sets: Set Properties

Required: False
Position: Named
Accept pipeline input: False

-Url

Specifies the URL of the site

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Wait

Wait for the operation to complete

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPTenantSyncClientRestriction

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Sets organization-level sync client restriction properties

SYNTAX

Set-PnPTenantSyncClientRestriction [-BlockMacSync [<SwitchParameter>]]
                                   [-DisableReportProblemDialog [<SwitchParameter>]]
                                   [-DomainGuids <Guid>]
                                   [-Enable [<SwitchParameter>]]
                                   [-ExcludedFileExtensions <String>]
                                   [-GrooveBlockOption <GrooveBlockOption>]
                                   [-Connection <PnPConnection>]

DESCRIPTION

Sets organization-level sync client restriction properties such as BlockMacSync, OptOutOfGroveBlock, and DisableReportProblemDialog.

You must have the SharePoint Online admin or Global admin role to run the cmdlet.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTenantSyncClientRestriction -BlockMacSync:$false

This example blocks access to Mac sync clients for OneDrive file synchronization

——————EXAMPLE 2——————

Set-SPOTenantSyncClientRestriction  -ExcludedFileExtensions "pptx;docx;xlsx"

This example blocks syncing of PowerPoint, Word, and Excel file types using the new sync client (OneDrive.exe).

PARAMETERS

-BlockMacSync

Block Mac sync clients– the Beta version and the new sync client (OneDrive.exe). The values for this parameter are $true and $false. The default value is $false.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisableReportProblemDialog

Specifies if the Report Problem Dialog is disabled or not.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DomainGuids

Sets the domain GUID to add to the safe recipient list. Requires a minimum of 1 domain GUID. The maximum number of domain GUIDs allowed are 125. I.e. 634c71f6-fa83-429c-b77b-0dba3cb70b93,4fbc735f-0ac2-48ba-b035-b1ae3a480887.

Type: Guid
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Enable

Enables the feature to block sync originating from domains that are not present in the safe recipients list.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ExcludedFileExtensions

Blocks certain file types from syncing with the new sync client (OneDrive.exe). Provide as one string separating the extensions using a semicolon (;). I.e. “docx;pptx”

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-GrooveBlockOption

Controls whether or not a tenant’s users can sync OneDrive for Business libraries with the old OneDrive for Business sync client. The valid values are OptOut, HardOptin, and SoftOptin.

Type: GrooveBlockOption
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPTheme

SYNOPSIS

Sets the theme of the current web.

SYNTAX

Set-PnPTheme [-ColorPaletteUrl <String>]
             [-FontSchemeUrl <String>]
             [-BackgroundImageUrl <String>]
             [-ResetSubwebsToInherit [<SwitchParameter>]]
             [-UpdateRootWebOnly [<SwitchParameter>]]
             [-Web <WebPipeBind>]
             [-Connection <PnPConnection>]

DESCRIPTION

Sets the theme of the current web, if any of the attributes is not set, that value will be set to null

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTheme

Removes the current theme and resets it to the default.

——————EXAMPLE 2——————

Set-PnPTheme -ColorPaletteUrl _catalogs/theme/15/company.spcolor

——————EXAMPLE 3——————

Set-PnPTheme -ColorPaletteUrl _catalogs/theme/15/company.spcolor -BackgroundImageUrl 'style library/background.png'

——————EXAMPLE 4——————

Set-PnPTheme -ColorPaletteUrl _catalogs/theme/15/company.spcolor -BackgroundImageUrl 'style library/background.png' -ResetSubwebsToInherit

Sets the theme to the web, and updates all subwebs to inherit the theme from this web.

PARAMETERS

-BackgroundImageUrl

Specifies the Background Image Url based on the site or server relative url

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ColorPaletteUrl

Specifies the Color Palette Url based on the site or server relative url

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-FontSchemeUrl

Specifies the Font Scheme Url based on the site or server relative url

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-ResetSubwebsToInherit

Resets subwebs to inherit the theme from the rootweb

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-UpdateRootWebOnly

Updates only the rootweb, even if subwebs are set to inherit the theme.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPTraceLog

SYNOPSIS

Turn log tracing on or off

SYNTAX

On

Set-PnPTraceLog -On [<SwitchParameter>]
                [-LogFile <String>]
                [-WriteToConsole [<SwitchParameter>]]
                [-Level <LogLevel>]
                [-Delimiter <String>]
                [-IndentSize <Int>]
                [-AutoFlush <Boolean>]

Off

Set-PnPTraceLog -Off [<SwitchParameter>]

DESCRIPTION

Defines if tracing should be turned on. PnP Core, which is the foundation of these cmdlets, uses the standard Trace functionality of .NET. With this cmdlet you can turn capturing of this trace to a log file on or off. Notice that basically only the Provisioning Engine writes to the tracelog which means that cmdlets related to the engine will produce output.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPTraceLog -On -LogFile traceoutput.txt

This turns on trace logging to the file ‘traceoutput.txt’ and will capture events of at least ‘Information’ level.

——————EXAMPLE 2——————

Set-PnPTraceLog -On -LogFile traceoutput.txt -Level Debug

This turns on trace logging to the file ‘traceoutput.txt’ and will capture debug events.

——————EXAMPLE 3——————

Set-PnPTraceLog -On -LogFile traceoutput.txt -Level Debug -Delimiter ","

This turns on trace logging to the file ‘traceoutput.txt’ and will write the entries as comma separated. Debug events are captured.

——————EXAMPLE 4——————

Set-PnPTraceLog -Off

This turns off trace logging. It will flush any remaining messages to the log file.

PARAMETERS

-AutoFlush

Auto flush the trace log. Defaults to true.

Type: Boolean
Parameter Sets: On

Required: False
Position: Named
Accept pipeline input: False

-Delimiter

If specified the trace log entries will be delimited with this value.

Type: String
Parameter Sets: On

Required: False
Position: Named
Accept pipeline input: False

-IndentSize

Indents in the tracelog will be with this amount of characters. Defaults to 4.

Type: Int
Parameter Sets: On

Required: False
Position: Named
Accept pipeline input: False

-Level

The level of events to capture. Possible values are ‘Debug’, ‘Error’, ‘Warning’, ‘Information’. Defaults to ‘Information’.

Type: LogLevel
Parameter Sets: On

Required: False
Position: Named
Accept pipeline input: False

-LogFile

The path and filename of the file to write the trace log to.

Type: String
Parameter Sets: On

Required: False
Position: Named
Accept pipeline input: False

-Off

Turn off tracing to log file.

Type: SwitchParameter
Parameter Sets: Off

Required: True
Position: Named
Accept pipeline input: False

-On

Turn on tracing to log file

Type: SwitchParameter
Parameter Sets: On

Required: True
Position: Named
Accept pipeline input: False

-WriteToConsole

Turn on console trace output.

Type: SwitchParameter
Parameter Sets: On

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPUnifiedGroup

SYNOPSIS

Sets Office 365 Group (aka Unified Group) properties. Requires the Azure Active Directory application permission ‘Group.ReadWrite.All’.

SYNTAX

Set-PnPUnifiedGroup -Identity <UnifiedGroupPipeBind>
                    [-DisplayName <String>]
                    [-Description <String>]
                    [-Owners <String[]>]
                    [-Members <String[]>]
                    [-IsPrivate [<SwitchParameter>]]
                    [-GroupLogoPath <String>]
                    [-CreateTeam [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPUnifiedGroup -Identity $group -DisplayName "My Displayname"

Sets the display name of the group where $group is a Group entity

——————EXAMPLE 2——————

Set-PnPUnifiedGroup -Identity $groupId -Descriptions "My Description" -DisplayName "My DisplayName"

Sets the display name and description of a group based upon its ID

——————EXAMPLE 3——————

Set-PnPUnifiedGroup -Identity $group -GroupLogoPath ".\MyLogo.png"

Sets a specific Office 365 Group logo.

——————EXAMPLE 4——————

Set-PnPUnifiedGroup -Identity $group -IsPrivate:$false

Sets a group to be Public if previously Private.

——————EXAMPLE 5——————

Set-PnPUnifiedGroup -Identity $group -Owners demo@contoso.com

Sets demo@contoso.com as owner of the group.

PARAMETERS

-CreateTeam

Creates a MS Teams team associated with created group.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

The Description of the group to set.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisplayName

The DisplayName of the group to set.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-GroupLogoPath

The path to the logo file of to set.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Identity of the Office 365 Group.

Type: UnifiedGroupPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-IsPrivate

Makes the group private when selected.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Members

The array UPN values of members to set to the group. Note: Will replace members.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Owners

The array UPN values of owners to set to the group. Note: Will replace owners.

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPUserOneDriveQuota

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Sets the quota on the OneDrive for Business site for a specific user

SYNTAX

Set-PnPUserOneDriveQuota -Account <String>
                         -Quota <Int>
                         -QuotaWarning <Int>
                         [-Connection <PnPConnection>]

DESCRIPTION

This command allows you to set the quota on the OneDrive for Business site of a specific user. You must connect to the tenant admin website (https://:-admin.sharepoint.com) with Connect-PnPOnline in order to use this cmdlet.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPUserOneDriveQuota -Account 'user@domain.com' -Quota 5368709120 -QuotaWarning 4831838208

Sets the quota on the OneDrive for Business site for the specified user to 5GB (5368709120 bytes) and sets a warning to be shown at 4.5 GB (4831838208)

PARAMETERS

-Account

The account of the user, formatted either as a login name, or as a claims identity, e.g. i:0#.f|membership|user@domain.com

Only applicable to: SharePoint Online

Type: String
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Quota

The quota to set on the OneDrive for Business site of the user, in bytes

Only applicable to: SharePoint Online

Type: Int
Parameter Sets: (All)

Required: True
Position: 1
Accept pipeline input: False

-QuotaWarning

The quota to set on the OneDrive for Business site of the user when to start showing warnings about the drive nearing being full, in bytes

Only applicable to: SharePoint Online

Type: Int
Parameter Sets: (All)

Required: True
Position: 2
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPUserProfileProperty

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Office365 only: Uses the tenant API to retrieve site information. You must connect to the tenant admin website (https://:-admin.sharepoint.com) with Connect-PnPOnline in order to use this command.

SYNTAX

Single

Set-PnPUserProfileProperty -Value <String>
                           -Account <String>
                           -PropertyName <String>
                           [-Connection <PnPConnection>]

Multi

Set-PnPUserProfileProperty -Values <String[]>
                           -Account <String>
                           -PropertyName <String>
                           [-Connection <PnPConnection>]

DESCRIPTION

Requires a connection to a SharePoint Tenant Admin site.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPUserProfileProperty -Account 'user@domain.com' -Property 'SPS-Location' -Value 'Stockholm'

Sets the SPS-Location property for the user as specified by the Account parameter

——————EXAMPLE 2——————

Set-PnPUserProfileProperty -Account 'user@domain.com' -Property 'MyProperty' -Values 'Value 1','Value 2'

Sets the MyProperty multi value property for the user as specified by the Account parameter

PARAMETERS

-Account

The account of the user, formatted either as a login name, or as a claims identity, e.g. i:0#.f|membership|user@domain.com

Type: String
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

-PropertyName

The property to set, for instance SPS-Skills or SPS-Location

Type: String
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

-Value

The value to set in the case of a single value property

Type: String
Parameter Sets: Single

Required: True
Position: Named
Accept pipeline input: False

-Values

The values set in the case of a multi value property, e.g. “Value 1”,“Value 2”

Type: String[]
Parameter Sets: Multi

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPView

SYNOPSIS

Change view properties

SYNTAX

Set-PnPView -Identity <ViewPipeBind>
            [-List <ListPipeBind>]
            [-Values <Hashtable>]
            [-Fields <String[]>]
            [-Aggregations <String>]
            [-Web <WebPipeBind>]
            [-Connection <PnPConnection>]

DESCRIPTION

Sets one or more properties of an existing view, see here https://docs.microsoft.com/previous-versions/office/sharepoint-server/ee543328(v=office.15) for the list of view properties.

EXAMPLES

——————EXAMPLE 1——————

Set-PnPView -List "Tasks" -Identity "All Tasks" -Values @{JSLink="hierarchytaskslist.js|customrendering.js";Title="My view"}

Updates the “All Tasks” view on list “Tasks” to use hierarchytaskslist.js and customrendering.js for the JSLink and changes the title of the view to “My view”

——————EXAMPLE 2——————

Get-PnPList -Identity "Tasks" | Get-PnPView | Set-PnPView -Values @{JSLink="hierarchytaskslist.js|customrendering.js"}

Updates all views on list “Tasks” to use hierarchytaskslist.js and customrendering.js for the JSLink

——————EXAMPLE 3——————

Set-PnPView -List "Documents" -Identity "Corporate Documents" -Fields "Title","Created"

Updates the Corporate Documents view on the Documents library to have two fields

——————EXAMPLE 4——————

Set-PnPView -List "Documents" -Identity "Corporate Documents" -Fields "Title","Created" -Aggregations "<FieldRef Name='Title' Type='COUNT'/>"

Updates the Corporate Documents view on the Documents library and sets the totals (aggregations) to Count on the Title field

PARAMETERS

-Aggregations

A valid XML fragment containing one or more Aggregations

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Fields

An array of fields to use in the view. Notice that specifying this value will remove the existing fields

Type: String[]
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The Id, Title or instance of the view

Type: ViewPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-List

The Id, Title or Url of the list

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: False

-Values

Hashtable of properties to update on the view. Use the syntax @{property1=“value”;property2=“value”}.

Type: Hashtable
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

Microsoft.SharePoint.Client.Field

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPWeb

SYNOPSIS

Sets properties on a web

SYNTAX

Set-PnPWeb [-SiteLogoUrl <String>]
           [-AlternateCssUrl <String>]
           [-Title <String>]
           [-Description <String>]
           [-MasterUrl <String>]
           [-CustomMasterUrl <String>]
           [-QuickLaunchEnabled [<SwitchParameter>]]
           [-MembersCanShare [<SwitchParameter>]]
           [-NoCrawl [<SwitchParameter>]]
           [-HeaderLayout <HeaderLayoutType>]
           [-HeaderEmphasis <SPVariantThemeType>]
           [-NavAudienceTargetingEnabled [<SwitchParameter>]]
           [-MegaMenuEnabled [<SwitchParameter>]]
           [-DisablePowerAutomate [<SwitchParameter>]]
           [-CommentsOnSitePagesDisabled [<SwitchParameter>]]
           [-Web <WebPipeBind>]
           [-Connection <PnPConnection>]

DESCRIPTION

Allows setting various properties on a web

EXAMPLES

——————EXAMPLE 1——————

Set-PnPWeb -CommentsOnSitePagesDisabled:$true

Disables the page comments to be shown below each page in the current web by default

——————EXAMPLE 2——————

Set-PnPWeb -QuickLaunchEnabled:$false

Hides the quick launch from being shown in the current web

——————EXAMPLE 3——————

Set-PnPWeb -NoCrawl:$true

Prevents the current web from being returned in search results

PARAMETERS

-AlternateCssUrl

Sets the AlternateCssUrl of the web. Only works for classic pages.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CommentsOnSitePagesDisabled

Defines if comments on modern site pages should be enabled by default ($false) or they should be hidden ($true)

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-CustomMasterUrl

Sets the CustomMasterUrl of the web. Only works for classic pages.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Description

Sets the description of the web

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-DisablePowerAutomate

Defines if Power Automate should be available on lists and document libraries ($false) or if the option should be hidden ($true)

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-HeaderEmphasis

Only applicable to: SharePoint Online

Type: SPVariantThemeType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-HeaderLayout

Only applicable to: SharePoint Online

Type: HeaderLayoutType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-MasterUrl

Sets the MasterUrl of the web. Only works for classic pages.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-MegaMenuEnabled

Defines if the navigation menu should be shown as the mega menu ($true) or the smaller sized menu ($false)

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-MembersCanShare

Indicates if members of this site can share the site and individual sites with others ($true) or only owners can do this ($false)

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-NavAudienceTargetingEnabled

Defines if the navigation menu on a modern site should be enabled for modern audience targeting ($true) or not ($false)

Only applicable to: SharePoint Online

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-NoCrawl

Indicates if this site should not be returned in search results ($true) or if it should be ($false)

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-QuickLaunchEnabled

Defines if the quick launch menu on the left side of modern Team Sites should be shown ($true) or hidden ($false)

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-SiteLogoUrl

Sets the logo of the web to the current url. If you want to set the logo to a modern team site, use Set-PnPSite -LogoFilePath.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Title

Sets the title of the web

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPWebhookSubscription

SYNOPSIS

Updates a Webhook subscription

SYNTAX

Set-PnPWebhookSubscription -Subscription <WebhookSubscriptionPipeBind>
                           [-List <ListPipeBind>]
                           [-NotificationUrl <String>]
                           [-ExpirationDate <DateTime>]
                           [-Web <WebPipeBind>]
                           [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPWebhookSubscription -List MyList -Subscription ea1533a8-ff03-415b-a7b6-517ee50db8b6 -NotificationUrl https://my-func.azurewebsites.net/webhook

Updates an existing Webhook subscription with the specified id on the list MyList with a new Notification Url

——————EXAMPLE 2——————

Set-PnPWebhookSubscription -List MyList -Subscription ea1533a8-ff03-415b-a7b6-517ee50db8b6 -NotificationUrl https://my-func.azurewebsites.net/webhook -ExpirationDate "2017-09-01"

Updates an existing Webhook subscription with the specified id on the list MyList with a new Notification Url and a new expiration date

——————EXAMPLE 3——————

$subscriptions = Get-PnPWebhookSubscriptions -List MyList
$updated = $subscriptions[0]
$updated.ExpirationDate = "2017-10-01"
Set-PnPWebhookSubscription -List MyList -Subscription $updated

Updates the Webhook subscription from the list MyList with a modified subscription object. Note: The date will be converted to Universal Time

PARAMETERS

-ExpirationDate

The date at which the Webhook subscription will expire. (Default: 6 months from today)

Type: DateTime
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-List

The list object or name from which the Webhook subscription will be modified

Type: ListPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-NotificationUrl

The URL of the Webhook endpoint that will be notified of the change

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Subscription

The identity of the Webhook subscription to update

Type: WebhookSubscriptionPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

OfficeDevPnP.Core.Entities.WebhookSubscription

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPWebPartProperty

SYNOPSIS

Sets a web part property

SYNTAX

Set-PnPWebPartProperty -ServerRelativePageUrl <String>
                       -Identity <GuidPipeBind>
                       -Key <String>
                       -Value <PSObject>
                       [-Web <WebPipeBind>]
                       [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Set-PnPWebPartProperty -ServerRelativePageUrl /sites/demo/sitepages/home.aspx -Identity ccd2c98a-c9ae-483b-ae72-19992d583914 -Key "Title" -Value "New Title" 

Sets the title property of the web part.

PARAMETERS

-Identity

The Guid of the web part

Type: GuidPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Key

Name of a single property to be set

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ServerRelativePageUrl

Full server relative url of the web part page, e.g. /sites/demo/sitepages/home.aspx

Type: String
Parameter Sets: (All)
Aliases: PageUrl

Required: True
Position: Named
Accept pipeline input: False

-Value

Value of the property to be set

Type: PSObject
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPWebPermission

SYNOPSIS

Set permissions

SYNTAX

Group

Set-PnPWebPermission -Group <GroupPipeBind>
                     [-AddRole <String[]>]
                     [-RemoveRole <String[]>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

User

Set-PnPWebPermission -User <String>
                     [-AddRole <String[]>]
                     [-RemoveRole <String[]>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

GroupByWebIdentity

Set-PnPWebPermission -Identity <WebPipeBind>
                     -Group <GroupPipeBind>
                     [-AddRole <String[]>]
                     [-RemoveRole <String[]>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

UserByWebIdentity

Set-PnPWebPermission -Identity <WebPipeBind>
                     -User <String>
                     [-AddRole <String[]>]
                     [-RemoveRole <String[]>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

GroupByWebUrl

Set-PnPWebPermission -Url <String>
                     -Group <GroupPipeBind>
                     [-AddRole <String[]>]
                     [-RemoveRole <String[]>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

UserByWebUrl

Set-PnPWebPermission -Url <String>
                     -User <String>
                     [-AddRole <String[]>]
                     [-RemoveRole <String[]>]
                     [-Web <WebPipeBind>]
                     [-Connection <PnPConnection>]

DESCRIPTION

Sets web permissions

EXAMPLES

——————EXAMPLE 1——————

Set-PnPWebPermission -Url projectA -User 'user@contoso.com' -AddRole 'Contribute'

Adds the ‘Contribute’ permission to the user ‘user@contoso.com’ for a web, specified by its site relative url

——————EXAMPLE 2——————

Set-PnPWebPermission -Identity 5fecaf67-6b9e-4691-a0ff-518fc9839aa0 -User 'user@contoso.com' -RemoveRole 'Contribute'

Removes the ‘Contribute’ permission to the user ‘user@contoso.com’ for a web, specified by its ID

PARAMETERS

-AddRole

The role that must be assigned to the group or user

Type: String[]
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Group

Type: GroupPipeBind
Parameter Sets: Group, GroupByWebIdentity, GroupByWebUrl

Required: True
Position: Named
Accept pipeline input: False

-Identity

Identity/Id/Web object

Type: WebPipeBind
Parameter Sets: GroupByWebIdentity, UserByWebIdentity

Required: True
Position: Named
Accept pipeline input: True

-RemoveRole

The role that must be removed from the group or user

Type: String[]
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Url

The site relative url of the web, e.g. ‘Subweb1’

Type: String
Parameter Sets: GroupByWebUrl, UserByWebUrl

Required: True
Position: Named
Accept pipeline input: False

-User

Type: String
Parameter Sets: User, UserByWebIdentity, UserByWebUrl

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Set-PnPWebTheme

SYNOPSIS

Sets the theme of the current web.

SYNTAX

Set-PnPWebTheme [-Theme <ThemePipeBind>]
                [-WebUrl <String>]
                [-Web <WebPipeBind>]
                [-Connection <PnPConnection>]

DESCRIPTION

Sets the theme of the current web. * Requires Tenant Administration Rights *

EXAMPLES

——————EXAMPLE 1——————

Set-PnPWebTheme -Theme MyTheme

Sets the theme named “MyTheme” to the current web

——————EXAMPLE 2——————

Get-PnPTenantTheme -Name "MyTheme" | Set-PnPWebTheme

Sets the theme named “MyTheme” to the current web

PARAMETERS

-Theme

Specifies the Color Palette Url based on the site or server relative url

Type: ThemePipeBind
Parameter Sets: (All)

Required: False
Position: 0
Accept pipeline input: True

-WebUrl

The URL of the web to apply the theme to. If not specified it will default to the current web based upon the URL specified with Connect-PnPOnline.

Type: String
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Set-PnPWikiPageContent

SYNOPSIS

Sets the contents of a wikipage

SYNTAX

STRING

Set-PnPWikiPageContent -Content <String>
                       -ServerRelativePageUrl <String>
                       [-Web <WebPipeBind>]
                       [-Connection <PnPConnection>]

FILE

Set-PnPWikiPageContent -Path <String>
                       -ServerRelativePageUrl <String>
                       [-Web <WebPipeBind>]
                       [-Connection <PnPConnection>]

PARAMETERS

-Content

Type: String
Parameter Sets: STRING

Required: True
Position: Named
Accept pipeline input: False

-Path

Type: String
Parameter Sets: FILE

Required: True
Position: Named
Accept pipeline input: False

-ServerRelativePageUrl

Site Relative Page Url

Type: String
Parameter Sets: FILE, STRING
Aliases: PageUrl

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Start-PnPWorkflowInstance

SYNOPSIS

Starts a SharePoint 2010/2013 workflow instance on a list item

SYNTAX

Start-PnPWorkflowInstance -Subscription <WorkflowSubscriptionPipeBind>
                          -ListItem <ListItemPipeBind>
                          [-Web <WebPipeBind>]
                          [-Connection <PnPConnection>]

DESCRIPTION

Allows starting a SharePoint 2010/2013 workflow on a list item in a list

EXAMPLES

——————EXAMPLE 1——————

Start-PnPWorkflowInstance -Subscription 'WorkflowName' -ListItem $item

Starts a workflow instance on the specified list item

——————EXAMPLE 2——————

Start-PnPWorkflowInstance -Subscription $subscription -ListItem 2

Starts a workflow instance on the specified list item

PARAMETERS

-ListItem

The list item to start the workflow against

Type: ListItemPipeBind
Parameter Sets: (All)

Required: True
Position: 1
Accept pipeline input: False

-Subscription

The workflow subscription to start

Type: WorkflowSubscriptionPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Stop-PnPWorkflowInstance

SYNOPSIS

Stops a workflow instance

SYNTAX

Stop-PnPWorkflowInstance -Identity <WorkflowInstancePipeBind>
                         [-Force [<SwitchParameter>]]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Stop-PnPWorkflowInstance -identity $wfInstance

Stops the workflow Instance

PARAMETERS

-Force

Forcefully terminate the workflow instead of cancelling. Works on errored and non-responsive workflows. Deletes all created tasks. Does not notify participants.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

The instance to stop

Type: WorkflowInstancePipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Submit-PnPSearchQuery

SYNOPSIS

Executes an arbitrary search query against the SharePoint search index

SYNTAX

Limit

Submit-PnPSearchQuery -Query <String>
                      [-StartRow <Int>]
                      [-MaxResults <Int>]
                      [-TrimDuplicates <Boolean>]
                      [-Properties <Hashtable>]
                      [-Refiners <String>]
                      [-Culture <Int>]
                      [-QueryTemplate <String>]
                      [-SelectProperties <String[]>]
                      [-RefinementFilters <String[]>]
                      [-SortList <Hashtable>]
                      [-RankingModelId <String>]
                      [-ClientType <String>]
                      [-CollapseSpecification <String>]
                      [-HiddenConstraints <String>]
                      [-TimeZoneId <Int>]
                      [-EnablePhonetic <Boolean>]
                      [-EnableStemming <Boolean>]
                      [-EnableQueryRules <Boolean>]
                      [-SourceId <Guid>]
                      [-ProcessBestBets <Boolean>]
                      [-ProcessPersonalFavorites <Boolean>]
                      [-RelevantResults [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

All

Submit-PnPSearchQuery -Query <String>
                      [-All [<SwitchParameter>]]
                      [-TrimDuplicates <Boolean>]
                      [-Properties <Hashtable>]
                      [-Refiners <String>]
                      [-Culture <Int>]
                      [-QueryTemplate <String>]
                      [-SelectProperties <String[]>]
                      [-RefinementFilters <String[]>]
                      [-SortList <Hashtable>]
                      [-RankingModelId <String>]
                      [-ClientType <String>]
                      [-CollapseSpecification <String>]
                      [-HiddenConstraints <String>]
                      [-TimeZoneId <Int>]
                      [-EnablePhonetic <Boolean>]
                      [-EnableStemming <Boolean>]
                      [-EnableQueryRules <Boolean>]
                      [-SourceId <Guid>]
                      [-ProcessBestBets <Boolean>]
                      [-ProcessPersonalFavorites <Boolean>]
                      [-RelevantResults [<SwitchParameter>]]
                      [-Web <WebPipeBind>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Submit-PnPSearchQuery -Query "finance"

Returns the top 500 items with the term finance

——————EXAMPLE 2——————

Submit-PnPSearchQuery -Query "Title:Intranet*" -MaxResults 10

Returns the top 10 items indexed by SharePoint Search of which the title starts with the word Intranet

——————EXAMPLE 3——————

Submit-PnPSearchQuery -Query "Title:Intranet*" -All

Returns absolutely all items indexed by SharePoint Search of which the title starts with the word Intranet

——————EXAMPLE 4——————

Submit-PnPSearchQuery -Query "Title:Intranet*" -Refiners "contentclass,FileType(filter=6/0/*)"

Returns absolutely all items indexed by SharePoint Search of which the title starts with the word Intranet, and return refiners for contentclass and FileType managed properties

PARAMETERS

-All

Automatically page results until the end to get more than 500. Use with caution!

Type: SwitchParameter
Parameter Sets: All

Required: False
Position: Named
Accept pipeline input: False

-ClientType

Specifies the name of the client which issued the query.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-CollapseSpecification

Limit the number of items per the collapse specification. See https://docs.microsoft.com/en-us/sharepoint/dev/general-development/customizing-search-results-in-sharepoint#collapse-similar-search-results-using-the-collapsespecification-property for more information.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Culture

The locale for the query.

Type: Int
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-EnablePhonetic

Specifies whether the phonetic forms of the query terms are used to find matches.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-EnableQueryRules

Specifies whether Query Rules are enabled for this query.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-EnableStemming

Specifies whether stemming is enabled.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-HiddenConstraints

The keyword query’s hidden constraints.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-MaxResults

Maximum amount of search results to return. Default and max per page is 500 search results.

Type: Int
Parameter Sets: Limit

Required: False
Position: Named
Accept pipeline input: False

-ProcessBestBets

Determines whether Best Bets are enabled.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-ProcessPersonalFavorites

Determines whether personal favorites data is processed or not.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Properties

Extra query properties. Can for example be used for Office Graph queries.

Type: Hashtable
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Query

Search query in Keyword Query Language (KQL).

Type: String
Parameter Sets: __AllParameterSets

Required: True
Position: 0
Accept pipeline input: True

-QueryTemplate

Specifies the query template that is used at run time to transform the query based on user input.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-RankingModelId

The identifier (ID) of the ranking model to use for the query.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-RefinementFilters

The set of refinement filters used.

Type: String[]
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Refiners

The list of refiners to be returned in a search result.

Type: String
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-RelevantResults

Specifies whether only relevant results are returned

Type: SwitchParameter
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-SelectProperties

The list of properties to return in the search results.

Type: String[]
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-SortList

The list of properties by which the search results are ordered.

Type: Hashtable
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-SourceId

Specifies the identifier (ID or name) of the result source to be used to run the query.

Type: Guid
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-StartRow

Search result item to start returning the results from. Useful for paging. Leave at 0 to return all results.

Type: Int
Parameter Sets: Limit

Required: False
Position: Named
Accept pipeline input: False

-TimeZoneId

The identifier for the search query time zone.

Type: Int
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-TrimDuplicates

Specifies whether near duplicate items should be removed from the search results.

Type: Boolean
Parameter Sets: __AllParameterSets

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

OUTPUTS

List<System.Object>

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Submit-PnPTeamsChannelMessage

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Sends a message to a Microsoft Teams Channel.

SYNTAX

Submit-PnPTeamsChannelMessage -Team <TeamsTeamPipeBind>
                              -Channel <TeamsChannelPipeBind>
                              -Message <String>
                              [-ContentType <TeamChannelMessageContentType>]
                              [-Important [<SwitchParameter>]]
                              [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Submit-PnPTeamsChannelMessage -Team MyTestTeam -Channel "My Channel" -Message "A new message"

Sends “A new message” to the specified channel

——————EXAMPLE 2——————

Submit-PnPTeamsChannelMessage -Team MyTestTeam -Channel "My Channel" -Message "<strong>A bold new message</strong>" -ContentType Html

Sends the message, formatted as html to the specified channel

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Channel

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsChannelPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-ContentType

Specify to set the content type of the message, either Text or Html.

Type: TeamChannelMessageContentType
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Important

Specify to make this an important message.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Message

The message to send to the channel.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Team

Specify the group id, mailNickname or display name of the team to use.

Type: TeamsTeamPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Sync-PnPAppToTeams

SYNOPSIS

Synchronize an app from the tenant app catalog to the Microsoft Teams app catalog

SYNTAX

Sync-PnPAppToTeams -Identity <AppMetadataPipeBind>
                   [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Sync-PnPAppToTeams -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe

This will synchronize the given app with the Microsoft Teams app catalog

PARAMETERS

-Identity

Specifies the Id of the Addin Instance

Type: AppMetadataPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Test-PnPListItemIsRecord

SYNOPSIS

Checks if a list item is a record

SYNTAX

Test-PnPListItemIsRecord -List <ListPipeBind>
                         -Identity <ListItemPipeBind>
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Test-PnPListItemIsRecord -List "Documents" -Identity 4

Returns true if the document in the documents library with id 4 is a record

PARAMETERS

-Identity

The ID of the listitem, or actual ListItem object

Type: ListItemPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-List

The ID, Title or Url of the list.

Type: ListPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Test-PnPOffice365GroupAliasIsUsed

SYNOPSIS

Tests if a given alias is already used used

SYNTAX

Test-PnPOffice365GroupAliasIsUsed -Alias <String>
                                  [-Connection <PnPConnection>]

DESCRIPTION

This command allows you to test if a provided alias is used or free, helps decide if it can be used as part of connecting an Office 365 Unified group to an existing classic site collection.

EXAMPLES

——————EXAMPLE 1——————

Test-PnPOffice365GroupAliasIsUsed -Alias "MyGroup"

This will test if the alias MyGroup is already used

PARAMETERS

-Alias

Specifies the alias of the group. Cannot contain spaces.

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Test-PnPTenantTemplate

SYNOPSIS

Tests a tenant template for invalid references

SYNTAX

Test-PnPTenantTemplate -Template <ProvisioningHierarchy>
                       [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Test-PnPTenantTemplate -Template $myTemplate

Checks for valid template references

PARAMETERS

-Template

The in-memory template to test

Only applicable to: SharePoint Online

Type: ProvisioningHierarchy
Parameter Sets: __AllParameterSets

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Uninstall-PnPApp

SYNOPSIS

Uninstalls an available add-in from the site

SYNTAX

Uninstall-PnPApp -Identity <AppMetadataPipeBind>
                 [-Scope <AppCatalogScope>]
                 [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Uninstall-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe

This will uninstall the specified app from the current site.

——————EXAMPLE 2——————

Uninstall-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Scope Site

This will uninstall the specified app from the current site. Notice that the app was original installed from the site collection appcatalog.

PARAMETERS

-Identity

Specifies the Id of the Addin Instance

Only applicable to: SharePoint Online

Type: AppMetadataPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Scope

Defines which app catalog to use. Defaults to Tenant

Only applicable to: SharePoint Online

Type: AppCatalogScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Uninstall-PnPAppInstance

SYNOPSIS

Removes an app from a site

SYNTAX

Uninstall-PnPAppInstance -Identity <AppPipeBind>
                         [-Force [<SwitchParameter>]]
                         [-Web <WebPipeBind>]
                         [-Connection <PnPConnection>]

DESCRIPTION

Removes an add-in/app that has been installed to a site.

EXAMPLES

——————EXAMPLE 1——————

Uninstall-PnPAppInstance -Identity $appinstance

Uninstalls the app instance which was retrieved with the command Get-PnPAppInstance

——————EXAMPLE 2——————

Uninstall-PnPAppInstance -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe

Uninstalls the app instance with the ID ‘99a00f6e-fb81-4dc7-8eac-e09c6f9132fe’

——————EXAMPLE 3——————

Uninstall-PnPAppInstance -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -force

Uninstalls the app instance with the ID ‘99a00f6e-fb81-4dc7-8eac-e09c6f9132fe’ and do not ask for confirmation

PARAMETERS

-Force

Do not ask for confirmation.

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Appinstance or Id of the addin to remove.

Type: AppPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: True

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Web

This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.

Type: WebPipeBind
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019, SharePoint Online schema: 2.0.0

Uninstall-PnPSolution

SYNOPSIS

Uninstalls a sandboxed solution from a site collection

SYNTAX

Uninstall-PnPSolution -PackageId <GuidPipeBind>
                      -PackageName <String>
                      [-MajorVersion <Int>]
                      [-MinorVersion <Int>]
                      [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Uninstall-PnPSolution -PackageId c2f5b025-7c42-4d3a-b579-41da3b8e7254 -PackageName mypackage.wsp

Removes the package to the current site

PARAMETERS

-MajorVersion

Optional major version of the solution, defaults to 1

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-MinorVersion

Optional minor version of the solution, defaults to 0

Type: Int
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-PackageId

ID of the solution, from the solution manifest

Type: GuidPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-PackageName

Filename of the WSP file to uninstall

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Unpublish-PnPApp

SYNOPSIS

Unpublishes/retracts an available add-in from the app catalog

SYNTAX

Unpublish-PnPApp -Identity <AppMetadataPipeBind>
                 [-Scope <AppCatalogScope>]
                 [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Unpublish-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe

This will retract, but not remove, the specified app from the tenant app catalog

——————EXAMPLE 2——————

Unpublish-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Scope Site

This will retract, but not remove, the specified app from the site collection app catalog

PARAMETERS

-Identity

Specifies the Id of the Addin Instance

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppMetadataPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Scope

Defines which app catalog to use. Defaults to Tenant

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppCatalogScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Unregister-PnPHubSite

SYNOPSIS

Required Permissions

  • SharePoint: Access to the SharePoint Tenant Administration site

Unregisters a site as a hubsite

SYNTAX

Unregister-PnPHubSite -Site <SitePipeBind>
                      [-Connection <PnPConnection>]

DESCRIPTION

Registers a site as a hubsite

EXAMPLES

——————EXAMPLE 1——————

Unregister-PnPHubSite -Site https://tenant.sharepoint.com/sites/myhubsite

This example unregisters the specified site as a hubsite

PARAMETERS

-Site

The site to unregister as a hubsite

Type: SitePipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online, SharePoint 2019 schema: 2.0.0

Update-PnPApp

SYNOPSIS

Updates an available app from the app catalog

SYNTAX

Update-PnPApp -Identity <AppMetadataPipeBind>
              [-Scope <AppCatalogScope>]
              [-Connection <PnPConnection>]

EXAMPLES

——————EXAMPLE 1——————

Update-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe

This will update an already installed app if a new version is available in the tenant app catalog. Retrieve a list all available apps and the installed and available versions with Get-PnPApp

——————EXAMPLE 2——————

Update-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Scope Site

This will update an already installed app if a new version is available in the site collection app catalog. Retrieve a list all available apps and the installed and available versions with Get-PnPApp -Scope Site

PARAMETERS

-Identity

Specifies the Id or an actual app metadata instance

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppMetadataPipeBind
Parameter Sets: (All)

Required: True
Position: 0
Accept pipeline input: True

-Scope

Defines which app catalog to use. Defaults to Tenant

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: AppCatalogScope
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Only applicable to: SharePoint Online, SharePoint Server 2019

Type: PnPConnection
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Update-PnPSiteClassification

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Directory.ReadWrite.All

Updates Site Classifications for the tenant

SYNTAX

Specific

Update-PnPSiteClassification [-Classifications <String>]
                             [-DefaultClassification <String>]
                             [-UsageGuidelinesUrl <String>]
                             [-ByPassPermissionCheck [<SwitchParameter>]]

Settings

Update-PnPSiteClassification -Settings <SiteClassificationsSettings>
                             [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Update-PnPSiteClassification -Classifications "HBI","Top Secret"

Replaces the existing values of the site classification settings

——————EXAMPLE 2——————

Update-PnPSiteClassification -DefaultClassification "LBI"

Sets the default classification value to “LBI”. This value needs to be present in the list of classification values.

——————EXAMPLE 3——————

Update-PnPSiteClassification -UsageGuidelinesUrl https://aka.ms/sppnp

sets the usage guideliness URL to the specified URL

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Classifications

A list of classifications, separated by commas. E.g. “HBI”,“LBI”,“Top Secret”

Type: String
Parameter Sets: Specific

Required: False
Position: Named
Accept pipeline input: False

-DefaultClassification

The default classification to be used. The value needs to be present in the list of possible classifications

Type: String
Parameter Sets: Specific

Required: False
Position: Named
Accept pipeline input: False

-Settings

A settings object retrieved by Get-PnPSiteClassification

Type: SiteClassificationsSettings
Parameter Sets: Settings

Required: True
Position: Named
Accept pipeline input: False

-UsageGuidelinesUrl

The UsageGuidelinesUrl. Set to "" to clear.

Type: String
Parameter Sets: Specific

Required: False
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices

applicable: SharePoint Online schema: 2.0.0

Update-PnPTeamsApp

SYNOPSIS

Required Permissions

  • Microsoft Graph API: Group.ReadWrite.All

Updates an existing app in the Teams App Catalog.

SYNTAX

Update-PnPTeamsApp -Identity <TeamsAppPipeBind>
                   -Path <String>
                   [-ByPassPermissionCheck [<SwitchParameter>]]

EXAMPLES

——————EXAMPLE 1——————

Update-PnPTeamsApp -Identity 4efdf392-8225-4763-9e7f-4edeb7f721aa -Path c:\myapp.zip

Updates the specified app in the teams app catalog with the contents of the referenced zip file.

PARAMETERS

-ByPassPermissionCheck

Allows the check for required permissions in the access token to be bypassed when set to $true

Type: SwitchParameter
Parameter Sets: (All)

Required: False
Position: Named
Accept pipeline input: False

-Identity

Type: TeamsAppPipeBind
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

-Path

The path pointing to the packaged/zip file containing the app

Type: String
Parameter Sets: (All)

Required: True
Position: Named
Accept pipeline input: False

SharePoint Developer Patterns and Practices