Sunday, March 6, 2022

Tips and Trick for SharePoint

Get started with SharePoint Online Management Shell

Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser
Update-Module -Name Microsoft.Online.SharePoint.PowerShell

Connect-SPOService -Url -Credential #For Non-MFA
Connect-SPOService -Url #For MFA

Start-SPOSiteRename -Identity -NewSiteUrl -ValidationOnly

Start-SPOSiteRename -Identity -NewSiteUrl

Remove-SPOSite -Identity

Fix “Connect-SPOService : The term ‘Connect-SPOService’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.” Error

1. You can download and install SharePoint Online Management Shell to your client machine:

follow below steps:
1. Navigate to “C:\Windows\Microsoft.NET\assembly\GAC_MSIL”
2. Select all folders starting with name “Microsoft.SharePoint.Client” and delete them all!
3. Finally, Install the PowerShell Module for SharePoint Online: Install-Module Microsoft.Online.SharePoint.PowerShell -force

for more details:
Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version 
Install-Module Microsoft.Online.SharePoint.PowerShell 
Uninstall-Module -Name Microsoft.Online.SharePoint.PowerShell -AllVersions -Force
SharePoint Online: Create Site Collection App Catalog:

Enable App Catalog:
$TenantAdminURL = ""
$SiteCollectionURL = ""
Connect-PnPOnline -Url $TenantAdminURL -UseWebLogin -ReturnConnection  #-Credentials (Get-Credential)
Add-PnPSiteCollectionAppCatalog -Site $SiteCollectionURL

Remove App Catalog:
$TenantAdminURL = ""
$SiteCollectionURL = ""
Connect-PnPOnline -Url $TenantAdminURL -UseWebLogin -ReturnConnection
Remove-PnPSiteCollectionAppCatalog -Site $SiteCollectionURL

list of App Catalog enbaled urls:
$TenantURL =  ""
Connect-PnPOnline -Url $TenantURL -UseWebLogin -ReturnConnection
$AppCatalog = Get-PnPTenantAppCatalogUrl
Connect-PnPOnline -Url $AppCatalog -UseWebLogin -ReturnConnection
$ListItems = Get-PnPListItem -List "Site Collection App Catalogs"
ForEach($Item in $ListItems){
    Write-host $Item.FieldValues.Item("SiteCollectionUrl")
$SiteURL = ""
$AppName = "web-part-client-side-solution"
Connect-PnPOnline -Url $SiteURL -UseWebLogin -ReturnConnection  #-Interactive
#$App = Get-PnPApp -Scope Tenant | Where {$_.Title -eq $AppName}
$App = Get-PnPApp -Scope Site | Where {$_.Title -eq $AppName}
Install-PnPApp -Identity $App.Id -Scope Site

Featured Post

Azure Scripts

 Azure Scripts: Azure > Storage account > File shares > SMB File share To connect to this Azure file share from Windows, run the Po...

Popular posts