Microsoft 365 PowerShell reference fragments
Find the captured Graph, Exchange and Teams PowerShell starting points. Some source guides are held, and the recently-created-user note describes inputs without supplying a complete query.
Source-derived reference
These notes were recovered from OneNote. Configuration, permissions and operating results have not been freshly verified. Confirm the applicable authority and environment before acting.
Microsoft Graph Module
To get started see MS Graph Basics - User Properties
Find Recently Created Users
This code will find M365 user accounts that were created in the last 14 days.
Note: It will filter out (aka not include) accounts that are missing their employeeId.
HOW TO USE:
- Set $schoolDomain to the email domain for your school
- Optionally: Adjust $numberOfDays to increase or decrease the number of days in the past to search.
The note says the intended result includes staff and student accounts. It supplies no complete query in this fragment, so the stated result cannot be verified here.
Image alternative text: web content
Missing source images
1 image record(s) in this source have no resolved payload. Available alternative text is retained; the missing pixels have not been recreated.
Exchange Online Module
To get started see Exchange Online Basics
Teams GroupClass Management - Get All Teams From M365
This powershell will return all the M365 Teams/Groups created by Teams Create Script.
Connect-MgGraph
$JTGroups = Get-MgBetaGroup -All -Filter "extension_fe2174665583431c953114ff7268b7b3_Education_CreatedByUserId eq 'c9c52a29-da16-49bb-aaf1-2808c91d8a87'" -ConsistencyLevel "eventual" -CountVariable $count