posts
This script adds a content type from the content type hub to the “Documents” library within a SharePoint site.
[string]$ClientId = "xxxxx" [string]$sitesFilesPath ="C:\Users\xx\Documents\scripts\HubSites.csv" [string]$CertPath = "C:\Users\xx\ertificates\ReshmeeCertPnP.pfx" [string]$TenantUrl = "https://contoso.sharepoint.com" $ContentTypes = @("Test Record", "Test 1 Record", "Document Set") [string]$TenantName = "contoso" $CertPassword = Read-Host "Please enter Certificate Password:" -AsSecureString [string]DocumentSetFeatureId = "3bae86a2-776d-499d-9db8-fa4cdc7884f8" #$csvPath = Join-Path $directorypath $sitesFiles $sites = Import-Csv -Path $sitesFilesPath if (-not $sites -or $sites.Count -eq 0) { write-host "No rows found in CSV: $sitesFilesPath" -BackgroundColor Red throw "Empty CSV.
posts
Get and Set Organisation links at Tenant and Site Level It has been a long awaited feature to set an expiry date on organisation sharing links
Get-PnPTenant | select-object CoreOrganizationSharingLinkMaxExpirationInDays, CoreOrganizationSharingLinkRecommendedExpirationInDays, RestrictResourceAccountAccess, EnforceRequestDigest, RestrictExternalSharingForAgents, AllowFileArchive, AllowFileArchiveOnNewSitesByDefault, EnableNotificationsSubscriptions
set-PnpTenant -RestrictExternalSharingForAgents $true -AllowFileArchive $true -AllowFileArchiveByDefault $true
WARNING: Failed to load 3 properties. Use -Verbose to see the details.
CoreOrganizationSharingLinkMaxExpirationInDays : 0 CoreOrganizationSharingLinkRecommendedExpirationInDays : 0 RestrictResourceAccountAccess : False EnforceRequestDigest : True RestrictExternalSharingForAgents : False AllowFileArchive : False AllowFileArchiveOnNewSitesByDefault : EnableNotificationsSubscriptions : False