Skip to content

Instantly share code, notes, and snippets.

View contactbrenton's full-sized avatar
Found on Linkedin "Brenton Johnson"

Brenton Johnson contactbrenton

Found on Linkedin "Brenton Johnson"
  • Uptake Digital
  • Australia
View GitHub Profile
@contactbrenton
contactbrenton / UninstallClassicTeams.ps1
Created June 18, 2025 07:47
Copyright (c) 2024 Microsoft and Contributors
################################################################################
# MIT License
#
# Copyright (c) 2024 Microsoft and Contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@contactbrenton
contactbrenton / DetectAndUninstallTMA.ps1
Last active June 18, 2025 07:48
Copyright (c) 2024 Microsoft and Contributors
################################################################################
# MIT License
#
# Copyright (c) 2024 Microsoft and Contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
<#
===============================================================
Wi-Fi Profile Manager Script (Windows, PowerShell)
===============================================================
WHAT THIS SCRIPT DOES:
1. Lists all saved Wi-Fi profiles on the system.
2. Prompts the user (y/n) to delete each one individually.
3. Displays a list of the remaining profiles.
<#
.SYNOPSIS
Applies Adobe Acrobat DC FeatureLockdown registry keys via Intune.
.DESCRIPTION
This script configures specific FeatureLockdown registry settings to optimise Adobe Acrobat DC
for enterprise deployment using the Universal Installer.
It:
- Enforces Enhanced Security (Reduced Mode)
<#
.SYNOPSIS
This script manages DNS records for specified domains on Cloudflare.
.DESCRIPTION
The script performs the following tasks:
- Retrieves the Zone ID for each domain using Cloudflare’s API.
- Deletes all existing DNS records for each domain.
- Adds a predefined set of DNS records (A, TXT, and DKIM) to each domain.
@contactbrenton
contactbrenton / reboot-2am.ps1
Last active September 20, 2024 00:13
Powershell script to reboot windows between 1am and 3am system time. Logic put in as a safeguard to protect against queued events.
# Restart-ComputerWithTimeCheck.ps1
# Description: This script will restart the computer using the /g option,
# but only if the current system time is between 1:00 AM and 3:00 AM.
# List of Logged-in Users and Sessions
Write-Host "======================================" -ForegroundColor Yellow
Write-Host "Logged-in Users:" -ForegroundColor White
Write-Host "--------------------------------------" -ForegroundColor Yellow
query user
# This script syncs a device with intune using powershell.
# This can be pushed with RMM and avoids the dreaded "remote wipe" and "remote sync" buttons being mixed up.
# Source: https://oofhours.com/2024/03/30/when-does-a-windows-client-sync-with-intune/
[Windows.Management.MdmSessionManager,Windows.Management,ContentType=WindowsRuntime]
$session = [Windows.Management.MdmSessionManager]::TryCreateSession()
$session.StartAsync()
function unInstallTeams($path) {
$clientInstaller = "$($path)\Update.exe"
try {
$process = Start-Process -FilePath "$clientInstaller" -ArgumentList "--uninstall /s" -PassThru -Wait -ErrorAction STOP
if ($process.ExitCode -ne 0)
{
Write-Error "UnInstallation failed with exit code $($process.ExitCode)."
}
}
@contactbrenton
contactbrenton / uninstall-teams1.ps1
Last active May 29, 2024 04:55
Not my work - couldn't find the original source
# Clearing Teams Cache by Mark Vale
# Uninstall Teams by Rudy Mens
$clearCache = Read-Host "Do you want to delete the Teams Cache (Y/N)?"
$clearCache = $clearCache.ToUpper()
$uninstall= Read-Host "Do you want to uninstall Teams completely (Y/N)?"
$uninstall= $uninstall.ToUpper()
if ($clearCache -eq "Y"){
Write-Host "Stopping Teams Process" -ForegroundColor Yellow
try{
Get-Process -ProcessName Teams | Stop-Process -Force
@contactbrenton
contactbrenton / Check-Updates-WUA.ps1
Last active January 5, 2025 01:09
Check Windows updates using Windows Update Agent (WUA)
<#
.DESCRIPTION
The script uses a COM object to interact with the Windows Update service, searching for any updates that are currently available but not installed. If no updates are pending, it confirms the system is up to date. Otherwise, it lists all pending updates by title.
#>
# Create a COM object for Windows Update Session
$UpdateSession = New-Object -ComObject "Microsoft.Update.Session"
$UpdateSearcher = $UpdateSession.CreateUpdateSearcher()
# Search for pending updates