# 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.

!!!warning 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 {#source-5efc65999514962c}

To get started see [MS Graph Basics - User Properties](../../review/Review-status.md#source-3987821147ed7fa3)

## Find Recently Created Users {#source-f308b652360a0e15}

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:**

1.  **Set \$schoolDomain** to the email domain for your school
2.  **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

!!!warning 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 {#source-2bac9a46a49a7c6f}

To get started see [Exchange Online Basics](../../review/Review-status.md#source-5ceb663b9144bd8b)

## Teams GroupClass Management - Get All Teams From M365 {#source-dbdbbfd2d693db87}

This powershell will return all the M365 Teams/Groups created by Teams Create Script.

``` powershell
Connect-MgGraph
```

``` powershell
$JTGroups = Get-MgBetaGroup -All -Filter "extension_fe2174665583431c953114ff7268b7b3_Education_CreatedByUserId eq 'c9c52a29-da16-49bb-aaf1-2808c91d8a87'" -ConsistencyLevel "eventual" -CountVariable $count
```

## Related guidance

- [Topic overview](Introduction.md)
- [Source review status](../../review/Review-status.md)
