Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

May 2015

Office 365 – Monitor site collection storage (PS1 daily email)

I wrote the below PowerShell script to gather site collection storage data for any Office 365 tenant.  This PS1 could be scheduled daily for a quick email to keep an eye on sites approaching storage limits.

Hope this helps! 

shades_smile

 

5-18-2015 8-47-11 PM
# Plugin
Import-Module Microsoft.Online.SharePoint.PowerShell -ErrorAction SilentlyContinue

# Config -- get URL from "Tenant Admin" page in Office 365
$url	= "https://company-admin.sharepoint.com"
$user	= "admin@company.com"
$smtp	= "mailrelay"

# Connect
Connect-SPOService -url $url -credential $user

# Gather data
$sites = Get-SPOSite -Detailed
$coll = @()
foreach ($s in $sites) {
	$curr = $s.StorageUsageCurrent
	$quota = $s.StorageQuota
	if ($quota -eq 0) {
		$prct = [math]::Round($curr, 2) * 100
	} else {
		$prct = [math]::Round($curr/$quota, 2) * 100
	}
	$surl = $s.Url
	$coll += New-Object -TypeName PSObject -Prop (@{'curr'=$curr;'quota'=$quota;'prct'=$prct;'surl'=$surl})
}
$coll = $coll | sort prct -Desc
	
# Format HTML
$html = ""
foreach ($c in $coll) {
	$row = "" -f $c.surl, $c.curr, $c.quota, $c.prct
	$html += $row
}
$html += "

URL Current (MB) Quota (MB) Percent
{0} {1} {2} {3} %
 
" # Send email Send-MailMessage -To $user -From $user -Subject "Office 365 Storage" -Body $html -BodyAsHtml -SmtpServer $smtp

What’s in that patch? SharePoint 2013 – May 2015 CU

Ever wondered what fixes are inside of a given CU?   Please see attached PDF with 6 pages of full detail.

I wanted a new format for easy reading.   Show management and make the business case for why downtime should be taken to apply CUs.

 

As much time as I spend patching SharePoint even I never really dig into KB article fix detail.   However, this makes it easier to see everything without obscure click from one Microsoft article to the next buried layers deep.  If you found this helpful, please leave a comment.   

shades_smile_thumb_thumb_thumb

 

Whats in that patch – SharePoint 2013 – May 2015 CU.PDF

What’s in that patch? SharePoint 2013 – Apr 2015 CU

Ever wondered what fixes are inside of a given CU?   Please see attached PDF with 6 pages of full detail.

I wanted a new format for easy reading.   Show management and make the business case for why downtime should be taken to apply CUs.

 

As much time as I spend patching SharePoint even I never really dig into KB article fix detail.   However, this makes it easier to see everything without obscure click from one Microsoft article to the next buried layers deep.  If you found this helpful, please leave a comment.   

shades_smile_thumb_thumb

 

Whats in that patch – SharePoint 2013 – Apr 2015 CU.PDF

What’s in that patch? SharePoint 2013 – Mar 2015 CU

Ever wondered what fixes are inside of a given CU?   Please see attached PDF with 7 pages of full detail.

I wanted a new format for easy reading.   Show management and make the business case for why downtime should be taken to apply CUs.

 

As much time as I spend patching SharePoint even I never really dig into KB article fix detail.   However, this makes it easier to see everything without obscure click from one Microsoft article to the next buried layers deep.  If you found this helpful, please leave a comment.   

shades_smile_thumb

 

Whats in that patch – SharePoint 2013 – Mar 2015 CU.PDF

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