3

You can use the below PowerShell code: $ctx=New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl) $Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials $ctx.Credentials = $Credentials; $web = $ctx.Web $ctx.Load($web); $ctx.ExecuteQuery(); Note : The logged in user must have appropriate permissions to SharePoint to do the task....


1

It's resource throttling. Try to add UserAgent to request: $Ctx.add_ExecutingWebRequest({ param($Source, $EventArgs) $request = $EventArgs.WebRequestExecutor.WebRequest $request.UserAgent = "NONISV|George|SomeApp/1.0" }) more info: https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-...


1

Try this script: $Web = Get-SPWeb "http://sp" $cts=$Web.ContentTypes foreach($ct in $cts) { Write-Host $ct.get_Name() Write-Host $ct.get_Parent().Name Write-Host "--------------------" } Test result: Updated Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client....


1

Do you wish to generate a report on search result of certain keyword (old tool name)? If that is the scenario, here is a sample script for SharePoint on-premises: Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue #Set Parameters $SiteURL = "http://sp" $CSVFile = "C:\Temp\SearchResults.csv" $SearchQuery = "&...


1

A workaround is to create the Hero web part in a different section, then move the web part to the full-width section afterward: Connect-PnPOnline -Url https://tenantname.sharepoint.com/sites/sitename -UseWebLogin Add-PnPClientSidePageSection -Page "Home" -SectionTemplate OneColumnFullWidth -Order 0 Add-PnPClientSidePageSection -Page "Home"...


1

Yes, we need to download the XML file and update as per your need then upload back to the same location: For update sample, you can refer the below PowerShell: $Path = "\\spsite\sites\subsite\Library\" $Files = Get-ChildItem $Path | where {$_.extension -eq ".xml"} foreach($file in $Files){ $xml = New-Object XML $xml....


1

You can use the below PowerShell code to read the form digest value: Function Invoke-RestSPO(){ Param( [Parameter(Mandatory=$True)] [String]$Url, [Parameter(Mandatory=$False)] [Microsoft.PowerShell.Commands.WebRequestMethod]$Method = [Microsoft.PowerShell.Commands.WebRequestMethod]::Get, [Parameter(Mandatory=$True)] [String]$UserName, [Parameter(...


1

Not sure if it works, but try using PnP PowerShell as following: Connect to SPO: $SiteURL = "https://crescent.sharepoint.com" Connect-PnPOnline -Url $SiteURL -UseWebLogin Define an Add-only permission level: #Get Permission level to copy $ContributeRole = Get-PnPRoleDefinition -Identity "Contribute" #Create a custom Permission level Add-...


1

It seems you want to check the web parts used in the pages in your site pages library. As you are not quite familiar with the GetLimitedWebPartManager method, it may better to first use a script here: https://www.sharepointdiary.com/2015/08/find-all-web-parts-in-use-in-sharepoint-using-powershell.html And here is a blog about how to use this method. https://...


1

The error message Method not found: '!!0[] System.Array.Empty()' is related to .NET Framework 4.6 not installed correctly, please refer the similiar question here: Method not found: '!!0[] System.Array.Empty()' You can download and install .NET Framework 4.6 here: Microsoft .NET Framework 4.6.2 (Offline Installer)


Only top voted, non community-wiki answers of a minimum length are eligible