RSS

Site usage statistics out of sync – SharePoint

03 May

Last week we had a peculiar issue on the SharePoint GUI(storman.aspx) which provides the information about Storage Space Allocation. The issue is, Storman.aspx(Storage Space Allocation) file was showing more than 100GB used space which is the subjected sitecollection had never reached to 100GB. We had check the database sizes(.mdf & .ldf) and those sizes are not even close to 100GB. Finally, we had concluded that there is some bug in the GUI or this usage statistics out of sync.

I end-up in creating the PowerShell script (as shown in below) to re-sync the usage statistics using RecalculateStorageUsed() Method.

foreach ($spsite in Get-SPSite -url *) {
$oStorage = $spsite.SPBase.Usage.Storage
Write-Host Old Storge: $oStorage
$spsite.SPBase.RecalculateStorageUsed()
$spsite.SPBase.Dispose()
$tSPSite = $spsite.GetSPObject()
$nStorage = $tSPSite.Usage.Storage
Write-Host $tSPSite.Url Updated from $oStorage to $nStorage
$tSPSite.Dispose()
}

Also, we could have use Gary Lapointe’s STSADM extension — which has gl-recalculateusage STSADM command to sync the site usage statistics on SharePoint.

Advertisements
 
Leave a comment

Posted by on May 3, 2012 in Sharepoint

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: