Get count of all SharePoint Webs in a Web Application

This script opens an SPWebApplication object for the given url, retrieves the Site Collections, and counts the webs in each.  Assumptions The script assumes the following: you are either using the SharePoint Management Shell or have imported the Microsoft.SharePoint.Powe

3 Star
Add to favorites
E-mail Twitter Digg Facebook
  • what the % sign means in the command below
    1 Posts | Last post August 23, 2019
    • $webapp.Sites | % { $allWebsCount += $_.AllWebs.Count; $_.Dispose(); }