292 lines (289 sloc) 24.2 KB

Cmdlet Documentation

Below you can find a list of all the available cmdlets. Many commands provide built-in help and examples. Retrieve the detailed help with

Get-Help Connect-PnPOnline -Detailed


Cmdlet Description
Get‑PnPAppInstance Returns a SharePoint AddIn Instance in the site
Uninstall‑PnPAppInstance Removes an app from a site
Import‑PnPAppPackage Adds a SharePoint Addin to a site

Base Cmdlets

Cmdlet Description
Get‑PnPAuthenticationRealm Gets the authentication realm for the current web
Get‑PnPAzureADManifestKeyCredentials Creates the JSON snippet that is required for the manifest JSON file for Azure WebApplication / WebAPI apps
Get‑PnPContext Returns a Client Side Object Model context
Set‑PnPContext Sets the Client Context to use by the cmdlets
Get‑PnPHealthScore Retrieves the current health score value of the server
Connect‑PnPOnline Connects to a SharePoint site and creates a context that is required for the other PnP Cmdlets
Disconnect‑PnPOnline Disconnects the context
Get‑PnPProperty 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.
Execute‑PnPQuery Executes any queued actions / changes on the SharePoint Client Side Object Model Context
Get‑PnPStoredCredential Returns a stored credential from the Windows Credential Manager
Set‑PnPTraceLog 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.


Cmdlet Description
Add‑PnPCustomAction Adds a custom action to a web
Get‑PnPCustomAction Returns all or a specific custom action(s)
Remove‑PnPCustomAction Removes a custom action
Get‑PnPHomePage Returns the URL to the home page
Set‑PnPHomePage Sets the home page of the current web.
Add‑PnPJavaScriptBlock Adds a link to a JavaScript snippet/block to a web or site collection
Add‑PnPJavaScriptLink Adds a link to a JavaScript file to a web or sitecollection
Get‑PnPJavaScriptLink Returns all or a specific custom action(s) with location type ScriptLink
Remove‑PnPJavaScriptLink Removes a JavaScript link or block from a web or sitecollection
Get‑PnPMasterPage Returns the URLs of the default Master Page and the custom Master Page.
Set‑PnPMasterPage Sets the default master page of the current web.
Set‑PnPMinimalDownloadStrategy Activates or deactivates the minimal downloading strategy.
Add‑PnPNavigationNode Adds a menu item to either the quicklaunch or top navigation
Remove‑PnPNavigationNode Removes a menu item from either the quicklaunch or top navigation
Disable‑PnPResponsiveUI Disables the PnP Responsive UI implementation on a classic SharePoint Site
Enable‑PnPResponsiveUI Enables the PnP Responsive UI implementation on a classic SharePoint Site
Get‑PnPTheme Returns the current theme/composed look of the current web.
Set‑PnPTheme Sets the theme of the current web.

Content Types

Cmdlet Description
Add‑PnPContentType Adds a new content type
Get‑PnPContentType Retrieves a content type
Remove‑PnPContentType Removes a content type from a web
Remove‑PnPContentTypeFromList Removes a content type from a list
Get‑PnPContentTypePublishingHubUrl Returns the url to Content Type Publishing Hub
Add‑PnPContentTypeToList Adds a new content type to a list
Set‑PnPDefaultContentTypeToList Sets the default content type for a list
Remove‑PnPFieldFromContentType Removes a site column from a content type
Add‑PnPFieldToContentType Adds an existing site column to a content type

Document Sets

Cmdlet Description
Remove‑PnPContentTypeFromDocumentSet Removes a content type from a document set
Add‑PnPContentTypeToDocumentSet Adds a content type to a document set
Add‑PnPDocumentSet Creates a new document set in a library.
Set‑PnPDocumentSetField Sets a site column from the available content types to a document set
Get‑PnPDocumentSetTemplate Retrieves a document set template

Event Receivers

Cmdlet Description
Add‑PnPEventReceiver Adds a new event receiver
Get‑PnPEventReceiver Returns all or a specific event receiver
Remove‑PnPEventReceiver Removes/unregisters a specific event receiver


