We've tried our best to document as many gotchas as we've found while working with STSDEV, but we've never done a list as thoroughly as Jian Sun's post. Check it out as it's definitely worth the read.
I updated my page layouts that I deployed as a feature, but found that I could not overwrite the Layout File. The solution was to add a new page layout and then you would have to associate the new layout with every page on your site that used it. Obviously with a site of any size you'd have a lot of manual work to get this done, so doing it programmatically makes for a much better (and thorough) approach. After you've got your new page layouts, you could do something like this (in your event receiver class): public override void FeatureActivated(SPFeatureReceiverProperties properties) { //replace current page layouts with new page layouts on all pages SPWeb web = SPContext.Current.Web; SwapPageLayout(web, "FullWidthContentWithTitleV1.aspx", "FullWidthContentWithTitleV2.aspx"); } private void SwapPageLayout(SPWeb web, string oldPageLayoutName, string newPageLayoutName) { PublishingWeb pubWeb = PublishingWeb.GetPu...
I had a customer who accidentally synched a (very large) SP Online library and then decided they didn't want the files on their PC anymore...so they deleted them and were shocked to learn that they'd been deleted from SharePoint too! Thanks to PnP Powershell you can use the following to restore a batch of files quickly (and filter). First, you'll want to make sure you only select the files you want to restore. I used a combination of filtering by the person who deleted the files and the date they were deleted, e.g. Connect-PnPOnline https://yourtenanturl $restoreSet = Get-PnPRecycleBinItem | Where-Object { $_.DeletedByEmail -eq "imsorry@company.com" -and $_.DeletedDate -gt "1/1/2019" } Make sure you have a fairly updated version of the PnP Powershell module as the objects that come back have more properties populated than in older versions so you can do more powerful filtering Next you can restore the files like this: $restoreSet | Rest...
As a SharePoint consultant, I am constantly moving from client to client and the best way to develop and test the code, designs and configurations for each client while maintaining complete separation is to virtualize. Since I work for a Microsoft partner, we try to use Microsoft tools and technologies as much as possible, which can be quite frustrating, as you will find out below. I recently started working for a large client with a global presence whose IT policies are well-established, difficult to change and not always up-to-date. In that vein, enter the corporate VPN: it's a web-based signin with a host checker that doesn't support any x64 OS. This prompted me, running Win 7 x64, to try to get a co-worker's Hyper-V Win2k3 x86 MOSS VM and run it in Windows Virtual PC . Seems like a logical thing to do, right? I mean, a Microsoft VHD should work, and be able to be imported by other Microsoft tools, right? Wrong. After spending quite a bit of time trying to attach the VHD...
Comments