Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top