Skip to content

Instantly share code, notes, and snippets.

View eponerine's full-sized avatar
🏌️

Ernie Costa eponerine

🏌️
View GitHub Profile
$procdumpPath = "C:\ClusterStorage\VMLTRACE-01\procdump\procdump.exe"
$dumpLocation = "C:\ClusterStorage\VMLTRACE-01\ProcDump-ExceptionDumps\$env:ComputerName"
$sleepTimeSec = 120
# Keep monitoring for ProcDump aliveness (if it has dumped due to crash)
while ($true) {
Write-Host "ProcDump Monitoring Tool" -ForegroundColor Cyan
# Find the active, non-Zombied VMMS process
@eponerine
eponerine / Elevate-AADPIMRequest.ps1
Created June 9, 2023 17:00
Elevate-AADPIMRequest
$tenantId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
$userName = "ernie@foobar.onmicrosoft.com"
$hours = 2
# If you don't know the string, run:
# Get-AzureADMSRoleDefinition | Sort DisplayName | FT DisplayName, ID
$roleToActivate = "Privileged Authentication Administrator"
###############
@eponerine
eponerine / gist:559e9f5bd1a9f97c59de0cc5c69c509a
Last active June 2, 2023 17:15
AKS Hybird with Azure RBAC
# Configure your settings for the AKS Hybrid workload cluster
$aksHciClusterName = "erniecluster03"
$aksHciNodePoolName = "erniecluster03poollinux"
$aksHciNodePoolOS = "Linux"
$aksHciNodePoolCount = 3
$aksHciNodePoolSize = "Standard_D2s_v3"
$aksHciKuberentesVer = "v1.25.7"
$aksHciControlPlaneCount = 3
$aksHciControlPlaneSize = "Standard_D2s_v3"
$aksHciLoadBalancerSize = "Standard_D2s_v3"
@eponerine
eponerine / imgprep.sh
Created February 23, 2023 22:47
imgprep.sh
#!/bin/bash
printf "%s\n%s" "This script will prep this VM for use as a template then power it off." "Press ENTER to continue or Ctrl-C to abort: "
read
unset HISTFILE
unalias -a
history -c
export ACCEPT_EULA=Y # This keeps MS packages from prompting to accept the license agreement.
@eponerine
eponerine / Configure-CustomDedupSchedule.ps1
Created February 23, 2023 14:43
Configure-CustomDedupSchedule
$clusterName = "CLUSTERNAME.contoso.com"
#########################
# This only needs to be run on a single node of the cluster, so just grab the first server
# I'm doing a ghetto array thing here because piping to Select -First 1 doesn't work with FCM cmdlets
# Seriously! I even have a GitHub issue open for it:
# https://github.com/MicrosoftDocs/windows-powershell-docs/issues/1722
$clusterNodes = Get-Cluster -Name $clusterName | Get-ClusterNode
$clusterNode = $clusterNodes[0]
@eponerine
eponerine / Get-RiteAidVaxSlotAvailability.ps1
Created March 5, 2021 03:12
Quick script to parse available Rite Aid covid vaccination slots based on your location.
$zip = "07719"
$radius = "25"
$numStoresToReturn = "50"
$riteaid_StoreLocatorURI = "https://www.riteaid.com/services/ext/v2/stores/getStores?address=$zip&radius=$radius&pharmacyOnly=true&globalZipCodeRequired=true&count=$numStoresToReturn"
$riteaid_StoreVaxSlotURI = "https://www.riteaid.com/services/ext/v2/vaccine/checkSlots?storeNumber="
# Get requested # of stores within the radius set
$riteaid_StoreLocations = Invoke-RestMethod -Uri $riteaid_StoreLocatorURI
# Preconfigured settings
$serverName = "AUGPHVC101" # Hostname for reboot and domain join
$interfaceNamePattern = "SLOT" # Whatever NICs you want to add to the SET Team. Different vendors use different things here. I've seen "SLOT 01" used or "ETHERNET 01"
$mgmtVLAN = 800 # Change this to your management/production domain VLAN ID
$mgmtIP = "172.16.7.101"
$mgmtSubnetLength = 24
$mgmtGateway = "172.16.7.1"
$mgmtDNS1 = "172.16.7.20"
$mgmtDNS2 = "172.16.8.20"