Wednesday, 30 December 2015

Office 365 License Vs Usage Report with Powershell

Office 365 introduced the new reporting powershell cmdlet Get-LicenseVsUsageSummaryReport to retrieve a summary report that identifies the number of active users across each installed software licenses (Exchange Online, SharePoint Online, Skype for Business Online, and Microsoft Yammer).

Note: Before proceed, Connect Exchange Online Remote PowerShell.

The following command gets a summary report of the number of entitled users for the workload, the number of provisionally entitled (trial) users for the workload and the count of active licensed users.
Get-LicenseVsUsageSummaryReport

Export License Vs Usage Summary Report:

Use the below powershell command to export the license vs usage summary report to CSV file.
Get-LicenseVsUsageSummaryReport | Select Date,TenantGuid,Workload,NonTrialEntitlements,TrialEntitlements,ActiveUsers |
Export-CSV "C:\\LicenseVsUsageSummaryReport.csv" -NoTypeInformation -Encoding UTF8

Sample License Usage Report:

Office 365 License Vs Usage Report with Powershell

Tuesday, 29 December 2015

Create Office 365 Mailbox with Powershell

We can use the office 365 exchange powershell cmdlet New-Mailbox to create new mailbox, this command also creates an office 365 user account along with mailbox.

Note: Before proceed, Connect Exchange Online Remote PowerShell.

The below script creates an Exchange Online mailbox and Office 365 user account for the user Steve Smith. The optional parameter ResetPasswordOnNextLogon will require the user to reset their password the first time they sign in to Office 365.
New-Mailbox -Alias ssmith -Name ssmith -FirstName Steve -LastName Smith -DisplayName "Steve Smith" -MicrosoftOnlineServicesID ssmith@mts.onmicrosoft.com -Password (ConvertTo-SecureString -String 'MyP@ssw0rd' -AsPlainText -Force) -ResetPasswordOnNextLogon $true
After the mailbox creation, you will get below warning message
WARNING: After you create a new mailbox, you must go to the Office 365 Admin Center and assign the mailbox a license,
or it will be disabled after the grace period.
Once you created a mailbox by running this script, you have to activate this user account by assigning a license. To assign a license, refer this article: Manage Office 365 License with Powershell