0

On SharePoint Server 2013, some users have their personal blog created while some other don't. I would like to count the number of personal blogs (in MySite) that have been created/used in SharePoint. Is there any way to get this using any ootb* mechanism or PowerShell? Can I also count the number blogs in total?

*I cannot use any addon.

2

MySite should have its own WebApplications and Blog is subweb for each Personal Mysite. I created this script, hope help you

asnp *sharepoint*
cls

$WA = Get-SPWebApplication https://my.dev.cz
$global:BlogsCount = 0
$global:MySiteCount = 0

$global:MySiteCount = $WA.Sites.Count-1

foreach($Site in $WA.Sites)
{
    Write-Host $Site.Url -ForegroundColor DarkYellow
    $Web = Get-SPWeb $Site.Url
    if ($Web.Webs.Count -gt 0)
    {
        $Blog = $Web.Webs | ? {$_.Title -eq "Blog"}       
        if($Blog.count -eq 1)       
        {
             $global:BlogsCount++
        }
    }
}

Write-Host "Total count of MySites: $global:MySiteCount" -ForegroundColor Yellow
Write-Host "Total count of Blogs: $global:BlogsCount" -ForegroundColor Green

If you need some edits, feel free to contact me :)

  • Awesome! I'll give it a try and let you know..Thanks a lot – dimitrisd Jan 15 at 15:05
  • 1
    You're welcome. Sure. – Zdeněk Vinduška Jan 15 at 15:13
  • 1
    Happy to help you :) – Zdeněk Vinduška Jan 16 at 8:58

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.