Why Automate License Tracking?
If your organization provisions licenses (like Copilot for M365, ChatGPT Enterprise, Power BI Pro, Teams Premium, etc.) using Microsoft 365 groups, keeping track of how many users are assigned each license can be tedious. Manual counting is error-prone and time-consuming. Automating this process with Power Automate ensures accurate, up-to-date reporting—perfect for compliance, budgeting, and capacity planning.
Solution Overview
We’ll build a Power Automate flow that:
- Runs daily (or on your preferred schedule)
- Queries Microsoft Graph for the member count of each license group
- Writes these counts to a SharePoint list for easy reporting and dashboarding
Prerequisites
- Microsoft 365 Admin Center access (to identify license groups)
- SharePoint site with a list for storing license counts
- Power Automate permissions
- Graph API permissions (for group/member queries)
Step-by-Step Guide
1. Prepare Your SharePoint List
Create a SharePoint list with columns for each license you want to track. Example columns:
- Title (Date/time stamp)
- CopilotforM365
- ChatGPTEnterprise
- PowerBIPro
- PlannerPlan1
- ProjectPlan3
- VisioPlan2
- TeamsPremium
- Box.com
- Miro
- Multi-Geo
2. Identify Your License Groups
In the M365 admin center, note the group IDs for each license provisioning group. You’ll need these for the Graph API calls.
3. Build the Power Automate Flow
a. Trigger: Recurrence
Set the flow to run daily at midnight (or your preferred interval).
b. Actions: Get Group Member Counts
For each license group, use the HTTP request to Graph API to get the member count:
- Endpoint:
https://graph.microsoft.com/v1.0/groups/{group-id}/members/$count?$filter=userType eq 'Member'- Method: GET
- Headers:
ConsistencyLevel: eventual
Repeat for each group you want to track.
c. Action: Write to SharePoint
After collecting all counts, create a new item in your SharePoint list:
- Title: Current date/time
- Each license column: The count from the previous step
Example Flow Structure
- Trigger: Recurrence (daily)
- Actions:
- Get Copilot group member count
- Get ChatGPT group member count
- Get Power BI Pro group member count
- ... (repeat for all license groups)
- Final Action: Create item in SharePoint list with all counts
4. Flow Logic (Sample)
Here’s a simplified logic outline based on the actual flow definition:
5. Tips & Best Practices
- Error Handling: Add error handling to ensure the flow doesn’t fail if a group is missing or API call fails.
- Permissions: Make sure your flow’s service account has permissions to read group membership and write to SharePoint.
- Scheduling: Adjust the recurrence trigger as needed for your reporting cadence.
- SharePoint List Views: Create views and dashboards in SharePoint to visualize license trends over time.
Sample Use Cases
- Monthly License Audits: Quickly see how many users are assigned each license.
- Capacity Planning: Track growth and anticipate license needs.
- Compliance: Maintain historical records for audits.
Conclusion
Automating license tracking with Power Automate and SharePoint saves time, reduces errors, and provides actionable insights for M365 admins. With this approach, you’ll always have up-to-date license counts at your fingertips.
