Is there an stsadm command that will enumerate / list all web applications? This would be the similar to SPWebService.AdministrationService.WebApplications.

What I'm looking for is an stsadm command that will return a list of web applications, their name and URL.

btw - sorry for the unknown (yahoo) user name. I'm not sure how to associate my open id that is used on SO, Meta, etc... The open id being used is the same for SharePoint Overflow and the other sites. And my SPO profile doesn't provide an option to associate with the other sites.


You can use the following stsadm commands to get the information you need:

stsadm -o enumzoneurls
stsadm -o enumalternatedomains

or use the PowerShell cmdlet:

  • enumzoneurls is exactly what I was looking for. Thanks! (I'd upvote you, but I don't have enough rep right now) Mar 16 '11 at 14:33

I've used this PowerShell to get sites and owner information. Can be extended to get more info. Not my script; I just can't find the URL right now to point you to the site:

$webappUrl = "INSERT URL HERE";

Clear-Host $12HivesDir = "${env:CommonProgramFiles}\Microsoft Shared\web server extensions\12\" function get-spweb ([String]$webUrl=$(throw 'Parameter -webUrl is missing!')) { $site = New-Object -TypeName "Microsoft.SharePoint.SPSite" -ArgumentList "$webUrl"; return $site.OpenWeb(); } function get-spwebInfo ($web) { Write-Host $web.Title Write-Host $web.Url if ($web.Webs.Count -ne 0) { Write-Host "=======================================" Write-Host "Sub webs of " $web.Title Write-Host "=======================================" foreach ($subweb in $web.Webs) { get-spwebInfo($subweb); $subweb.Dispose(); } Write-Host "=======================================" } if ($web.Webs.Count -ne 0) { Write-Host "=======================================" Write-Host "Sub webs of " $web.Title Write-Host "=======================================" Write-Host "SiteAdministrators: " $web. SiteAdministrators Write-Host "Url: " $web.Url Write-Host "LastItemModifiedDate: " $web.LastItemModifiedDate

  foreach (SPList list in web.Lists)

{ foreach(SPListItem item in list.Items) { Write-Host ìListItemTitle: ì + item.Title; Write-Host ìListItemUrl: ì + item.Url;

  foreach ($subweb in $web.Webs)
  Write-Host "======================================="



$devWeb = get-spweb $webappUrl get-spwebInfo($devWeb) $devWeb.Dispose();

  • This appears to enumerate the sites within a known site collection / web application. I just need to find all the web applications on the server. Mar 16 '11 at 14:32

And also have a look at these scripts:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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