How to point to a custom 404 error Web page

January 10, 2014

Recently I was working on a custom 404 page with JavaScript logic for retiring an old SharePoint farm.   Replacing the “oldportal” DNS name with “newportal” helped avoid any end user 404 message by automatically handling all redirects.   Microsoft has a great KB article with implementation steps.  http://support.microsoft.com/kb/941329   However, I had two important changes and wanted to blog about it in case this might help others.

  1. Custom JavaScript redirect logic.   A simple replace statement helps change “oldportal” to “newportal” and seamlessly transition user traffic to the new system.
  2. PowerShell instead of Visual Studio EXE.   Not everyone has Visual Studio or the developer skills needed for compiling a command line EXE.   PowerShell is a simple text command you can run on MOSS2007/SP2010/SP2013 because it references the “Microsoft.SharePoint” assembly and works on older SharePoint server versions.

Enjoy!  Smile

 

PowerShell Code – apply web application setting

 

HTML Code – Custom404.htm

Launch IE as multiple users for testing

December 9, 2013

When testing role based security, it can be helpful to right click IE and “Run as different user.”   The below PowerShell script automates this process to make it easier to launch multiple IE windows for testing.   Keeping a copy on Windows 7/8 workstations can help users jump into testing easily and with fewer password typo lockouts.    If you find this helpful, please leave a comment.  Smile

 

 

Here is a screenshot of the script in action.

1

PowerShell – Notify all site users for outage / maintenance

September 18, 2013

The below PowerShell can be used to email all users of all site collections on your system.   I find this helpful when planning maintenance outages to alert users of the down time, impact, and changes being performed.

 

 

image

 
Return to Top ▲Return to Top ▲