Cmdlet Description
New‑PnPExtensbilityHandlerObject Creates an ExtensibilityHandler Object, to be used by the Get-SPOProvisioningTemplate cmdlet
Disable‑PnPFeature Disables a feature
Enable‑PnPFeature Enables a feature
Get‑PnPFeature Returns all activated or a specific activated feature


Cmdlet Description
Add‑PnPField Adds a field to a list or as a site column
Get‑PnPField Returns a field from a list or site
Remove‑PnPField Removes a field from a list or a site
Add‑PnPFieldFromXml Adds a field to a list or as a site column based upon a CAML/XML field definition
Add‑PnPTaxonomyField Adds a taxonomy field to a list or as a site column.

Files and Folders

Cmdlet Description
Add‑PnPFile Uploads a file to Web
Copy‑PnPFile Copies a file or folder to a different location
Find‑PnPFile Finds a file in the virtual file system of the web.
Get‑PnPFile Downloads a file.
Move‑PnPFile Moves a file to a different location
Remove‑PnPFile Removes a file.
Rename‑PnPFile Renames a file in its current location
Set‑PnPFileCheckedIn Checks in a file
Set‑PnPFileCheckedOut Checks out a file
Add‑PnPFolder Creates a folder within a parent folder
Ensure‑PnPFolder Returns a folder from a given site relative path, and will create it if it does not exist.
Get‑PnPFolder Return a folder object
Move‑PnPFolder Move a folder to another location in the current web
Remove‑PnPFolder Deletes a folder within a parent folder
Rename‑PnPFolder Renames a folder
Get‑PnPFolderItem List content in folder

Information Management

Cmdlet Description
Get‑PnPSiteClosure Get the site closure status of the site which has a site policy applied
Set‑PnPSiteClosure Opens or closes a site which has a site policy applied
Set‑PnPSitePolicy Sets a site policy
Get‑PnPSitePolicy Retrieves all or a specific site policy


Cmdlet Description
Set‑PnPDefaultColumnValues Sets default column values for a document library
Get‑PnPList Returns a List object
New‑PnPList Creates a new list
Remove‑PnPList Deletes a list
Set‑PnPList Updates list settings
Add‑PnPListItem Adds an item to a list
Get‑PnPListItem Retrieves list items
Remove‑PnPListItem Deletes an item from a list
Set‑PnPListItem Updates a list item
Set‑PnPListPermission Sets list permissions
Get‑PnPProvisioningTemplateFromGallery Retrieves or searches provisioning templates from the PnP Template Gallery
Request‑PnPReIndexList Marks the list for full indexing during the next incremental crawl
Add‑PnPView Adds a view to a list
Get‑PnPView Returns one or all views from a list
Remove‑PnPView Deletes a view from a list

Microsoft Graph

Cmdlet Description
Connect‑PnPMicrosoftGraph 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
Get‑PnPUnifiedGroup Gets one Office 365 Group (aka Unified Group) or a list of Office 365 Groups
New‑PnPUnifiedGroup Creates a new Office 365 Group (aka Unified Group)
Remove‑PnPUnifiedGroup Removes one Office 365 Group (aka Unified Group) or a list of Office 365 Groups
Set‑PnPUnifiedGroup Sets Office 365 Group (aka Unified Group) properties


Cmdlet Description
Add‑PnPDataRowsToProvisioningTemplate Adds datarows to a list inside a PnP Provisioning Template
Remove‑PnPFileFromProvisioningTemplate Removes a file from a PnP Provisioning Template
Add‑PnPFileToProvisioningTemplate Adds a file to a PnP Provisioning Template
Convert‑PnPFolderToProvisioningTemplate Creates a pnp package file of an existing template xml, and includes all files in the current folder
Add‑PnPListFoldersToProvisioningTemplate Adds folders to a list in a PnP Provisioning Template
Apply‑PnPProvisioningTemplate Applies a provisioning template to a web
Convert‑PnPProvisioningTemplate Converts a provisioning template to an other schema version
Get‑PnPProvisioningTemplate Generates a provisioning template from a web
Load‑PnPProvisioningTemplate Loads a PnP file from the file systems
New‑PnPProvisioningTemplate Creates a new provisioning template object
Save‑PnPProvisioningTemplate Saves a PnP file to the file systems
New‑PnPProvisioningTemplateFromFolder Generates a provisioning template from a given folder, including only files that are present in that folder
Set‑PnPProvisioningTemplateMetadata Sets metadata of a provisioning template


