How to set a Custom SP2010 Error Page with PowerShell

Custom application pages mapping is a brand new feature you get in SharePoint 2010.

What this does is let you specify what page you want the system to redirect to after some occurrence.

These occurrences can be the user login, the Access Denied, as well as the generic error page.

Here’s how you can set this all up, with just a couple of lines of PowerShell scripting:

Add-PSSnapin microsoft.sharepoint.powershell –ErrorAction SilentlyContinue

$wa = Get-SPWebApplication http://yoursite.com

$url = "/_LAYOUTS/GreenPoint2010/Error.aspx"

$cp = [Microsoft.SharePoint.Administration.SPWebApplication+SPCustomPage]"Error"

$wa.UpdateMappedPage($cp, $url)

$wa.Update()

Leave a Reply

Your email address will not be published. Required fields are marked *