Let's SharePoint

SharePoint Pnp

  1. HOME
  2. SharePoint Pnp
June 7, 2019 / Last updated : June 7, 2019 Sethu Office 365

How to insert table in Modern Pages using PnP Powershell in Office 365/Sharepoint Online?

Hello SharePointers, Modern pages doesn’t support adding images in a table using text web part. To achieve that, We can use the below Pnp Powershell Connect-PnPOnline -Url https://mysites.sharepoint.com/sites/Test -Credentials (Get-Credential) Get-PnPClientSideComponent -Page Image.aspx |Format -Autosize textWebpart = Get-PnPClientSideComponent -Page Image.aspx -InstanceId 1d5bfd23-766c-4e24-aa34-8e08527a29d7 $textWebpart.Text | clip $htmlToInject = ‘ <div class=”canvasRteResponsiveTable”> <div class=”tableWrapper”> <table title=”Table”> <tbody> […]

April 30, 2019 / Last updated : April 30, 2019 Sethu Client Side Object Model

How to change the default SharePoint suite logo in SharePoint 2013/2016/2019?

Hello SharePointers, Below are the powershell commands to change the default SharePoint suite logo in SharePoint 2016/2019. $webapp = Get-SPWebApplication “http://ca.krossfarm.com”   $webapp.SuiteNavBrandingText = “Central Admin (Dev)”   $webapp.Update()   Happy SharePointing 🙂

April 17, 2019 / Last updated : April 17, 2019 Sethu Office 365

How to get Sharepoint site details using Powershell in Office 365?

Hello SharePointers, Below are the powershell code to site title, url, last modified date and creation date for a given sharepoint site collection. Get-SPWebApplication | Get-SPSite -Limit ALL | Get-SPWeb -Limit ALL | where { $_.HasUniquePerm -and $_.AssociatedOwnerGroup -ne $null } | foreach { $Title=$_.title;$TTNweburl = $_.Url; $_ ;$SiteCreatedDate=$_.Created; $SiteModifiedDate=$_.LastItemModifiedDate}| Select -ExpandProperty AssociatedOwnerGroup | Select […]

April 4, 2019 / Last updated : April 4, 2019 Sethu SharePoint Online

How to get the list of List and Document library item counts in SharePoint online using Pnp Powershell ?

Hello SharePointers, Below are the powershell commands to get the list of List and Document library item counts in SharePoint online using Pnp Powershell . $siteurl = “https://organisation.sharepoint.com/sites/selfservice/” $credentials = Get-Credential Connect-PnPOnline -Url $siteurl -Credentials $credentials $Subsites= Get-PnPSubWebs $ListItemCollection = @() Write-Host “Subsite count is ” $Subsites.Count ” in the site” foreach ($subsite in $Subsites) […]

April 2, 2019 / Last updated : April 2, 2019 Sethu SharePoint Online

How to restore subsite in a Sharepoint online site collection using Pnp Powershell

Hello SharePointers, Below are the power shell commands to restore subsite in a SharePoint online site collection using Pnp Powershell. $URL=”https://yourcompany.sharepoint.com/sites/selfservice/” $title=” KDM Monitor” $credentials=Get-Credential # Connect to SharePoint Online Connect-PnPOnline -Url $URL -Credentials $credentials Get-PnPRecycleBinItem | ? Title -eq $title | Restore-PnPRecycleBinItem Happy SharePointing 🙂

March 28, 2019 / Last updated : March 28, 2019 Sethu SharePoint Online

How to enable external sharing in Modern Hub site using Powershell?

