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.

1 Answer 1

3

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 :)

3
  • Awesome! I'll give it a try and let you know..Thanks a lot
    – dimitrisd
    Commented Jan 15, 2019 at 15:05
  • 1
    You're welcome. Sure. Commented Jan 15, 2019 at 15:13
  • 1
    Happy to help you :) Commented Jan 16, 2019 at 8:58

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.