Forum Discussion

gwestergren's avatar
gwestergren
Occasional Reader
Jun 03, 2026

PowerShell: Export Microsoft 365 Copilot Agent Inventory and Availability Assignments

Hi everyone,

 

I needed a way to export Microsoft 365 Copilot agent inventory and availability assignments from the Microsoft 365 Admin Center, but couldn't find a built-in export option.

 

After investigating the admin portal's network traffic, I built a PowerShell script that uses the same internal API consumed by the Microsoft 365 Admin Center to export all Copilot agents to CSV.

 

### Features

 

- Exports all Microsoft 365 Copilot agents

- Automatically follows pagination (`nextLink`)

- Exports:

- Agent Name

- App ID

- Title ID

- Publisher

- Created By

- Availability Settings

- Allowed Users / Groups

- Assignment Information

- Deployment Information

- Version Information

- Timestamps

- CSV output

 

### Tested

 

The script has been tested against a tenant containing 482 Copilot agents and successfully exported the complete inventory.

 

### GitHub

 

https://github.com/gwestergren/M365-Copilot-Agent-Inventory

 

### Notes

 

- Uses an authenticated browser session cookie from the Microsoft 365 Admin Center.

- Uses the same internal API currently consumed by the admin portal.

- This is an undocumented API and Microsoft may change it at any time.

 

Feedback, testing results, and improvements are welcome.

 

Here are some screen shots:

 

output to csv

 

Successful run of the script

 

No RepliesBe the first to reply