Monday, June 9, 2014

Configuring OneDrive for Business Use in SharePoint 2013


       1- Blocking File Types:
a. Central Administration > Manage Web Applications > The MySite Web Application > “Blocked File Types” from the ribbon.
b. Add the extension you want in a new line.

              2- Quota Limit Per User:
a. Create Personal Quota template.
b. Change Quota template for the Site Collection of the user
Central Admin > Application Management > Site Collections > Configure quotas and locks, or if you have large number of sites then use this PowerShell;

$SPWebApp = Get-SPWebApplication http://MySite

foreach ($SPSite in $SPWebApp.Sites)
{
    if ($SPSite -ne $null)
    {
        Set-SPSite -Identity $SPSite.url -QuotaTemplate "Quota Template Name"
        $SPSite.Dispose()
    }
}

             3- Set max upload size:
a. Central Admin > Manage Web Applications > The MySite Web Application > “General Settings” from the ribbon.
b. In the “Maximum upload size”, add the size.

Wednesday, June 4, 2014

Get SharePoint 2013 Site Collection Size Using PowerShell

I was trying to get the usage size for one of the SharePoint personal sites, and I ended up with this script.
The script is for getting all site collections usage compared to its maximum size, sorted by size of the Site Collections and the output to a HTML file.

$a = "<style>"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 1px;border-style: solid;border-color: black;}"
$a = $a + "TD{border-width: 1px;padding: 1px;border-style: solid;border-color: black;}"
$a = $a + "</style>"

Get-SPSite -Limit All | select url, @{label="Size in MB";Expression={$_.usage.storage/1MB}},@{label="Capacity";Expression={$_.Quota.StorageMaximumLevel/1MB}} | Sort-Object -Descending -Property "Size in MB" | ConvertTo-Html -Head $a -title "Site Collections sorted by size" | Set-Content sc.html


Cheers,