Scripting

Anonymized scripts from the workshop and the day job. Copy, adapt, break, improve.

Powershell23 lines

Generate Random Passphrase Passwords with PowerShell

This script builds a random passphrase by pulling words, numbers, and special characters from CSV wordlists and concatenating them until the result hits a minimum length of 15 characters. It’s useful when you need a human-readable but policy-compliant password without reaching for a third-party tool.

Read »
Powershell142 lines

Get and Set Exchange Online Out of Office Messages with PowerShell

This script gives you an interactive menu to read and write Out of Office (automatic reply) configurations for any mailbox in Exchange Online. Use it when you need to check or update OOO messages on behalf of users, useful for helpdesk staff, onboarding/offboarding workflows, or covering for absent employees.

Read »
Vbscript62 lines

VBScript: Find and Copy PST Files Using WMI

This script scans the local machine for all PST files using a WMI query against `CIM_Datafile`, then copies whatever it finds to a destination folder you specify at runtime. It’s useful when you need to round up Outlook data files before a migration, decommission, or backup sweep — without knowing where users may have stashed them.

Read »
Powershell198 lines

Copy AD Group Memberships Between Computers in Bulk

This script reads two CSV files — a list of source computers and a matching list of target computers — and copies every AD group membership from each source to its corresponding target. You’d run this when migrating machines, replacing hardware, or provisioning new endpoints that need to inherit an existing computer’s group assignments without doing it manually one by one.

Read »