New answers tagged

0

I had the same issue of not being able to catch exceptions with Add-PnPListItem. Running it in a variable and adding -ErrorAction Stop worked for me. Using parts of the OP's script for this example, this is what worked: try { $getTheFile = Get-PnPFile -Url $fileUrl -Path $fullExportPath -FileName $fileName -AsFile -ErrorAction Stop $getTheFile } ...


0

As a workaround, you could use SharePoint Online PowerShell csom to achieve it. Here are two blogs for your reference: https://gallery.technet.microsoft.com/office/Find-all-checked-out-files-56fd562d https://social.technet.microsoft.com/wiki/contents/articles/34215.sharepoint-online-get-all-checked-out-files-using-powershell.aspx


0

This fixed it for me. I abandoned using the SetFieldValue altogether and did it this way instead: $session = Get-SPTaxonomySession -Site $sList.ParentWeb.Site $termStore = $session.TermStores["My Managed Metadata"] #get taxanomy group and termset $termStoreGroup = $termStore.Groups["Enterprise Taxonomy"] $...


0

Tested Successfully with the followings: CSV file Sample: Url "http://myServer.com/sites/ABC/" "http://myServer.com/sites/XYZ/" "http://myServer.com/sites/VCS/" "http://myServer.com/sites/BVC/" PS Script Cls Add-PSSnapin Microsoft.SharePoint.PowerShell $SitesColl = import-csv "C:\Temp\2020\SiteCollections....


0

You need to capitalize s in $site Correct code: Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue $SitesColl = import-csv "C:\Users\xxxxxxx\test.csv" foreach($Site in $SitesColl) { Set-SPSite -Identity $Site.Url -LockState "ReadOnly" }


1

I tested your script in my environment which was configured SSL, it worked fine. Also, I tested your script in my environment which was not configured SSL, I got the same error message as yours. So, your issue is caused by you didn’t configure SSL in your environment. Please refer to the following article to configure SSL: Configure SSL for SharePoint 2013/...


0

You need to remove the quotation mark around $site.Url. Use this, it should work for you: Set-SPSite -Identity $site.Url -LockState "ReadOnly"


2

This is only settable by using the SPO cmdlets as this is an administrator-level setting. You can use Set-SPOSite. Connect-SPOService https://tenantName-admin.sharepoint.com Set-SPOSite https://tenantName.sharepoint.com/sites/siteCollection -SharingCapability ExistingExternalUserSharingOnly


0

As per this GitHub Issue: The managed properties ViewLifeTime, ViewLifeTimeUniqueUsers and ViewsRecent, are not the same properties used within the Social bar, that is using a different source. The reason of this behavior is that, classic usage and modern (on the social bar) are from two different sources and we cannot make any comparison between each other....


1

I’ve just tested with the same command and it works fine. Try specifying the name of the Database Server and the Content Database in the command and try again: Restore-SpSite “http://mydevsitecollectionpath/” -Path "D:\pathname\12102020.bak" -Force -DatabaseServer <SQL> -DatabaseName <DB> Reference: Restore-SpSite : The operation that ...


1

Just did a test in my SP16, The Official PowerShell example (Get-SPFarm).PerformanceMonitor.DeveloperDashboardLevel = "On" doesnot work. I get the error like this: I find this article with the similar issue: https://techtrainingnotes.blogspot.com/2010/05/sharepoint-2010-developer-dashboard.html You need to use the second one. This works for me. $...


0

As far as I know, I don't think it's possible to reset the Document ID prefix through powershell in SharePoint online. All I can find is to change the Document ID prefix: Set-PnPPropertyBagValue -Key "docid_enabled" -Value "1" Set-PnPPropertyBagValue -Key "docid_msft_hier_siteprefix" -Value $DocIDPrefix You need to go to site ...


1

Use below code to enable developer dashboard: $ContentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService $DevDashboard = $ContentService.DeveloperDashboardSettings $DevDashboard.DisplayLevel = "On" $DevDashboard.Update() Note: Make sure that you have an active and running "Usage and Health Service ...


0

I tested with your cmdlet and it works fine. The properties change will reflects in the results I get when I change in navigation settings. Have a try to get the SP web object again and check the properties


0

A few things to check: Do you see any error message after the login window automatically close? If not, try executing a PnP command (e.g. Get-PnPList) and see if it returns any result or error. If you have previous signed in before executing the command, it might skip the authentication and log you in directly. Login to the site using browser and make sure ...


0

Have you tried the below? It worked for me (multi-factor authentication) Connect-PnPOnline -Url https://contoso.sharepoint.com -SPOManagementShell More info at MS site


1

Currently there is no powershell available to hide the "Get the mobile App" button in SharePoint server 2019. You need to use custom CSS to hide the button using SPFX webpart. Reference: https://n8d.at/remove-feedback-buttons-from-sharepoint-footer-through-application-customizer/


0

Using PnP PowerShell you could do: Connect-PnPOnline -Url [URL] -Credentials $($Get-Credential) $web = Get-PnPWeb $catch = Get-PnPProperty -ClientObject $web -Property RegionalSettings $web.RegionalSettings.LocaleId


1

You can use Out-Null to remove the output from the pipeline: Connect-PnPOnline -Url $NewSiteUrl -Credentials $cred New-PnPList -Title Newsfeed -Template DiscussionBoard | Out-Null New-PnPList -Title Tasks -Template Tasks | Out-Null New-PnPList -Title Contacts -Template Contacts | Out-Null New-PnPList -Title Calendar -Template Events | Out-Null New-PnPList -...


0

It could be due to multiple WorkflowServicesManager assemblies being registered. Run this command in ps- [appdomain]::currentdomain.getassemblies() | ?{$_.CodeBase -match "WorkflowServices"} If you have more than one WorkflowServicesManager assembly, you need to take some steps. I actually had two. One was significantly older than the other. So I ...


0

Here is a really old article but might help you with this problem: Workflows do not start. Quoting the article: you should create a special account not SHAREPOINT\SYSTEM, that is a site collection owner on the site collection where the workflow is hosted, open the workflow in SharePoint Designer while logged on as this new account and simply save the ...


0

Please refer following powershell to get all site collection owners for each site collection in SharePoint farm:(Change the file location for yourself) #Set file location for saving information. We'll create a tab separated file. $FileLocation = "C:\Temp\SiteCollectionOwnersReport.csv" #Load SharePoint snap-in Add-PSSnapin Microsoft.SharePoint....


0

Issue also can be related with several instances of SPO SDKs installed. In this case try the following steps: Open Control Panel -> UnInstall Programs -> Search for SharePoint related setups. Locate SharePoint Client Components -> Uninstall. Locate SharePoint Online Management Shell -> Uninstall. Ensure that anyone of the above setup is ...


0

@vilmarci, Please take a reference of below cmdlets to download a file: #Set parameter values $SourceFile="/sites/s01/My test doc lib/license.txt" #Relative URL $TargetFile="D:\license.txt" #sharepoint online powershell download file from library $FileInfo = [Microsoft.SharePoint.Client.File]::OpenBinaryDirect($ctx,$SourceFile) $...


0

Another option to get all the Checked out files from a SPO Document Library that has more than 5K documents would be to use MS Flow with Send an HTTP request to SharePoint action. I just tested with a library that has 12K documents. Please note that I had to create an index on Checked Out To column in the Library. I had 3 docs checked out and it returned the ...


0

We couldn't find all files without checked in version via CAML query in SharePoint online. We recommend that you move excess files to another library and use List.GetCheckedOutFiles method: #Load SharePoint CSOM Assemblies Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" ...


Top 50 recent answers are included