Hello SharePointers, Below are the power shell scripts to enable external sharing in Modern Hub site param ( [Parameter(Mandatory=$true)] [string]$HubSiteUrl, [Parameter(Mandatory=$true)][ValidateSet(“Disabled”,”ExistingExternalUserSharingOnly”,”ExternalUserSharingOnly”,”ExternalUserAndGuestSharing”)] [String]$ExternalSharing ) $HubId = (Get-SPOHubSite -ErrorAction SilentlyContinue | Where {$_.SiteUrl -eq $HubSiteURL}).Id.Guid if ($HubId -eq $null) { Throw “Not a Hub site ” } $sites = Get-SPOSite -Limit All foreach ($site in $Sites) { […]

March 16, 2019 / Last updated : March 16, 2019 Sethu Client Side Object Model

How to delete SharePoint list items before specific date in SharePoint online using Powershell?

Hello SharePointers, Below are the Pnp Powershell script to delete SharePoint list items before specific date in SharePoint online using Powershell. Connect-PnPOnline -Url <yourtenant>.sharepoint.com $listName = “EMployee” $items = Get-PnPListItem -List $listName -Fields “Title”,”Created”,”ID”,”GUID” // 30 days is the cut off period $days = (Get-Date).AddDays(-30) foreach($item in $items) { $created = $item[“Created”] Write-Host “Item created […]

February 22, 2019 / Last updated : February 22, 2019 Sethu Client Side Object Model

How to convert classic page to modern page in SharePoint Online/Office 365 using Powershell ?

Hello Sharepointers, Below are the powershell script to convert classic page to modern page in SharePoint Online/Office 365. $pages = Get-PnPListItem -List sitepages # Loop through over the pages foreach($page in $pages) { if ($page.FieldValues[“FileLeafRef”].StartsWith((“classicpage”))) { # No need to convert modern pages if ($page.FieldValues[“ClientSideApplicationId”] -eq “b6917cb1-93a0-4b97-a84d-7cf49975d4ec” ) { Write-Host ‘Page $page.FieldValues[“FileLeafRef”] is modern,already’ } […]

February 16, 2019 / Last updated : February 16, 2019 Sethu PowerShell

How to export all the webpart in a sharepoint online page using Powershell?

Below are the power shell script to export all the web part in a SharePoint Page . foreach($item in $items) { $file = $context.Web.GetFileByServerRelativeUrl($Item[“FileRef”]) if($Item[“FileRef”] -eq “/sites/testwebpartpage.aspx”){ $wpManager = $file.GetLimitedWebPartManager([Microsoft.SharePoint.Client.WebParts.PersonalizationScope]::Shared) $context.Load($file) $webparts = $wpManager.Webparts $context.Load($webparts) $context.ExecuteQuery() $ pelement = $XMLFile.CreateElement(“Page”) $ pelement .SetAttribute(“id”, $Item[“ID”]) $ pelement .InnerText = $Item[“FileRef”] $ pelement .AppendChild($PageElement) | Out-Null foreach($webpart […]

December 22, 2018 / Last updated : December 22, 2018 Sethu Client Object Model

How to delete large lists in Sharepoint online using Powershell

Add-PSSnapin Microsoft.SharePoint.Powershell -ea SilentlyContinue $web = get-spweb “https://mysite” $list = $web.lists[“Monster List”] $cquery = New-Object Microsoft.SharePoint.SPQuery $cquery.ViewAttributes = “Scope=’Recursive'” $cquery.RowLimit = 1000 $cquery.ViewFields = “” $cquery.ViewFieldsOnly = $true do { $listItems = $list.GetItems($cquery) $cquery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition foreach($item in $listItems) { Write-Host “Deleting Monster Item – $($item.Id)” $list.GetItemById($item.Id).delete() } } while ($cquery.ListItemCollectionPosition -ne $null) Happy SharePointing […]

Posts navigation

  • Page 1
  • Page 2
  • »

Recent posts

How to insert table in Modern Pages using PnP Powershell in Office 365/Sharepoint Online?

June 7, 2019

How to set up Access Requests in SharePoint online using Powershell?

May 11, 2019

How to change the default SharePoint suite logo in SharePoint 2013/2016/2019?

April 30, 2019

How to add metadata to Document libraries in SharePoint online using powershell.

April 27, 2019

How to get Sharepoint site details using Powershell in Office 365?

April 17, 2019

How to get alerts for a specific policy in Cloud app security using Powershell

April 16, 2019

How to get the list of custom apps in App catalog using Powershell?

April 9, 2019

How to get the list of policies in Microsoft Cloud app security using window powershell?

April 4, 2019

How to get the list of List and Document library item counts in SharePoint online using Pnp Powershell ?

April 4, 2019

How to restore subsite in a Sharepoint online site collection using Pnp Powershell

April 2, 2019

Category

  • Anonymous access
  • Client Object Model
  • Client Side Object Model
  • Customization
    • Customization
  • Designer Workflows
  • Errors & Resolutions
  • Features
  • Google Analytics
  • InfoPath
  • Item Scheduling
  • JSOM
  • Nintex worflows
  • Office 365
  • Office 365 Groups
  • PnP JS Library
  • PowerShell
  • Powershell Online
  • REST API
  • REST API's
  • Server Side Object Model
  • SharePoint 2010
  • SharePoint 2010 Search
  • SharePoint 2013
  • SharePoint 2013 Search
  • SharePoint 2013 Workflows
  • SharePoint 2016
  • SharePoint 2019
  • SharePoint Designer
  • SharePoint Framework
  • SharePoint Online
  • SharePoint Pnp
  • SharePoint Usage Analytics
  • Unique values
  • User Profile Services
  • Windows Powershell
  • Workflow Manager

Archive

  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • January 2016
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • May 2015
  • April 2015
  • March 2015

Copyright © Let's SharePoint All Rights Reserved.

Powered by WordPress & Lightning Theme by Vektor,Inc. technology.

 

Loading Comments...