posts
#https://reshmee.sharepoint.com/sites/ContosoIT/_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.ApplyListDesign()
#{“listDesignId”:“7fdc8cba-3e07-4851-a7ac-b747040ff1ce”,“store”:1,“runtimeParameters”:"{"MediaLibrary_listName":"Media library","MediaLibrary_description":"","MediaLibrary_color":10,"MediaLibrary_addNavLink":true,"MediaLibrary_icon":5}"}
$SiteUrl = “https://reshmee.sharepoint.com/sites/ContosoIT" $ClientId = “f7fd5547-3751-4da4-89f8-25ebe1f6add1” # Entra app client id $Method = “POST” # GET, POST, PATCH, DELETE $Endpoint = “_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.ApplyListDesign()”
$listName_FieldValue = “MediaLibrary_listName” $listDesignId = “7fdc8cba-3e07-4851-a7ac-b747040ff1ce” # Media Library list design ID $listName = “Media Lib”
For POST/PATCH, set a body object. Keep $BodyObject = $null for GET. $BodyObject = @{ listDesignId = $listDesignId store = 1 runtimeParameters = “{"$listName_FieldValue”:"$listName”}" }
========================= Connect with PnP ========================= Connect-PnPOnline -Url $SiteUrl -ClientId $ClientId -interactive
posts
#connection details $clientId = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx" $invocation = (Get-Variable MyInvocation).Value $directorypath = Split-Path $invocation.MyCommand.Path $csvPath = $directorypath + "\TeamsChannelsExport.csv" # CSV should have a column 'SiteUrl' # Read sites from CSV $sites = Import-Csv -Path $csvPath #$TenantName = "contoso" #$adminSiteURL = "https://$TenantName-Admin.SharePoint.com" #Connect-PnPOnline -Url $adminSiteURL -ClientId $clientId function Add-ChannelNavigationLink { param( [string]$teamName, [string]$channelName, [string]$hubSiteUrl, [string]$channelSiteURL, [string]$teamSiteUrl, [string]$navParent ) Log-Message "Adding site to hub navigation - $($channelSiteURL)" "Info" if($hubSiteUrl) { try { # if(!
posts
In case of throttling ot large volume of request processing, there might be time out issues, throttling issues, etc.. skipping the setting application
$clientId = "xxxxxx" #Read-Host "Please enter the Entra Id registration:" # Connection String Variables, including client specific ID and Tenant $TenantUrl = "https://contoso.sharepoint.com" $TenantName = "contoso" function Invoke-With-Retry { param ( [scriptblock]$Operation, [string]$ErrorMessage, [string]$SuccessMessage, [int]$MaxRetries = 5, [int]$RetryDelay = 5 ) $attempt = 0 while ($attempt -lt $MaxRetries) { try { & $Operation Log-Message $SuccessMessage "Success" return } catch { $attempt++ if ($attempt -ge $MaxRetries) { Log-Message "$ErrorMessage.