Cmdlet Description
Set‑PnPAvailablePageLayouts Sets the available page layouts for the current site
Set‑PnPDefaultPageLayout Sets a specific page layout to be the default page layout for a publishing site
Add‑PnPHtmlPublishingPageLayout Adds a HTML based publishing page layout
Add‑PnPMasterPage Adds a Masterpage
Add‑PnPPublishingImageRendition 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.
Get‑PnPPublishingImageRendition Returns all image renditions or if Identity is specified a specific one
Remove‑PnPPublishingImageRendition Removes an existing image rendition
Add‑PnPPublishingPage Adds a publishing page
Add‑PnPPublishingPageLayout Adds a publishing page layout
Add‑PnPWikiPage Adds a wiki page
Remove‑PnPWikiPage Removes a wiki page
Get‑PnPWikiPageContent Gets the contents/source of a wiki page
Set‑PnPWikiPageContent Sets the contents of a wikipage


Cmdlet Description
Get‑PnPSearchConfiguration Returns the search configuration
Set‑PnPSearchConfiguration Sets the search configuration
Submit‑PnPSearchQuery Executes an arbitrary search query against the SharePoint search index
Get‑PnPSiteSearchQueryResults Executes a search query to retrieve indexed site collections

SharePoint Recycle Bin

Cmdlet Description
Clear‑PnpRecycleBinItem Permanently deletes all or a specific recycle bin item
Move‑PnpRecycleBinItem Moves all items or a specific item in the first stage recycle bin of the current site collection to the second stage recycle bin
Restore‑PnpRecycleBinItem Restores the provided recycle bin item to its original location
Get‑PnPRecycleBinItem Returns the items in the recycle bin from the context
Get‑PnPTenantRecycleBinItem Returns the items in the tenant scoped recycle bin


Cmdlet Description
Set‑PnPAppSideLoading Enables the App SideLoading Feature on a site
Get‑PnPAuditing Get the Auditing setting of a site
Set‑PnPAuditing Set Auditing setting for a site
Get‑PnPSite Returns the current site collection from the context.
Install‑PnPSolution 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.
Uninstall‑PnPSolution Uninstalls a sandboxed solution from a site collection


Cmdlet Description
Get‑PnPSiteCollectionTermStore Returns the site collection term store
Export‑PnPTaxonomy Exports a taxonomy to either the output or to a file.
Import‑PnPTaxonomy Imports a taxonomy from either a string array or a file
Set‑PnPTaxonomyFieldValue Sets a taxonomy term value in a listitem field
Get‑PnPTaxonomyItem Returns a taxonomy item
Remove‑PnPTaxonomyItem Removes a taxonomy item
Get‑PnPTaxonomySession Returns a taxonomy session
Get‑PnPTerm Returns a taxonomy term
New‑PnPTerm Creates a taxonomy term
Get‑PnPTermGroup Returns a taxonomy term group
New‑PnPTermGroup Creates a taxonomy term group
Remove‑PnPTermGroup Removes a taxonomy term group and all its containing termsets
Import‑PnPTermGroupFromXml Imports a taxonomy TermGroup from either the input or from an XML file.
Export‑PnPTermGroupToXml Exports a taxonomy TermGroup to either the output or to an XML file.
Get‑PnPTermSet Returns a taxonomy term set
Import‑PnPTermSet Imports a taxonomy term set from a file in the standard format.
New‑PnPTermSet Creates a taxonomy term set

Tenant Administration

