# Manage Teams classes and policies — reference notes

Find the Teams Management class-count, test-run and report references. Some examples depend on custom functions or a report-location note that remains held.

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

## Count Edumate Classes By School For Current Year {#source-cefe1389bfa19c48}

**Custom-function example:** Calls Edumate API for each school collecting their Class information.

The Group-Object counts all the teams for each school based on the derived x_school_first_name attribute.

Get-AllSchoolClassesFromEdumate \| Where-Object {\$*.class_name -notlike "*Assembly*" -and \$*.class_name -notlike "*Chapel*" -and \$*.class_name -notlike "*Study*" -and \$*.class_code -notlike "Duty\*" -and \$\_.course_name -notlike "*Buses*"} \| Group-Object x_school_first_name

## Test Run of the Script {#source-669c6dffa4985632}

``` powershell
$groupUpdateResults_16Jan2026 = Update-TeamsManagerApp -quiet -testonly
```

measure-command {\$groupUpdateResults_16Jan2026_161801 = Update-TeamsManagerApp -quiet -testonly}

## View All Script Managed Teams/M365 Classes/Groups {#source-4156cbf58431ec90}

In the [IT Manager Report Folders](../../review/Review-status.md#source-e157177f423b9b7e) for your school you can access a current list of your classes/Teams from M365 inside a report that looks like \<insert school short name\>\_M365_ClassesAndMembers.csv

**Example** Livingstone: LIVCC_M365_ClassesAndMembers.csv

**Example** from Chinchilla: CHICC_M365_ClassesAndMembers.csv

## Get All Users Object (Teams Admin) {#source-fe01556718f39824}

``` powershell
Get-CsOnlineUser returns a list of Teams user objects from Team Administation.
```

**\#Get All Users From Teams Management** \#May take a minute to run. \$allusers = Get-CsOnlineUser

**\#Excluding (Filtering Out) Users by AccountType**

``` powershell
$allusersA = Get-CsOnlineUser -Filter {AccountType -ne 'Guest'}
```

``` powershell
$allusersB = Get-CsOnlineUser -Filter {$null -eq SoftDeletionTimestamp}
```

``` powershell
$allusersC = Get-CsOnlineUser -Filter {AccountType -ne 'IneligibleUser'}
```

\#Show Properties of first user from list of \$allusers \$alluser \| Select-Object -First 1

[Screenshot retained for review](../../review/Review-status.md#asset-6c3e59f3f6a07d409647)

## Related guidance

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