In the course of migrating from 2007 or 2010 to SharePoint 2013 it is common practice to do a test migration to a temporary URL to ensure the content moves successfully before the production migration.   For instance the web application at http://intranet.company.com gets migrated to http://intranet2013.company.com for a round of QA.  One issue that crops up almost instantly is the presence of full URLs in the quick launch and top link bars.  These links keep popping the user back to the production server (often without them realizing it) and make QA a painful experience.

The script below will process all the webs in a site collection and print out any full URL quick links that it finds.

 # Mantha Consulting - Quicklaunch Hard Coded URL tool  
 # Use this script to identify all the full hard coded urls in your site collection  
 # The hard full urls will be identified and a handy link to the quicklaunch edit   
 # page can be used to fix them.  
 [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > null  
 function GetQuickLaunchHCL(){  
 #BFM 08April2014  
 $site = new-Object Microsoft.SharePoint.SPSite("http://site.customer.com/")  
 $count =0  
          foreach ($web in $site.AllWebs)   
       {   
         write-host ("Checking Web {0} at {1}/_layouts/quiklnch.aspx " -f $web.url, $web.url)  
                   $nodeColl = $web.Navigation.quicklaunch  
                   foreach ($node in $nodeColl)  
         {  
           if ($node.url.Contains("http")) {  
           write-host $node.Title -foregroundcolor red -backgroundcolor yellow  
           write-host $node.url -foregroundcolor red -backgroundcolor yellow  
           $count = $count +1  
           }  
         }  
         $web.Dispose();   
          }   
       $site.Dispose();   
       Write-host "Count of links: " $count  
 }  
 GetQuickLaunchHCL