Get last logon times for all Exchange Online users

If you want to figure out when your users last logged on, perhaps to clean up licenses in use by dormant accounts, the following Powershell code may help you.


########
#checkLastLogonTimes
#Copyright: Free to use, please leave this header intact
#Author: Jos Lieben (OGD)
#Company: OGD (http://www.ogd.nl)
#Purpose: Generate a CSV file with last logon times of all Office 365 users
########

$csv = "c:\temp\LastLogons_$(Get-Date -format dd_MM_yyyy).csv"
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
$users = get-mailbox -ResultSize Unlimited | select UserPrincipalName
Foreach ($user in $users){
$mbx = get-mailboxstatistics -Identity $($user.UserPrincipalName) | Select LastLogonTime
$upn = $user.UserPrincipalName
if ($mbx.LastLogonTime -eq $null){
$res = "Never"
}else{
$res = $mbx.LastLogonTime
}
$outStr = "$upn,$res"
Out-File -FilePath $csv -InputObject $outStr -Encoding UTF8 -append
}

Sharepoint Online going from 10GB to 1TB (+500MB) per tenant

Do you remember Microsoft raised the maximum storage in Sharepoint Online to 1TB last year?

Well, if you look at the Office 365 roadmap, Microsoft has announced it is also increasing the FREE storage each tenant gets by default to 1TB (from 10GB) in Sharepoint Online. The additional SP Online storage per licensed user remains the same at 500MB / user.

That could save us up to 200$ / month 🙂