Unlocking Savings: How to Optimize Your Microsoft Agreement
When you want to optimize your license cost you need to understand your current and future use of the technology.
In other words, “DATA IS KEY!” Data is your golden nugget.
Most organizations think that they need expensive and fancy tooling. It certainly saves you time, but without an investment in a tool you are able to get your data too.
In this blog and video, we will show you how to export the M365 usage reports and how to analyze them.
Data Exports
Before you are able to analyze the data and optimize you licenses we need to make a few data exports out of you Microsoft 365 tenant.
Which rights do I need?
For the license and usage information you need to be an admin in the tenant. There are several roles. The role you need for these data insights are Usage Summary Reports Reader, License Admin and Exchange admin.
Please also ask your global admin to uncheck “Display concealed user, group and site names in all reports.
- Make sure to be still logged in to the Microsoft 365 Admin Center as an Admin: https://admin.microsoft.com/
- Go to Settings –> Org Settings –> Services –> Reports, and be sure “Display concealed user, group and site names in all reports” is unchecked and save: https://admin.microsoft.com/Adminportal/Home?source=applauncher#/Settings/Services/:/Settings/L1/Reports
User and license export
- Log in to the Microsoft 365 Admin Center as an Admin: https://admin.microsoft.com/
- Go to Users –> Active Users: https://admin.microsoft.com/Adminportal/Home?source=applauncher#/users
- Select all users and click on “Export Users”:
- Go to Billing –> Licenses and Export the licenses overview: https://admin.microsoft.com/Adminportal/Home?source=applauncher#/licenses
Usage Exports
- Go to Reports –> Usage –> Microsoft 365 apps: https://admin.microsoft.com/Adminportal/Home?source=applauncher#/reportsUsage/ProPlusUsage
- Set the time period to 180 days and export the report at the bottom beneath the graphs.
- Please make the same export for “Usage” and “Active Users”: https://admin.microsoft.com/Adminportal/Home?source=applauncher#/reportsUsage/ProPlusUsage
To analyze the email activity, we go to “Exchange”
- Please go to Mailbox usage section and set the time period to 180 days and export at the bottom beneath the graphs.
- https://admin.microsoft.com/Adminportal/Home?source=applauncher#/reportsUsage/EmailActivity
- To analyze the OneDrive usage, we go to “OneDrive”. https://admin.microsoft.com/Adminportal/Home?source=applauncher#/reportsUsage/OneDriveSiteUsage
- Please go to the “Usage” section and set the time period to 180 days and export the report at the bottom beneath the graphs.
- Go to the Exchange Online Admin Center –> Mailboxes –> Export Mailboxes:
- Note: for this export you need to be an Exchange admin.
- https://admin.exchange.microsoft.com/#/mailboxes
Project / Visio
- Make an export of the active users dashboard.
Inactive Users
To receive the last login date information to determine the inactive users could be one via PowerShell script.
1. Install the Required PowerShell Module
First, you need to install the AzureAD module if you haven’t already. Open PowerShell as an administrator and run:
Install-Module AzureAD
2. Connect to Azure AD
Next, connect to your Azure AD tenant:
Connect-AzureAD
You’ll be prompted to enter your Microsoft 365 admin credentials.
3. Retrieve Last Login Information
You can use the Get-AzureADAuditSignInLogs
cmdlet to get the last login date for users. Here’s a basic script to get the last login date for all users and export it to a CSV file:
# Connect to Microsoft Graph
Connect-MgGraph -Scopes "User.Read.All", "AuditLog.Read.All"
# Initialize variables
$nextPage = $true
$requestUrl = "/beta/users?select=userPrincipalName,id,userType,signInActivity&top=100"
$csvFilePath = "C:\temp\UserLogins.csv"
# Loop through paged responses
while ($nextPage) {
Write-Host "." -NoNewline
# Get the current page of users
$response = Invoke-MgGraphRequest -Method GET -Uri $requestUrl
# Select the required properties
$userLogins = $response.value | Select-Object @{Name="UserPrincipalName";Expression={$_.userPrincipalName}},
@{Name="Id";Expression={$_.id}},
@{Name="UserType";Expression={$_.userType}},
@{Name="LastSignIn";Expression={$_.signInActivity.lastSignInDateTime}}
# Append the current page of results to the CSV file
$userLogins | Export-Csv -Path $csvFilePath -NoTypeInformation -Append
# Check if there is a next page
if ($response.'@odata.nextLink') {
$requestUrl = $response.'@odata.nextLink'
} else {
$nextPage = $false
}
}
# Output completion message
Write-Host "Export completed. The data has been written to $csvFilePath."
This script will export the user principal names and their last login dates to a CSV file1.
4. Run the Script
Save the script with a .ps1
extension, for example, Get-LastLoginDates.ps1
. To run the script, open PowerShell, navigate to the directory where the script is saved, and execute:
.\Get-LastLoginDates.ps1
How to analyze these reports?
You now have made all the exports and are able to analyze the data. We’ve made a step-by-step approach to analyze the data with the key outcome to optimize your licenses.
- User export:
Here we look for non-user’s accounts. For example, “fabric001” or “MeetingRoomAmsterdam” or Shared Accounts. There are more cost-effective ways to license these kinds of accounts.
- License export:
Here we look for the delta of the available vs usage licenses. All the unused licenses we could reduce in the contract to save cost.
- Usage exports:
We start with the Office apps. In the export you’re able to find per user if they have used the office application. We filter on 90 or 180 days not used. This will give us the potential list of optimizing M365 E3 or Office365 E3 to an E1 of F-type of license. Before we are able to do that, we analyze their email and OneDrive usage.