Skip to content

Instantly share code, notes, and snippets.

View JeremyTBradshaw's full-sized avatar
🤠
Yeehaw

Jeremy JeremyTBradshaw

🤠
Yeehaw
View GitHub Profile
@JeremyTBradshaw
JeremyTBradshaw / Capture-LegacyExchangeDNs.ps1
Created December 16, 2021 19:46
Capture LegacyExchangeDN's during Exchange org splits
<#
.Synopsis
This is not intended to be an executable script. It's PS1 for now simply for syntax highlighting.
#>
#======#---------------------------#
#region# Backup LegacyExchangeDN's #
#======#---------------------------#
$LDNRecipients = @()
$Recipients = @()
using namespace System
using namespace System.Runtime.InteropServices
########-----------#
#region# Variables #
########-----------#
try {
$Cred1 = Import-Clixml "$($HOME)\Cred1.xml" -ErrorAction Stop
Write-Information -MessageData "`$Cred1: $($Cred1.UserName)" -InformationAction Continue
reg add HKCU\Software\Microsoft\Office\16.0\Outlook\AutoDiscover /v PreferLocalXML /t REG_DWORD /d 0
reg add HKCU\Software\Microsoft\Office\16.0\Outlook\AutoDiscover /v ExcludeHttpRedirect /t REG_DWORD /d 0
reg add HKCU\Software\Microsoft\Office\16.0\Outlook\AutoDiscover /v ExcludeHttpsAutoDiscoverDomain /t REG_DWORD /d 0
reg add HKCU\Software\Microsoft\Office\16.0\Outlook\AutoDiscover /v ExcludeHttpsRootDomain /t REG_DWORD /d 0
reg add HKCU\Software\Microsoft\Office\16.0\Outlook\AutoDiscover /v ExcludeScpLookup /t REG_DWORD /d 0
reg add HKCU\Software\Microsoft\Office\16.0\Outlook\AutoDiscover /v ExcludeSrvRecord /t REG_DWORD /d 0
reg add HKCU\Software\Microsoft\Office\16.0\Outlook\AutoDiscover /v ExcludeLastKnownGoodURL /t REG_DWORD /d 0
reg add HKCU\Software\Microsoft\Office\16.0\Outlook\AutoDiscover /v ExcludeExplicitO365Endpoint /t REG_DWORD /d 0
@JeremyTBradshaw
JeremyTBradshaw / New-FakeThumbprint.ps1
Last active December 3, 2020 17:34
Quick fake certificate thumbprints (and Guid's)
# For documentation purposes, sometimes I need fake thumbprints (and Guid's).
function New-FakeThumbprint ([ValidateRange(1, 10)][int]$Count = 1) {
1..$Count | ForEach-Object {
(
1..40 | Foreach-Object {
Get-Random @('A', 'B', 'C', 'D', 'E', 'F', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
}
) -join ''
#Requires -Version 5.1
using namespace System.Management.Automation.Host
switch (
$host.UI.PromptForChoice(
"Caption (e.g. 'XYZ has come up!')",
"Message (e.g. 'How would you like to proceed?",
[ChoiceDescription[]]@(