We have two version of our sharepoint instance on a different servers. One is development and the other is production. The root node of the breadcrumb on the dev version, in every site/site collection but the home page, is not correct though, it points to our production server:

Top level > Site > Site

The "Top level" link above points to http://intranet but should point to http://intranetdev

I need to change this so I or someone else doesn't accidentally click on the link and make changes to our production server, thinking they were on the dev server.

Any help is appreciated.

1 Answer 1


You can iterate through the links and fix the URLs of the nodes in the collection.

Something like this PowerShell script I just whipped up for you:

$site = Get-SPSite -Identity "http://intranetdev"

foreach ($web in $site.AllWebs)
    if (!$web.Navigation.UseShared)
        $topNav = $web.Navigation.TopNavigationBar

        foreach ($node in $topNav)
            if ($node.Url == "http://intranet")
                $node.Url = "http://intranetdev"



You may need to implement more complex logic to verify the URL depending on your specific instance, but this should be a solid framework.

Validate that the .Url property is indeed set as "http://intranet"... Most nodes are relative URLs, though the behavior you're seeing implies the nodes in question were added with the absolute URL.

Perhaps iteration is not the most efficient, but this is one run code.

  • Thanks! If it works it works. It is only a dev instance anyway. I thought maybe it was a setting in central admin but I looked everywhere. Mar 14, 2013 at 14:41
  • You might want to fiddle with the script and use a relative URL instead of the absolute "intranetdev" URL to do it the "right" way. Mar 14, 2013 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.