powershell
23 TopicsSharePoint (2019) PowerShell Command for SPSite.WebApplication.Properties
We are trying to set and get properties in WebApplication using following code SPSite site = new SPSite(<SiteUrl>) // or SPSite site = SPFeatureReceiverProperties.Feature.Parent as SPSite // set property site.WebApplication.Properties.Add("Property1", "Value1") // get property site.WebApplication.Properties["Property1] We don't get any errors in above code. Now, we want to get and update this property via powershell. We have already tried following commands: 1. Get-SPWeb $site=Get-SPWeb -Identity "<SiteUrl>" $site.Properties 2. Get-SPSite $site=Get-SPSite "<SiteUrl>" $site.WebApplication.Properties 3. Get-SPSite (OpenWeb()) $site=Get-SPSite "<SiteUrl>" $web=$site.OpenWeb() $web.Properties Unfortunately, we were unable to retrieve or set the property using these PowerShell commands, which corresponds to the functionality used in the .NET code. We need assistance in determining how to update or retrieve the property set using the mentioned code via PowerShell.2.4KViews0likes4CommentsAfter Communication Site upgrade of the root site full-width sections are limited
If you upgrade root site's team site template with a communication site template, the new home page (front page) contains one section that can have a full-width web part and it's the first section (uppermost). You cannot add a full-width section down on the page because it's not available in Add Section menu. Is there a possibility somehow to allow full-width sections also on other slots on the new homepage? The upgrade was done with Powershell: Enable-SPOComm... and it was otherwise successful.938Views0likes3Comments403 with a ctx.load($WEB) executeQuery
I have a powershell script which is failing with a 403 Forbidden. I have tried 2 variants of Connect-PnPOnline $SiteURL = “https://MyDomain.sharepoint.com/sites/MySPSite/” Connect-PnPOnline -Url $SiteURL -Interactive # Connect-PnPOnline -Url $SiteURL -UseWebLogin $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL) $Web = $Ctx.Web $Ctx.Load($Web) $Ctx.Load($Web.AllProperties) $Ctx.ExecuteQuery() The ExecuteQuery returns a 403 forbidden. I am in the ‘Site Owners’ Group for https://MyDomain.sharepoint.com/sites/MySPSite I have the SharePoint Administrator role activated in Portal.Azure.Com >> Azure AD roles What am I missing ? All suggestions gratefully received. Thank youSolved1.8KViews0likes2CommentsScript PowerShell pour générer des fichiers sur Sharepoint
Bonjour, J'utilise un script PowerShell pour télécharger des fichiers dans SharePoint dans des colonnes taguées. Cela fonctionne bien avec tous les intitulés de colonnes, par exemple (Projet) à part la colonne (Type de documents) Pourriez-vous me dire si vous avez une solution pour ce cas, s'il vous plait ? Merci.663Views0likes0CommentsSetting Up Banner Image in Programmatic Way
Hi All, I was trying to add background image in header section of sharepoint site. Through sharepoint UI we were following below step to set the background image of header section: Settings -> Change the Look -> Header -> Set the header layout as "Extended" -> Set the required background image as Optional Image. Now we are looking for a programmatic way, either from powershell or PnP-Provisioning Template to apply the same background image to number of sites. Any Suggestions are appreciated. Thank You.923Views0likes0Comments401 Error using PnP PowerShell in Azure Runbooks
Trying to get PnP PowerShell cmdlets to work within an Azure Runbook with modern authentication (no username/password). I tried registering an Azure AD app and a Service Principal (Run as account) from the automation account that hosts the Runbook. Both use a certificate thumbprint and authorization itself doesn't throw an error. Here's the code I'm using: $connection = Get-AutomationConnection –Name "AzureRunAsConnection" $tenant = '[tenant].onmicrosoft.com' $url = 'https://[tenant].sharepoint.com/sites/test' Connect-PnPOnline -Url $url –Thumbprint $connection.CertificateThumbprint –ClientId $connection.ApplicationID -Tenant $tenant For every PnP cmdlet this throws the following error. Get-PnPTenantSite : The remote server returned an error: (401) Unauthorized. At line:7 char:1 + Get-PnPTenantSite + ~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-PnPTenantSite], WebException + FullyQualifiedErrorId : System.Net.WebException,PnP.PowerShell.Commands.GetTenantSite I have also updated the cmdlets from SharePointPnPPowerShellOnline to the newest PnP.PowerShell. Furthermore, the Azure app and service principal are members of the SharePoint administrators group. When I attempt to reproduce the issue on a local machine I get the same 401 error. Any ideas? Thanks!Solved7.7KViews0likes3CommentsSharePoint powershell to retrieve count of files in 2nd level subfolder in all subsites
Hi, How to generate a report in csv to count of all files present in 2nd level subfolder [Change Requests] in all subsites https://www.sharepointdiary.com/2017/03/get-all-list-and-libraries-inventory-of-site-collection-using-powershell.html I have edited source from this https://sharepointrelated.com/2014/11/11/download-all-content-in-a-site-collection/ ... $lists = $web.lists | ?{$_.title -eq "Documents" -and $_.itemcount -ge "1" -And $_.BaseType -eq "DocumentLibrary"} #Change any identifier here foreach($list in $lists) { Write-Host "- $($list.RootFolder.url)" $DirpathList = $Dirpath +"\"+$list.title CreateFolder($DirpathList) #Download files in root folder #$rootfolder = $web.GetFolder($list.RootFolder.Url) #Download-SPContent($rootfolder) #Download files in subfolders foreach($folder in $list.folders) { #$folder = $web.GetFolder($folder.url) if ($folder.name -eq "Change Requests") { $folder = $web.GetFolder($folder.url) Download-SPContent($folder) } } } Thanks978Views0likes0CommentsPNP SharePoint Modern Lists DefaultEditFormUrl
Hi, Is there a way with PNP PowerShell to change a modern lists (SharePoint Online) default DefaultEditFormUrl. I know we can get the current values, but looking for a way to set it to my own custom page. Connect-PnPOnline -Url "https://tenanr.sharepoint.com/sites/x" $list = Get-PnPList -Identity "listane" -Includes DefaultDisplayFormUrl, DefaultEditFormUrl, DefaultNewFormUrl $list.DefaultDisplayFormUrl $list.DefaultEditFormUrl $list.DefaultNewFormUrl Thanks 🙂2.8KViews0likes1CommentApply Communication Site Experience to Root Site Availability?
I'm looking for an update to the "Apply the communication site experience to the root site" feature. Roadmap says Q1, but with all the issues going on it looks like this is still experimental. What I really need to know is if it will be available in the next 6 weeks or not. A "definitely not" is fine, just need to know. Also, will this still be a limitation when the feature goes live: "The root site can be converted to a communication site only if the classic publishing feature was never turned on." (emphasis added) Doc page here: https://docs.microsoft.com/en-us/sharepoint/modern-root-site#apply-the-communication-site-experience-to-the-root-site-coming-soonSolved1.1KViews0likes2CommentsHow to export list of Tasks lists showing "Send e-mail when ownership is assigned" enabled MOSS 2007
Hi all, I'm hoping some PowerShell gurus may be able to assist with this. I'm performing a migration of an old SP 2007 tenant to SPO and have encountered an issue where migration triggers the email alerts when Task ownership is assigned in the destination list. It seems the only solution is to disable the option in the list before the migration but as the site is quite old there are many lists and various sub-sites. Instead of manually going through all lists to be migrated individually to check their Advanced Settings is there a way to export all lists showing this option (E-Mail Notification > Send e-mail when ownership is assigned) so I can know which I need to disable? I've a bit of experience with PS but not much using PS in SharePoint. Any suggestions would be much appreciated.1.3KViews0likes1Comment