Skip to content

Instantly share code, notes, and snippets.

@jeremy-jameson
jeremy-jameson / Sign PowerShell profile.md
Last active December 6, 2019 12:48
Sign PowerShell profile

# Sign PowerShell profile

$cert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert

Set-AuthenticodeSignature -FilePath $PROFILE -Certificate $cert
@jeremy-jameson
jeremy-jameson / Download PowerShell profile.md
Last active October 29, 2021 14:56
Download PowerShell profile

# Download PowerShell profile

$url = "https://raw.githubusercontent.com/jeremy-jameson" `
    + "/Toolbox/main/PowerShell/Microsoft.PowerShell_profile.ps1"

Invoke-WebRequest -Uri $url -OutFile $PROFILE -UseBasicParsing
@jeremy-jameson
jeremy-jameson / Configure symbolic links for Git repositories.md
Last active December 6, 2019 16:48
Configure symbolic links for Git repositories
@jeremy-jameson
jeremy-jameson / Cluster VMs.csv
Last active July 4, 2022 12:39
Sample list of virtual machines running on a cluster with "startup order"
Name StartupOrder
CIPHER01 4
CON-ADFS01 302
CON-DC05 300
CON-DC06 301
CON-W10-TEST-03 303
CRYPTID 0
EXT-ADFS01A 0
EXT-ADFS03A 108
EXT-ADFS03B 109
@jeremy-jameson
jeremy-jameson / Start and stop cluster VMs.md
Last active December 10, 2019 16:42
Start and stop cluster VMs (using System Center Virtual Machine Manager)

# Start and stop cluster VMs (using System Center Virtual Machine Manager)

# Create cluster VM list with "startup order"

$url = 'https://gist.githubusercontent.com/jeremy-jameson' `
    + '/913c11a4550efe428bbe7d6e1c82c955/raw'

Invoke-WebRequest `
    -UseBasicParsing `
@jeremy-jameson
jeremy-jameson / Fix MDW rpt_query_stats procedure.sql
Last active December 20, 2019 17:13
Fix for bug in SQL Server Management Data Warehouse (rpt_query_stats procedure)
USE [MDW]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [snapshots].[rpt_query_stats]
@jeremy-jameson
jeremy-jameson / Shrink Transaction Logs.sql
Created January 25, 2020 12:59
Shrink transaction log files in SQL Server
IF OBJECT_ID('tempdb.dbo.#CommandQueue', 'U') IS NOT NULL
BEGIN
DROP TABLE #CommandQueue
END
CREATE TABLE #CommandQueue
(
ID INT IDENTITY (1, 1)
, SqlStatement VARCHAR(1000)
)
@jeremy-jameson
jeremy-jameson / Bulk Create Test E-mail Accounts in Poste.io Using PowerShell.md
Created February 25, 2020 18:10
Bulk Create Test E-mail Accounts in Poste.io Using PowerShell

Bulk Create Test E-mail Accounts in Poste.io

$uri = "https://mail-test.technologytoolbox.com/admin/api/v1/boxes"

$userPassword = "{specify test mail password here}"

$adminUsername = "admin@technologytoolbox.com"
$adminPassword = "{specify Poste.io admin password here}"
$credentials = "${adminUsername}:${adminPassword}"