Skip to content

Instantly share code, notes, and snippets.

# Update-ADGroupFromLDAPQuery.ps1
# Written by Bill Stewart (bstewart AT iname.com)
<#
Notes about this script:
* Import the ActiveDirectory module BEFORE running this script; one easy way to
do this is to write a "wrapper" script that calls this one (e.g., if you want
to schedule this using the Task Scheduler).
<#
Clear-SmartcardCache.ps1
Written by Bill Stewart
We have seen some instances where a user gets a new smartcard certificate and
they are unable to log on due to cached data in the local registry.
The purpose of this script is to remove this cached data from the registry
to fix this prompt. The script makes a backup copy of the registry subkey to
#requires -version 3
# Version history:
#
# 2025-07-22
# * Support pipeline input.
#
# 2025-07-14
# * Added spaces in binary string output to improve readability.
#
# ConvertTo-BinaryString.ps1
# Written by Bill Stewart (bstewart AT iname.com)
# I wrote this for two main reasons...
# * "b" format specifier not universally available
# * [Convert]::ToString() doesn't support UInt64 values
<#
.SYNOPSIS
Converts an unsigned integer to a binary string.
# New-CertificateSigningRequest.ps1
# Written by Bill Stewart (bstewart AT iname.com)
# MIT license: Copyright 2025 Bill Stewart
#
# 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
# Update-VirtualBoxWindowsAdditions.ps1
# Written by Bill Stewart (bstewart AT iname.com)
#
# Updates the VirtualBox Guest Additions on a VirtualBox VM.
#
# Prerequisites:
# * The VirtualBox Guest Additions ISO must be mounted in a VM optical drive
# * The Guest Additions must already be installed
#
# Version history:
# Start-ScheduledTaskCommand.ps1
# Written by Bill Stewart (bstewart AT iname.com)
# This script provides a simple way to execute a command one one or more remote
# computers using the Task Scheduler service. Uses the Task Scheduler scripting
# objects:
# https://learn.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-objects
# If you're using the Windows firewall, you'll need the 'Remove Scheduled Tasks
# Management' inbound rules (or equivalent) in place on remote machines.
#
# New-OpenSSLCertReq.ps1
# Written by Bill Stewart (bstewart AT iname.com)
#requires -version 3
<#
.SYNOPSIS
Generates a private key and certificate signing request (CSR) using OpenSSL.
# Wait-NetConnectionDomain.ps1
# Written by Bill Stewart
# Under certain circumstances, Windows might not detect it's network location
# correctly. The most obvious manifestation of this problem is that the Windows
# Firewall 'profile' gets set to the wrong network. On a domain, this can be a
# headache when firewall rules are set to only be active for the 'Domain'
# firewall profile. It seems that, under some conditions on domain-joined
# computers, the Network Location Awareness (NlaSvc) service doesn't update
# its status correctly.
#requires -version 5.1
# Get-X509Event.ps1
# Written by Bill Stewart (bstewart AT iname.com)
#
# Gets X.509 "no strong mapping" certificate events from domain controllers.
# See Microsoft article KB5014754 for more information.
#
# Version History
#