SharePoint Custom Access Denied Page

Creating a custom Access Denied page to match the site branding and client requirement is one of the requirement in most of the projects. In Microsoft SharePoint, it has a default Acess denied page. To customize and build our own Acess Denied page, follow the below steps.

  1. On the SharePoint server, navigate to : C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\TEMPLATE\LAYOUTS
  2. Create new folder: UserCustomPages
  3. From the /Layouts folder, copy AccessSenied.aspx file paste into the new folder(UserCustomPages).
  4. Rename the file to customAccessDenied.aspx and modify it as per the requirement, save it.
  5. Open SharePoint management shell
  6. Execute below scripts:

get-spcustomlayoutspage -webapplication "http://your-site-url"

This will show the default Access denied page used.


set-spcustomlayoutspage -Identity "AccessDenied" -RelativePath "/_layouts/15/UserCustomPages/customAccessDenied.aspx" -webapplication "http://your-site-url"

This will set the custom accessdenied page as the AccessDenied page.


get-spcustomlayoutspage -webapplication "http://your-site-url"

Execute this to verify the chnage.

Comments

Popular posts from this blog

SharePoint Online (O365) OAuth Authentication | Authorizing REST API calls against SharePoint Online Site | Get Access token from SharePoint Online | Set up OAuth for SharePoint Online Office 365

SharePoint 2013 REST API Reference

Simple Risk Assessment Matrix table with resultant risk calculation

Kendo UI (Core JavaScript) grid Server Paging, Server Sorting and Server Filtering with Dynamic SQL queries

Sharepoint- Using an Image From formatmap32x32.png in a Ribbon Control