Skip to content

Instantly share code, notes, and snippets.

View garrytrinder's full-sized avatar
👨‍💻
CLI for Microsoft 365

Garry Trinder garrytrinder

👨‍💻
CLI for Microsoft 365
View GitHub Profile
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"position": {
"type": "string"
},
"value": {
{
"playstyles": [
{
"position": "GK",
"value": "Line Keeper",
"modifiers": [
{
"key": "overall",
"value": 3
},
@garrytrinder
garrytrinder / reset-env-values.ps1
Created November 24, 2023 10:08
Reset Teams Toolkit environment files
param (
[Parameter(Mandatory=$true)]
[string]$Path
)
# Define the files to search for
$filesToSearch = ".env.local", ".env.local.user", ".env.dev", ".env.dev.user"
# Define the keys to ignore
$keysToIgnore = "SPO_HOSTNAME", "SPO_SITE_URL", "APP_NAME_SUFFIX"
@garrytrinder
garrytrinder / remove-sideloaded-teams-apps.ps1
Last active November 24, 2023 09:23
Remove sideloaded Teams apps for the current user
# assumes you are logged into tenant using CLI for Microsoft 365 (https://aka.ms/cli-m365)
$apps = m365 teams user app list --userId "@meId" | ConvertFrom-Json
$apps | Where-Object { $_.teamsApp.distributionMethod -eq "sideloaded" } | ForEach-Object { m365 teams user app remove --id $_.id --userId "@meId" --force }
@garrytrinder
garrytrinder / remove-teams-org-apps.ps1
Last active November 24, 2023 09:23
Remove custom apps from the Teams organisation store
# assumes you are logged into tenant using CLI for Microsoft 365 (https://aka.ms/cli-m365)
$apps = m365 teams app list --distributionMethod organization | ConvertFrom-Json
$apps | ForEach-Object { m365 teams app remove --id $_.id --force }
@garrytrinder
garrytrinder / remove-outlook-apps.js
Last active November 24, 2023 09:18
Remove personal apps from Outlook web
(async (window) => {
const ootbApps = [
"Bookings",
"Files",
"Go to Excel",
"Go to OneNote",
"Go to PowerPoint",
"Go to Word",
"SurveyMonkey: Surveys for Feedback",
"Viva Engage"
@garrytrinder
garrytrinder / remove-bf-bots.js
Last active November 24, 2023 09:11
Remove all bots from dev.botframework.com
// Remove all bots from your account
// 1. Go to https://dev.botframework.com/bots
// 2. Open the console (F12)
// 3. Paste the following code and press enter
(async () => {
// select the first bot element
let bot = document.querySelector('.bot-content > a');
while (bot) {
// click the element link
@garrytrinder
garrytrinder / remove-az-resource-groups.ps1
Last active November 24, 2023 09:25
Remove all Azure Resource Groups
# assumes you are logged into azure subscription using Azure CLI (https://aka.ms/azcli)
az group list --query "[].name" -o tsv | ForEach-Object { az group delete --name $_ --yes --no-wait }
@garrytrinder
garrytrinder / remove-apps-from-tdp.js
Last active November 24, 2023 09:21
Remove apps from Teams Developer Portal
// Remove all apps from Teams Developer Portal
// 1. Open Teams Developer Portal (https://dev.teams.microsoft.com/apps)
// 2. Scroll down to the bottom of the page, loading all apps in the table
// 3. Open browser console (F12)
// 4. Manually delete one app from the table
// 5. Inspect the DELETE network request to get the bearer token
// 6. Paste this code into the console
// 7. Update the token variable with the bearer token
// 8. Run the code
@garrytrinder
garrytrinder / remove-aad-apps.ps1
Last active November 24, 2023 09:44
Remove Azure AD app registrations
# assumes you are logged into tenant using CLI for Microsoft 365 (https://aka.ms/cli-m365)
$notToRemove = @("app1","app2")
$apps = m365 aad app list | ConvertFrom-JSON
$apps | Where-Object { $_.displayName -notin $notToRemove } | ForEach-Object { m365 aad app remove --appId $_.appId --force }