FromTheField

Real world experiences of SharePoint PFE and CTS engineers from Microsoft UK

April, 2014

  • Sizing SharePoint - The 2nd stage Site collection recycle bin

    One of my customers asked me about the impact about the 2nd stage recycle bin on sizing a new farm. They were concerned that the default value of 50% of the current site quota could have a negative impact on sizing the farm and could influence the expected size of the contentDBs. This setting can be changed on a web application level:

    My initial response to the customer was that this value could be ignored most likely, and that this feature is there to help the administrators of SharePoint, since they don't need to start a restore if the item can be retrieved from there. Since I used "most likely", the answer did not pass, and the customer wanted a real percentage number that they could plug into their calculations.

    So I started a PowerShell session on one of their farms in order to retrieve some actual values...

    The Script I wrote for this is here:


     

    asnp *sh* -ea 0

     

    $countS1 =0

    $countS2 = 0

    $SizeS2 = 0

    $SizeS1 = 0

    $SizeSite = 0

     

    ### Get all sites in the farm

    $sites = get-spsite -limit all

    foreach ($site in $sites)

    {

        $site.Url

        $SizeSite += $site.Usage.Storage / 1MB

        foreach ($item in $Site.Recyclebin)

        {

            if ($item.ItemState -eq "SecondStageRecycleBin")

            {

                $countS2 ++

                $SizeS2 += $item.Size / 1MB

            }

            else #Yes i know, stage can be "Invalid, but i dont care

            {

                $countS1 ++

                $SizeS1 += $item.Size / 1MB       

            }#End If

        } #End Item

        $site.Dispose()

    } #End Sites

     

    "Site count = " + $Sites.length

    "Total recycled items = " + ($countS1 + $countS2)

    "Total Size Site in MB = " + $SizeSite

    "Total Size Stage 1 in MB ="  + $SizeS1

    "Total Size Stage 2 in MB ="  + $SizeS2

    "Stage 2 Percentage vs total size =" + ($SizeS2 / $SizeSite)  * 100


    And for our test farm, it generated the following output (Added decimal Points for clarity, and removed all Site URLs)...

    Site count = 7894

    Total recycled items = 333,003

    Total Size Site in MB = 5,222,218.89358997

    Total Size Stage 1 in MB =89,204.0437278748

    Total Size Stage 2 in MB =45,874.8446807861

    Stage 2 Percentage vs total size =0.878455032535985


    Which means even with a 50% quota buffer, we are using less than a single % on a Farm with almost 5 TB of data. I know that this number can fluctuate a lot, but if your sizing is unable to handle this you should consider a very close monitoring of Farm, and then this should be no issue ;)


    I would consider that a number I would ignore on a sizing calculation, esp. since there are other traps that can hurt you much more, like auditing data, workflows or whole sitecollections which wait for a restore in the contentDB. I would even go as far as suggesting to increase this value from 50% to 100%, which would allow even the recovery of a subweb, which can contain almost the whole sitecollection. The additional cost you pay for this is easily absorbed by the increased ease of recovery. Always remember that SharePoint has many options to recover a lost Document/Site... Make sure you try the internal options before you start to restore a database... And this includes Restore-SPDeletedSite

     

    Greetings

    Heiko Hatzfeld

     

     

     

     

     

     

  • Who are Global Business Support? What Do They Do?

    It's been nearly three weeks since my last post, how time flies! I'm back with a slightly different post, the contributors of this Blog are from the PFE and CTS teams within Microsoft UK, these teams are part of a larger team known as Global Business Support (GBS). One of my colleagues recently recorded a video that provides some background into the GBS team and the job role, I thought it may be worth sharing this to provide a little more insight into the background of the Blog contributors.

    https://www.youtube.com/watch?v=hedHasRflkY&list=PLEXuFMEOTa_geCL4_0lW8EIMMkFinAml5%20

    Brendan Griffin - @brendankarl

  • SharePoint: Planning for the Future - PowerShell Scripts

    I recently presented a session on planning for the future with SharePoint, as promised to the attendees, below are two of the scripts that I used in my demonstrations to audit Content databases and Site Collections.

    Content Database Inventory

    This script outputs details of all Content Databases within a SharePoint farm to a CSV file, this includes the following information:

    • Name
    • SQL Server
    • Web Application
    • Current number of sites
    • Maximum number of sites allowed
    • Total size of the database (MB)

    Prior to running the script please update highlighted with the location to store the output CSV file.

    asnp *SharePoint* -ErrorAction SilentlyContinue
    #Configure output location for CSV file
    $Output = "D:\CDBInventory.csv"
    #Create headings in the CSV file
    $Headings = "Name","Server","Web App","No. of Sites","Max Site Count","Size (MB)",
    $Headings -join "," | Out-File -Encoding default -FilePath $Output
    #Loop through each Site Collection and output the required properties
    Foreach ($CDB in (Get-SPContentDatabase))
    {
    $Info =
    $CDB.Name,
    $CDB.Server,
    $CDB.WebApplication.Url,
    $CDB.CurrentSiteCount,
    $CDB.MaximumSiteCount,
    ($CDB.DiskSizeRequired /1MB),
    $Info -join "," | Out-File -Encoding default -Append -FilePath $Output
    }

    Below is an example of the CSV file created.


    Site Collection Inventory

    This script outputs details of all Site Collections within a SharePoint farm to a CSV file, this includes the following information:

    • URL
    • Owner
    • Content database the Site is stored within
    • Number of users
    • Size (MB)
    • Template
    • Number of sub-sites (Webs)
    • Certification date (useful if Site Confirmation and Deletion is turned on)

    Prior to running the script please update highlighted with the location to store the output CSV file.

    asnp *SharePoint* -ErrorAction SilentlyContinue
    #Configure output location for CSV file
    $Output = "D:\SiteInventory.csv"
    #Create headings in the CSV file
    $Headings = "URL","Owner","Content DB","Total Users","Storage Used (MB)",
    "Template","Number of Webs","Certification Date"
    $Headings -join "," | Out-File -Encoding default -FilePath $Output
    #Loop through each Site Collection and output the required properties
    Foreach ($S in (Get-SPSite -Limit All))
    {
    $Info =
    $S.URL,
    $S.Owner,
    $S.ContentDatabase.Name,
    $S.RootWeb.SiteUsers.Count,
    ($S.Usage.Storage /1MB),
    ($S.RootWeb.WebTemplate + "#" + $S.RootWeb.WebTemplateId),
    $S.AllWebs.Count,
    $S.CertificationDate
    $Info -join "," | Out-File -Encoding default -Append -FilePath $Output
    $S.Dispose()
    }

    Below is an example of the CSV file created.

    Brendan Griffin - @brendankarl