Switch between modern SharePoint homepages using PnP PowerShell

I’ve been working on a modern intranet project amongst over projects for the last 12-months. This has been more about the transformation of content and business processes, rethinking information architecture and reimagining a modern intranet than it has been about custom development.

We’ve recently been testing variations in the design of a homepage with different audiences. This side-by-side comparison has allowed end-user feedback, performance and accessibility testing. The same approach has also been useful for previewing and testing the capabilities of new features (like the new Yammer web part). The challenge comes when you need to promote or switch over one of these variations as the new site homepage. The homepage is the page users are directed to when first navigating to a site or clicking on the site logo. It is like as important as the index.html or default.aspx page existence to a website. Note that these variations of the homepage permit testing of content and not site configuration. To test navigation, theme or similar we have separate sites and environments for this purpose.

To solve the problem switching the homepage from an existing page whilst preserving the home.aspx page name I’ve leveraged the SharePoint Pnp cmdlets to create a script that will rename or remove the current homepage (and can remove it through a toggle) and then rename an existing page to make it the new homepage.

Set-SPNewHomePage script demonstration
Demonstration of the Set-SPNewHomePage script in action.

Use my PnP PowerShell script to replace the home.aspx page

Alternative methods

Change the default homepage through SharePoint

Site Owners can use the out-of-the-box make homepage action to make any page the default homepage or welcome page. This is available from the toolbar in the site pages library. But this keeps the page name and means the default page is /sitepages/randompagename.aspx instead of the standard /sitepages/home.aspx that all sites have. From my perspective this is not great. Certainly, intranet-like sites should follow some basic content management principles. Call in a touch on the OCD side but consistently having a standard homepage is one of these for me.

Screenshot of setting a new homepage in the site pages library.
Screenshot of setting a new homepage in the site pages library.

Change the welcome page site property through Site Settings or PowerShell

Previously you could use the classic settings page (typically exposed by the publishing feature) or by browsing to /_layouts/15/AreaWelcomePage.aspx to make changes to the welcome page. This method no longer works and throws an error.

As with the make homepage action describe earlier this changes the default homepage to the use the page name you have provided and means the site won’t be available if users have bookmarked the site with the page name (/sitepages/home.aspx) in the URL.

Screenshot of the welcome page site settings page.
Screenshot of the welcome page site settings page.

What is my point? To this day can I still memory recall core settings pages. With these, you can quickly review or makes changes to settings pages rather than using the UI to navigate to them. This includes those that may no longer be exposed in the UI. Whilst my memory serves me well I don’t recommend this approach as these pages and settings are gradually being replaced with alternatives or removed by the SharePoint and Office 365 engineering team for a reason.

Instead, you can also use Pnp PowerShell to change the site welcome page property. I’ve provided an example script below.

As simple as my script is, it is the approach worth learning the most. I hope you find this article useful and as with all Pnp development effort. Sharing is caring!

Provide feedback directly to Microsoft about Office 365

I have just discovered that you can give feedback about your experiences using Office 365 directly to Microsoft using their online feedback form (http://msft.it/o365feedback) thanks to a Tweet from Jennifer Mason.

The Office 365 Twitter account shortly replied with a useful link to provide feedback.

It is a great tip for those working with Office 365, SharePoint Online and Yammer etc who want to pass on feedback to Microsoft about their experiences using Office 365.

Command surface in SharePoint Online updated

This post is part of SP14 Keynote highlights series where I provide some highlights of the next version of SharePoint. These highlights are from the SP24 Conference Keynote that Bill Baer delivered.

Updated Command Surface in SharePoint Online

The Command Surface that is available at the top of List and Library pages is being updated in SharePoint Online over the coming weeks. A message about this change has been available in the Office 365 Message Centre (MC4558) for some weeks now.

Command surface coming to SharePoint Online.
Command surface coming to SharePoint Online.

The change is intended to simplify access to common commands. The commands are now enlarged, include icons and there are additional commands to sync, edit, manage and share documents.

Close-up of the new command surface coming to SharePoint Online.
Close-up of the new command surface coming to SharePoint Online.

While this is not a new feature to SharePoint, it does demonstrate the continuous investment and development that is happening in Office 365 and SharePoint Online. Better still it is a further example that Microsoft is listening to customers – in this example, how commands were not easily accessible and hidden in the ellipsis menu.

Discover more

Join me over the next year as I discover more news and information about the next version of SharePoint and Office 16 by following my #Office16 tag.

“Shared with Me” coming to SharePoint

This post is the first of my SP14 Keynote highlights series where I provide some highlights of the next version of SharePoint. These highlights are from the SP24 Conference Keynote that Bill Baer delivered.

“Shared with Me” coming to SharePoint

Something to look out for in the next version of SharePoint (possibly SharePoint 2016 or Office16) or even soon is a summary of documents and folders that have been “Shared with Me”. It appears that the “Share with Me” page is already available in SharePoint Online, however, the summary of folders shared with you isn’t.

Folders Shared with me summary in the next version of SharePoint.
Folders Shared with me summary in the next version of SharePoint.

It’s pretty self-explanatory but a list of documents or folders that have been shared with you will be displayed in your OneDrive for Business site.

List of items Shared with me in the next version of SharePoint.
List of items Shared with me in the next version of SharePoint.

I wonder if this might extend to include scenarios such as multiple environments or Office 365 sites, to create a true consolidated view of files that have been shared with you. I’m always searching my inbox to find emails from colleagues where they have shared files with me in one single place for this information would be well received.

Discover more

Join me over the next year as I discover more news and information about the next version of SharePoint and Office 16 by following my #Office16 tag.