veltwerk/Repair-Class-teams — reverse-engineered prompt
Reverse engineered prompt
Build me a PowerShell script for Microsoft 365 school admins that repairs older Class Teams that were created with the deprecated education template and now have broken classwork, assignments, file uploads, or OneNote notebook features.
The script should be interactive and safe enough for an admin to run manually. It should ask for an admin user principal name, connect to Microsoft Graph, check for the needed Graph modules, find M365 groups that are Teams with hidden membership, then let me filter them by mail nickname and choose the exact teams to repair in a grid view.
For each selected team, make the admin account an owner temporarily, grant the required education apps full control on that team’s SharePoint site so assignments, notebooks, files, calendar, and OneNote work again, then remove the admin owner afterward. At the end, write a CSV report of what was repaired and open it.
Please include clear console messages, basic error handling, and a warning that this changes SharePoint permissions and should be used carefully.
Want more depth? Deep Reverse