SharePoint 2010 Customize Error Page

in layouts create an application page(sp2010), name it as ErroronPage.aspx. and write your code inside it. 
PowerShell Script:
cls 
Remove-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue 
Add-PSSnapin Microsoft.SharePoint.Powershell 
$webApp = Get-SPWebApplication "http://sp2010:47940/"

$webApp.UpdateMappedPage([Microsoft.SharePoint.Administration.SPWebApplication+SPCustomPage]::Error,"/_layouts/ErrorOnPage.aspx")
$webApp.Update()


we can also use this script for some other usage:
 AccessDenied
 Confirmation
 Error
 Login
 RequestAccess
 Signout

 WebDeleted

Replace these with Error in "$webApp.UpdateMappedPage..." line.

Comments

Popular posts from this blog

C# Copy files from one server to another

Export SharePoint Online Group Users to Excel using Powershell