Cmdlet Description
Get‑PnPAccessToken Gets the OAuth 2.0 Access Token to consume the Microsoft Graph API
Clear‑PnPTenantRecycleBinItem Permanently deletes a site collection from the tenant scoped recycle bin
Restore‑PnPTenantRecycleBinItem Restores a site collection from the tenant scoped recycle bin
Get‑PnPTenantSite Office365 only: Uses the tenant API to retrieve site information.
New‑PnPTenantSite Creates a new site collection for the current tenant
Remove‑PnPTenantSite Office365 only: Removes a site collection from the current tenant
Set‑PnPTenantSite Office365 only: Uses the tenant API to set site information.
Get‑PnPTimeZoneId Returns a time zone ID
Get‑PnPWebTemplates Office365 only: Returns the available web templates.

User and group management

Cmdlet Description
Get‑PnPGroup Returns a specific group or all groups.
New‑PnPGroup Adds group to the Site Groups List and returns a group object
Remove‑PnPGroup Removes a group from a web.
Set‑PnPGroup Updates a group
Get‑PnPGroupPermissions Returns the permissions for a specific SharePoint group
Set‑PnPGroupPermissions Adds and/or removes permissions of a specific SharePoint group
New‑PnPUser Adds a user to the built-in Site User Info List and returns a user object
Remove‑PnPUserFromGroup Removes a user from a group
Add‑PnPUserToGroup Adds a user to a group

User Profiles

Cmdlet Description
New‑PnPPersonalSite Office365 only: Creates a personal / OneDrive For Business site
Get‑PnPUserProfileProperty You must connect to the tenant admin website ( with Connect-PnPOnline in order to use this cmdlet.
Set‑PnPUserProfileProperty Office365 only: Uses the tenant API to retrieve site information. You must connect to the tenant admin website ( with Connect-PnPOnline in order to use this command.


Cmdlet Description
Send‑PnPMail Sends an email using the Office 365 SMTP Service or SharePoint, depending on the parameters specified. See detailed help for more information.

Web Parts

Cmdlet Description
Get‑PnPWebPart Returns a webpart definition object
Remove‑PnPWebPart Removes a webpart from a page
Get‑PnPWebPartProperty Returns a web part property
Set‑PnPWebPartProperty Sets a web part property
Add‑PnPWebPartToWebPartPage Adds a webpart to a web part page in a specified zone
Add‑PnPWebPartToWikiPage Adds a webpart to a wiki page in a specified table row and column
Get‑PnPWebPartXml Returns the webpart XML of a webpart registered on a site


Cmdlet Description
Set‑PnPIndexedProperties 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.
Add‑PnPIndexedProperty Marks the value of the propertybag key specified to be indexed by search.
Remove‑PnPIndexedProperty 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.
Get‑PnPIndexedPropertyKeys Returns the keys of the property bag values that have been marked for indexing by search
Get‑PnPPropertyBag Returns the property bag values.
Remove‑PnPPropertyBagValue Removes a value from the property bag
Set‑PnPPropertyBagValue Sets a property bag value
Request‑PnPReIndexWeb Marks the web for full indexing during the next incremental crawl
Get‑PnPRequestAccessEmails Returns the request access e-mail addresses
Set‑PnPRequestAccessEmails Sets Request Access Emails on a web
Get‑PnPSubWebs Returns the subwebs of the current web
Get‑PnPWeb Returns the current web object
New‑PnPWeb Creates a new subweb under the current web
Remove‑PnPWeb Removes a subweb in the current web
Set‑PnPWeb Sets properties on a web
Invoke‑PnPWebAction Executes operations on web, lists and list items.


Cmdlet Description
Add‑PnPWorkflowDefinition Adds a workflow definition
Get‑PnPWorkflowDefinition Returns a workflow definition
Remove‑PnPWorkflowDefinition Removes a workflow definition
Resume‑PnPWorkflowInstance Resumes a previously stopped workflow instance
Stop‑PnPWorkflowInstance Stops a workflow instance
Add‑PnPWorkflowSubscription Adds a workflow subscription to a list
Get‑PnPWorkflowSubscription Returns a workflow subscriptions from a list
Remove‑PnPWorkflowSubscription Removes a workflow subscription