Scripting

Category page of all posts on the web site that are tagged as related to scripting including PowerShell, Javascript, and more!

Tracking User Lock, Unlock, and Sleep Events with PowerShell

Auditing External File Sharing in Microsoft 365 with PowerShell

A user reports their workstation keeps going to sleep “on its own.” Or someone claims they never left their desk, yet the session clearly disconnected. Answering these questions means digging through the Windows event log and correlating events across Security and System logs into one timeline. This script pulls seven distinct event IDs from two […]

Tracking User Lock, Unlock, and Sleep Events with PowerShell Read More »

The Nuclear Option: A PowerShell Script to Reset Windows Update Completely

Fix Windows Update with PowerShell

Windows Update breaks. Everyone knows this. Stuck update loops, error codes that don’t make sense, a client machine that hasn’t successfully installed patches in months. Microsoft’s official KB article for fixing Windows Update is a wall of 30+ manual steps. You have to stop services, rename folders, reset security descriptors, register DLLs, and restart everything

The Nuclear Option: A PowerShell Script to Reset Windows Update Completely Read More »

Auditing External File Sharing in Microsoft 365 with PowerShell

Auditing External File Sharing in Microsoft 365 with PowerShell

External sharing is a compliance nightmare. Your 365 tenant has dozens of SharePoint sites, each with document libraries, and files are shared via links or direct invitations. The SharePoint admin center shows you a high-level sharing policy per site, but it won’t tell you which specific files are shared externally or with whom. I wrote

Auditing External File Sharing in Microsoft 365 with PowerShell Read More »

Making a Core Keeper Fishing Bot Using AI (Grok 3)

Making a Core Keeper Fishing Bot with AI (Grok 3)

Despite the massive hype around AI I have always had a lot of trouble getting the AI to generate usable code. Even when I reply back and try to help the AI understand what it’s missing it often tends to actually get *worse* after my suggestions. Even for this simple project ChatGPT and Gemini failed

Making a Core Keeper Fishing Bot Using AI (Grok 3) Read More »

Remove All Traces of Microsoft SCCM w/ PowerShell (By Force)

SCCM Problem

Microsoft’s System Center Configuration Manager (SCCM) seems to usually work pretty well for 95-97% of the computers at the environments I’ve worked in. Unfortunately for the remaining few percentage points of computers that SCCM is *not* working pretty well for when SCCM does break it does so spectacularly with style and pizzazz.

This guide will show you how to use PowerShell to remove all traces from the computer so you can perform a clean reinstall!

Remove All Traces of Microsoft SCCM w/ PowerShell (By Force) Read More »

Disabling SCCM MDM Coexistence Mode (Unofficial Imperfect Workaround)

SCCM MDM Enrollment Registry Key

Microsoft recently added a feature called MDM coexistence into SCCM. Basically this makes SCCM shut off most of it’s functionality when a third party MDM is detected on the machine. You will see errors such as “You don’t have permission to install this software” when coexistence mode is enabled.

This post will outline a way I found to turn SCCM back on (with a caveat).

Disabling SCCM MDM Coexistence Mode (Unofficial Imperfect Workaround) Read More »

ServiceNow Automation Using Chrome Extension

I am releasing my Google Chrome extension with tools to automate many ServiceNow ticket tasks. 

It is a easily extendable extension in which you can autopopulate and autoroute tickets, automatically refresh your queues, play a sound when a new chat comes in, present hints and tips to agents, and many other features.

Every ServiceNow implementation is different so don’t expect to be able to drop this extension right in. To use it will require modifications specific to your implementation of ServiceNow.  If you understand basic Javascript you should be able to make use of this.  No APIs are used other than what is available in ServiceNow itself.

This tool was developed using the Chrome Developer Tools (Ctrl+Shift+I) to get fields and ids you will need to make the tool work. I do not recommend even attempting to use this unless you are a fairly experienced web developer.

ServiceNow Automation Using Chrome Extension Read More »