I've created a few sites using this command,

> New-SPWeb -url "http://server" -Template "STS#0" -Name "test99" -Description "test99" -UseParentTopNav

The sites are appearing in the navigation bar as expected but not in the order I would like them.

With this page _layouts/AreaNavigationSettings.aspx under Navigation Editing and Sorting I can change the order they appear in, but is this possible using PowerShell?

I found this page - managing-quick-launch-current - which appears to do something similar with QuickLaunch. But it doesnt appear to manually set the sort order.

  • It's certainly possible because it can be done from .NET. Here's a starting point for adding a link (for 2007 but can be adapted). Hopefully the TopNavigationBar property is populated in 2010 (wasn't in 2007) or you may need to populate it yourself.
    – Alex Angas
    Apr 21, 2011 at 5:44
  • AFAIK it's only populated for publishing sites. Above is a Team Site. May 6, 2011 at 10:17

1 Answer 1


The following URL gives an example.

Below is a small adaptation :

$url = "http://localhost:29688"
$topsite = Get-SPSite $url; 
$topweb = $topsite.OpenWeb()
$topnavs = $topweb.Navigation.TopNavigationBar

//this adds removes the first  navigation item in the topNav andadds it as a child itemn of the "Solutions" item
 $node0 = $topnavs[0]
$node1 = new-object Microsoft.SharePoint.Navigation.SPNavigationNode -argumentlist @("Solutions", "/solutions", $False)
$node1 = $node0.Children.AddAsLast($node1)

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.