This PowerShell script helps you uninstall Copilot Agents.
- Teams Toolkit CLI:
npm install -g @microsoft/teamsapp-cli
- Open M365 Copilot in Browser.
- Press F12 to open the Developer Tools.
- Go to Network tab, filter with
GetGptList
, refresh the web page. - Find the request named
GetGptList?request=...
. - Click on the request, go to Preview tab, right click the response body, and select Copy value.
- Paste the value into
GptList.json
file. - Navigate to the directory containing the Uninstall-Agents.ps1 script.
- Run the script:
.\Uninstall-Agents.ps1
Notes:
- You can add agent names to the
$whiteList
array to skip uninstalling them. - This script will uninstall all agents owned by the current user except the ones in the white list.