Skip to content

Instantly share code, notes, and snippets.

View naamancampbell's full-sized avatar

Naaman Campbell naamancampbell

  • Brisbane, Australia
View GitHub Profile
## generate Certificate Signing Request (CSR) with certutil
$FedServiceName = "sts.clancampbell.id.au"
$RequestPolicy = @"
[Version]
Signature="`$Windows NT$"
[NewRequest]
Subject = "CN=$FedServiceName,OU=ICT,O=ClanCampbell,L=Brisbane,S=Queensland,C=AU"
Exportable = FALSE ; TRUE = Private key is exportable
KeyLength = 2048 ; Valid key sizes: 1024, 2048, 4096, 8192, 16384
KeySpec = 1 ; Key Exchange – Required for encryption
@naamancampbell
naamancampbell / acmecert.ps1
Last active October 17, 2017 11:41
Automatically provisions new Lets Encrypt SSL certificate (using AWS Route 53 DNS verification) and adds to Windows Local Machine certificate store. Route 53 IAM Role required.
###
# References:
# - https://github.com/RobBiddle/ACMESharpRoute53Automation
# - https://github.com/ebekker/ACMESharp/wiki/Quick-Start
# - https://pkisharp.github.io/ACMESharp-docs/Quick-Start
# - https://www.frankysweb.de/exchange-2016-lets-encrypt-zertifikat-erneuern/
###
$BaseDomain = "clancampbell.id.au"
$FedServiceName = "sts.$BaseDomain"
@naamancampbell
naamancampbell / powershell-commands.ps1
Last active May 10, 2019 08:42
aws-cloudformation-awsmad - Automating the setup of an Office 365-enabled AWS Directory Services Microsoft Active Directory - as per https://aws.amazon.com/blogs/security/how-to-enable-your-users-to-access-office-365-with-aws-microsoft-active-directory-credentials/
# ADMgmt
## install chocolatey
Set-ExecutionPolicy Bypass; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
## install firefox
choco install -y firefox
## install AD Tools
Import-Module ServerManager
Add-WindowsFeature RSAT-AD-Tools
## create testing accounts
New-ADOrganizationalUnit -Name "Groups" -Path "OU=CLANCAMPBELL,DC=clancampbell,DC=id,DC=au"