Tuesday 25 May 2021

Add & Remove App Catalog SharePoint Online Site Collection



#Login with Global Admin id and update the email address below

Connect-SPOService -Url https://xxx-admin.sharepoint.com -credential {user}@xxx.com

# get a reference to the site collection where the site collection app catalog should be created

$site = Get-SPOSite https://xxx.sharepoint.com/sites/yyy/ 

# remove site collection app catalog

Remove-SPOSiteCollectionAppCatalog -Site $site

# Add site collection app catalog

Add-SPOSiteCollectionAppCatalog -Site $site


Note : Account used to create App Catalog Site Collection, must be Site Collection Administrators on both the tenant-level App Catalog and the target Site Collection


SharePoint Online - Copy site pages between site collections, using PnP-PoweShell

Copy Site Page from one site collection to other site collection using PnP-PowerShell

try{
    $srcSiteURL   = "https://xxxxx.sharepoint.com/sites/xxxxx/"
    $destSiteURL  = "https://xxxxx.sharepoint.com/sites/yyyyy/"
    $pageName = "test.aspx"
    
    Connect-PnPOnline -Url $srcSiteURL -Credentials SharepointCredential
    $tempFile = [System.IO.Path]::GetTempFileName();
    Export-PnPClientSidePage -Force -Identity $pageName -Out $tempFile
    
    Connect-PnPOnline -Url $destSiteURL -Credentials SharepointCredential
    Apply-PnPProvisioningTemplate -Path $tempFile
    Write-Host "Success"
    }
catch{
    Write-Host -ForegroundColor Red 'Error ',':'$Error[0].ToString();
    } 

Reference Link:
https://pnp.github.io/powershell/cmdlets/Export-PnPPage.html 

How to filter a SharePoint list or library using URL parameters


?FilterField1=[IntFieldName]&FilterValue1=[FilterValue]

Filtering yes/no or true/false values

If your filter isn’t working for yes/no columns, replace “no” with 0 and “yes” with 1 in your URL.

SharePoint List Item Query String Filter on Multiple Values

If you want to filter on multiple values then you can pass values separated by a semicolon(;). See like below:

?FilterName=Country&FilterMultiValue=IN;SL


Remember here the filter column name is the internal name of the column, not the display name.

You can add up to 10 FilterField and FilterValue like below:

/Lists/MyTestingList/AllItems.aspx?FilterField1=Country&FilterValue1=IN&FilterField2=Title&FilterValue2=Item-2……


SharePoint List Item Query String Filter on wildcard characters

You can also filter SharePoint list items filter items based on wildcard characters like below:

/Lists/MyTestingList/AllItems.aspx?FilterName=Country&FilterMultiValue=*IN*