Skip to content

Instantly share code, notes, and snippets.

#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
#
# Get-X509Value.ps1
#
# Written By Bill Stewart (bstewart AT iname.com)
#
# This script uses 'certutil -scinfo -silent' to get all smart card certificate
# SHA1 hashes (aka "thumbprints") from an inserted smart card. Of these
# certificates, the script selects those certificates that are used for smart
# card logon and have a valid date, and presents a selectable list of
# certificates to the user. After the user selects a certificate, the script
# outputs an object with the following properties:
// MSIInfo.js
// Written by Bill Stewart (bstewart AT iname.com)
// Outputs properties from an MSI database.
var SCRIPT_NAME = "MSIInfo.js";
// This array specifies the property names the script will handle.
var VALID_PROPERTIES = ["Manufacturer","ProductName","ProductVersion",
"ProductCode","UpgradeCode"];
# Get-HexDump.ps1
# Written by Bill Stewart (bstewart AT iname.com)
# Version history:
#
# 1.0 (2012-06-29)
# * Initial version.
#
# 1.1 (2017-03-24)
# * Slight performance improvement (don't keep recreating buffer).
// ZoneConfig.js
// Configures browser security zone settings.
// Written by Bill Stewart (bstewart AT iname.com)
// Designed to run as a logon script from a GPO; example:
// Script: %SystemRoot%\System32\cscript.exe
// Parameters: \\<domainname>\NETLOGON\ZoneConfig.js
// For details on settings, see:
// Renamer.js
// Written by Bill Stewart (bstewart AT iname.com)
//
// Renames files and/or directories using regular expressions.
var SCRIPT_NAME = "Renamer.js",
ERROR_INVALID_PARAMETER = 87;
var FSO;
# Get-Uptime.ps1
# Written by Bill Stewart (bstewart AT iname.com)
#
# Outputs uptime for one or more computers. Uptime is determined by the
# LastBootUpTime property from the Win32_OperatingSystem WMI class.
#requires -version 3
<#
.SYNOPSIS
# Reset-DhcpServerDnsCredential.ps1
# Written by Bill Stewart (bstewart AT iname.com)
# Script prerequisites: PowerShell ActiveDirectory and DhcpServer modules
# On a Windows server, you can meet these prerequisites by installing the
# following feature administration tools found in Remote Server Administration
# Tools:
# * AD DS and AD LDS Tools: Active Directory Module for Windows PowerShell
# * DHCP Server Tools
# Rename-ScheduledTask.ps1
# Written by Bill Stewart (bstewart AT iname.com)
#requires -version 3
<#
.SYNOPSIS
Renames a scheduled task on a computer by copying an existing task to a new task, then deleting the original task.
.DESCRIPTION
# Get-ComputerGroupMembership.ps1
#requires -version 3
#requires -RunAsAdministrator
<#
.SYNOPSIS
Gets a computer's group memberships based on resultant set of policy (RSOP) data.
.DESCRIPTION