I’m excited to share a new PowerShell script I’ve developed that dives into Microsoft Teams presence data and generates a graphical report. This script allows you to analyze user presence within your tenant over the past week, offering valuable insights into how your teams are engaging and collaborating.
Understanding user presence in Microsoft Teams can be incredibly useful. Whether you’re looking to optimize meeting schedules, understand team workload distribution, or simply gain a better overview of communication patterns, having access to this data can be a game-changer. While Teams offers real-time presence information, historical data can be harder to come by. That’s where this script comes in.
What does the script do?
This PowerShell script connects to your Microsoft Teams environment and retrieves presence data for all users over the last seven days. It then processes this data and generates a graphical report visualizing each user’s presence status throughout the week. This provides a clear, at-a-glance view of presence trends.
Key Features and Benefits:
- Historical Data: Analyze presence trends over a full week, not just the current status.
- Per-User Breakdown: See detailed presence information for each user in your tenant.
- Graphical Reporting: Visualize the data with easy-to-understand charts and graphs, making analysis a breeze.
- Insights into Collaboration: Gain a better understanding of how your teams are interacting and when they’re most active.
- Optimized Scheduling: Use the data to inform meeting schedules and ensure maximum participation.
- Workload Management: Identify potential imbalances in workload distribution based on presence patterns.
How it Works (High-Level):
The script leverages the Microsoft Graph API to access Teams presence information. It authenticates with your tenant, retrieves the necessary data for each user, and then processes it to create the graphical report. The report can be customized to include specific metrics or visualizations as needed.
Technical Details (for the curious):
- PowerShell Modules: The script utilizes the Microsoft Graph PowerShell SDK.
- Authentication: You’ll need to authenticate with your Microsoft 365 credentials.
Download the Script
As always, although I have tested and used the script several times, I cannot and will not accept any liability for the use of this script.
Readers who download the script are free to customize it according to their needs. Commercial use is allowed, but monetarization requires my explicit permission.
More about the Script
The script can be executed directly “out of the box” without any adjustments.
When the script is executed, it first checks whether the PowerShell module “Microsoft.Graph” is installed.
If this is not the case, the corresponding module is installed.
At this point it is recommended to start the script in administrator mode.
The following modules are then loaded:
- Microsoft.Graph.Authentication
- Microsoft.Graph.Users
- Microsoft.Graph.Presence
During the execution of the script, the login to the Microsoft 365 tenant also takes place. The following authorizations are requested for MS Graph:
- User.Read.All
- Presence.Read.All
Now the script is executed and shortly before completion, a Windows Explorer window opens, which is used to select the location where the HTML report should be saved.
Finally, the script logs off from the tenant and the report is available to you.
Example output report
To give you an idea of what such a report might look like, I have provided an excerpt of an example here:
A block is displayed in the report for each user account, as shown in the picture as an example.
The full name, the e-mail address and the current status are shown first.
This is followed by the status of the entire working week in 24 hours, including a summary.