๐งช Lab Tenant Data Seeder¶
Status: ๐ข First run complete | Last run: 2026-04-08
Purpose: Generate realistic M365 usage data in the lab tenant so admin reports, Copilot Readiness, and dashboards show meaningful data for demos
Reusable: Yes โ run this playbook whenever you move to a new lab tenant
Why This Exists¶
Lab/demo tenants start empty โ the M365 Admin Center usage reports (Email Activity, Teams Activity, M365 Apps Usage, Copilot Readiness) all show zero data unless real user interactions happen. This playbook generates enough activity across multiple users to populate all key reports within 24-48 hours.
Quick Reference¶
| Item | Value |
|---|---|
| Current lab tenant | M365CPI52224224.onmicrosoft.com |
| Admin account | admin@M365CPI52224224.onmicrosoft.com |
| Primary personas | MOD Admin, Amber Rodriguez, Sonia Rees, Eka Siahaan, Robin Kline |
| Supporting cast | Corey Gray, Dakota Sanchez, Lisa Taylor, Kai Carter, Omar Bennett |
| Total lab users | 43 (incl. conf rooms & service accounts) |
| Reports location | M365 Admin Center โ Reports โ Usage |
| Data latency | 24-48 hours for most reports; Copilot Readiness recalculates weekly |
Architecture¶
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DATA SEEDER โ
โ โ
โ Phase 1: PowerShell Script (automated) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Microsoft Graph API โ โ
โ โ โโโ POST /sendMail โ Email Activity โ โ
โ โ โโโ POST /events โ Calendar Activity โ โ
โ โ โโโ PUT /drive/items โ OneDrive Activity โ โ
โ โ โโโ POST /chats/messages โ Teams Chat Activity โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ Phase 2: Manual Blitz (10 min, you) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Browser logins as 4-5 different users โ โ
โ โ โโโ Open Outlook web โ M365 Apps Usage โ โ
โ โ โโโ Open Word web โ M365 Apps Usage โ โ
โ โ โโโ Open Excel web โ M365 Apps Usage โ โ
โ โ โโโ Open PowerPoint web โ M365 Apps Usage โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โผ 24-48 hours later โผ โ
โ โ
โ ๐ M365 Admin Center Reports populated โ
โ ๐ Copilot Readiness "Suggested candidates" populated โ
โ ๐ Viva Insights Copilot Dashboard populated โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
What Gets Populated¶
| Report | Phase 1 (Script) | Phase 2 (Manual) | Notes |
|---|---|---|---|
| Email Activity | โ | โ | sendMail via Graph counts as real sends |
| Teams Chat Activity | โ | โ | Graph chat messages count |
| OneDrive/SharePoint Activity | โ | โ | File uploads and edits count |
| Calendar/Outlook Activity | โ | โ | Calendar event creation counts |
| M365 Apps Usage (app opens) | โ | โ | Needs real app interaction in browser |
| Copilot Readiness ("Suggested candidates") | Partial | โ | Combines email + Teams + app usage signals |
| Active Users report | โ | โ | Both contribute |
Lab Personas Reference¶
Your go-to users for demos and testing. The script targets these first.
Primary Personas (your daily drivers)¶
| Name | UPN | Role in demos |
|---|---|---|
| MOD Administrator | admin@M365CPI52224224.onmicrosoft.com |
Global Admin โ admin center, policies, reports |
| Amber Rodriguez | AmberR@M365CPI52224224.OnMicrosoft.com |
Power user โ heavy Outlook, Word, Excel, PPT |
| Sonia Rees | SoniaR@M365CPI52224224.OnMicrosoft.com |
Collaborator โ Teams chat, shared docs, meetings |
| Eka Siahaan | EkaS@M365CPI52224224.OnMicrosoft.com |
Data analyst โ Excel heavy, OneDrive, SharePoint |
| Robin Kline | RobinK@M365CPI52224224.OnMicrosoft.com |
Manager โ calendar, Teams meetings, approvals |
Supporting Cast (background activity)¶
| Name | UPN | Used for |
|---|---|---|
| Corey Gray | CoreyG@M365CPI52224224.OnMicrosoft.com |
Email recipient, meeting attendee |
| Dakota Sanchez | DakotaS@M365CPI52224224.OnMicrosoft.com |
Email recipient, file collaborator |
| Lisa Taylor | LisaT@M365CPI52224224.OnMicrosoft.com |
Teams chat partner |
| Kai Carter | KaiC@M365CPI52224224.OnMicrosoft.com |
Meeting attendee, email recipient |
| Omar Bennett | OmarB@M365CPI52224224.OnMicrosoft.com |
Background email & chat activity |
Prerequisites¶
Before running the script, you need:
1. App Registration in Entra ID¶
Create an app registration with application permissions (not delegated) so the script can act on behalf of all users.
- Go to Entra Admin Center โ App registrations โ New registration
- Name:
Lab Data Seeder - Supported account types: Single tenant
- After creation, note the:
- Application (client) ID
- Directory (tenant) ID
- Go to Certificates & secrets โ New client secret โ copy the Value
- Go to API permissions โ Add the following Application permissions:
| Permission | Type | Why |
|---|---|---|
Mail.Send |
Application | Send emails as any user |
Calendars.ReadWrite |
Application | Create calendar events |
Files.ReadWrite.All |
Application | Upload files to OneDrive |
Chat.Create |
Application | Create Teams chats |
Chat.ReadWrite.All |
Application | Send chat messages |
User.Read.All |
Application | List users for the script |
- Click Grant admin consent for the tenant
2. PowerShell Prerequisites¶
# No extra modules needed โ uses Invoke-RestMethod with raw Graph API
# Just need PowerShell 7+ (already installed)
Phase 1: The Script¶
Step 1: Set Your Credentials¶
Create a file at C:\ssClawy\learning-docs\scripts\lab-seeder-config.json (โ ๏ธ gitignored):
{
"tenantId": "YOUR-TENANT-ID",
"clientId": "YOUR-APP-CLIENT-ID",
"clientSecret": "YOUR-CLIENT-SECRET",
"domain": "M365CPI52224224.onmicrosoft.com"
}
Security
Never commit this file to git. Add scripts/lab-seeder-config.json to .gitignore.
Step 2: Run the Seeder Script¶
Step 3: What the Script Does¶
The script runs through these stages:
Stage 1/4: ๐ง Sending emails
Primary personas (Admin, Amber, Sonia, Eka, Robin) send 5 emails each
Supporting cast (Corey, Dakota, Lisa, Kai, Omar) send 3 each = ~40 emails
Realistic subjects: "Q3 Budget Review", "Project Kickoff", "Meeting Notes"
Stage 2/4: ๐
Creating calendar events
Amber organises meetings with Sonia + Eka + Robin
Admin creates all-hands with 8 attendees = ~15 events
Realistic titles: "Sprint Planning", "Design Review", "Weekly Sync"
Stage 3/4: ๐ Uploading documents to OneDrive
Each primary persona gets Word + Excel + PPT files
Supporting cast get Word + Excel files = ~30 files
Real file content (not empty) for authentic activity
Stage 4/4: ๐ฌ Sending Teams chat messages
Amber โ Sonia, Eka โ Robin, Admin โ Amber, etc.
~40 messages across 1:1 chats
Realistic content: project discussions, quick questions
The Script (Seed-LabData.ps1)¶
Script is ready
The full script is at C:\ssClawy\learning-docs\scripts\Seed-LabData.ps1 โ see the source for full details. It handles auth, error handling, progress logging, and skip flags.
Key features:
- Runs all 4 stages automatically (~3-5 minutes)
- Skip individual stages:
-SkipEmails,-SkipCalendar,-SkipFiles,-SkipTeams - Realistic content (budget reviews, sprint planning, compliance docs)
- Rate-limited (500ms between API calls) to avoid throttling
- Clear progress output with โ /โ per action
- Summary stats at the end
Phase 2: Manual Blitz (10 Minutes)¶
This step is needed because M365 Apps Usage reports track actual app opens in the browser/desktop, which can't be faked via API.
Quick Login Checklist¶
Log into each of your 5 primary personas in a private/incognito browser window. Spend ~2 minutes per user.
| # | User | UPN | Apps to open |
|---|---|---|---|
| 1 | MOD Administrator | admin@M365CPI52224224.onmicrosoft.com |
Outlook + Word + Excel |
| 2 | Amber Rodriguez | AmberR@M365CPI52224224.OnMicrosoft.com |
Outlook + Word + Excel + PowerPoint |
| 3 | Sonia Rees | SoniaR@M365CPI52224224.OnMicrosoft.com |
Outlook + Word + Teams chat |
| 4 | Eka Siahaan | EkaS@M365CPI52224224.OnMicrosoft.com |
Outlook + Excel + PowerPoint |
| 5 | Robin Kline | RobinK@M365CPI52224224.OnMicrosoft.com |
Outlook + Word + Teams chat |
Quick links to open for each user:
| App | URL |
|---|---|
| Outlook | outlook.office.com |
| Word (new doc) | word.new |
| Excel (new sheet) | excel.new |
| PowerPoint (new deck) | powerpoint.new |
| Teams | teams.microsoft.com |
What to do in each app (keep it quick):
- Outlook โ Read an email, compose and send a reply to another lab user
- Word โ Type a few sentences, save to OneDrive
- Excel โ Enter some numbers, add a SUM formula, save
- PowerPoint โ Add a title slide with text, save
- Teams โ Send a chat message to another lab user
Pro tip
Use Edge profiles โ create a profile for each persona so you can stay logged in permanently. Much faster than InPrivate windows.
Password for Lab Users¶
Lab tenant users typically share the same default password. Check your lab provisioning email or the M365 Admin Center โ Users โ Reset password.
Verification¶
After 24-48 hours, check these reports:
Reports to Verify¶
| Report | How to check | What to look for |
|---|---|---|
| Email Activity | Admin Center โ Reports โ Usage โ Email activity | Send/receive counts for lab users |
| M365 Apps Usage | Admin Center โ Reports โ Usage โ M365 Apps โ Usage | Active users across Outlook, Word, Excel, PPT |
| Active Users | Admin Center โ Reports โ Usage โ Active Users | Multiple users showing activity |
| Teams Activity | Admin Center โ Reports โ Usage โ Teams user activity | Chat message counts |
| Copilot Readiness | Admin Center โ Reports โ Usage โ M365 Copilot โ Readiness tab | "Suggested candidate for Copilot" column populated |
Quick Verification Command¶
Use the lab admin tools in Copilot CLI:
"Check the M365 admin center for email activity reports in my lab tenant"
โ Uses m365-admin-graph tools to query
Re-Running on a New Lab Tenant¶
When you get a new lab environment (every ~90 days):
- Update the config file with new tenant ID, client ID, and secret
- Re-create the app registration (Step 1 in Prerequisites) โ or export/import it
- Run the script โ
.\Seed-LabData.ps1 - Do the manual blitz โ 10 minutes across 4-5 users
- Wait 24-48 hours โ reports populate
Save time on new tenants
Keep the app registration manifest exported as JSON so you can import it into the new tenant instantly instead of recreating permissions manually.
Troubleshooting¶
| Issue | Solution |
|---|---|
401 Unauthorized |
Admin consent not granted โ go to Entra โ App registration โ Grant admin consent |
403 Forbidden on sendMail |
Mail.Send application permission missing or not consented |
403 Forbidden on Teams chat |
Teams chat application permissions require Resource-Specific Consent (RSC) policy enabled in Teams Admin Center. This is a stricter security gate than standard Graph permissions. See RSC docs. Not critical โ email + calendar + files cover the most important reports. |
| Reports still empty after 48h | Check user has an active M365 license (Admin Center โ Users) |
| Copilot Readiness tab not visible | Need at least one Copilot license purchased on the tenant |
| Client secret looks like a GUID | You may have copied the Secret ID instead of the Value. The Value is only shown once at creation time โ create a new secret if needed. |
Run History¶
| Date | Tenant | Results | Notes |
|---|---|---|---|
| 2026-04-08 | M365CPI52224224 |
๐ง 40 emails โ ยท ๐ 12 events โ ยท ๐ 30 files โ ยท ๐ฌ 0 chats โ | First run. Teams chat blocked by RSC policy (403). Phase 2 manual blitz pending. |