SharePoint Online List - How to get basic properties uisng Powershell

 

  1. function RetrieveList(){  
  2.     $list = Get-SPOList "PnPList"  
  3.     Write-Host "Title : " $list.Title  
  4.     Write-Host "Description : " $list.Description  
  5.     Write-Host "BaseTemplate ID : " $list.BaseTemplate  
  6.     Write-Host "Created Date : " $list.Created  
  7.     Write-Host "List ID : " $list.Id  
  8.     Write-Host "ImageUrl : " $list.ImageUrl  
  9.     Write-Host "ItemCount : " $list.ItemCount  
  10.     Write-Host "OnQuickLaunch : " $list.OnQuickLaunch  
  11.       
  12. }  
  13. RetrieveList #Retrieves list using list name 

How to enable verionsioning in SharePoint site through powershell script.

 Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue

$site = Get-SPSite($siteURL)
foreach($web in $site.AllWebs) {
    Write-Host "Inspecting " $web.Title
    foreach ($list in $web.Lists) {
        if($list.BaseType -eq "DocumentLibrary")
 # if($list.BaseType -eq "GenericList")  for List calenar task.
      {
            Write-Host "Versioning enabled: " $list.EnableVersioning
            Write-Host "MinorVersioning Enabled: " $list.EnableMinorVersions
            Write-Host "EnableModeration: " $list.EnableModeration
            Write-Host "Major Versions: " $list.MajorVersionLimit
            Write-Host "Minor Versions: " $list.MajorWithMinorVersionsLimit
            $list.EnableVersioning = $true
            $list.EnableMinorVersions = $true
            $list.MajorVersionLimit = 2
            $list.MajorWithMinorVersionsLimit = 5
            $list.Update()
            Write-Host $list.Title " is updated with MajorVersionLimit 2 and MajorwithMinorVersionsLimit = 5"
        }
    }
}

SharePoint User Permissions automatically get revoked

 I have faced an issue that user-assigned permissions are removed automatically in Sharepoint Permission page.


There is a SID mismatch on SharePoint Profile and FIM.

Get the $user = Get-SPuser -Web 'URL'  -identity 'i:0#.w/<domain/userid>'

if the $user return Null referencen

Please run the below script

Move-SPUser -identity $user -NewAlias ' i:0#.w/<domain/userid>' - IgnoreSID.

SPFX - HTTPClient - Curd Operations - SharePoint list.

  Create solution in the name of SpfxCrud. ISpfxCrudProps.ts export interface ISpfxCrudProps {   description : string ;     context : an...