Skip to content

Instantly share code, notes, and snippets.

misterpki /
Created July 17, 2023 19:24
AWS CLI Route53 Create
echo "Enter FQDN"
read dns
echo "Enter IP Address"
read ip
# Zone ID
misterpki /
Created June 6, 2023 18:31
Query Route53 DNS with AWS CLI
echo "Enter an IP address or DNS name"
read value
# Zone ID
# Check if value is an IP address or DNS name
if [[ $value =~ ^[[:digit:]] ]]; then
echo "Querying Route53 for IP address $value"
misterpki / add-proxy-address.ps1
Created March 20, 2023 15:11
PowerShell script to add an email alias to an Active Directory user object using the proxyAddresses attribute.
$credential = Get-Credential ""
$samAccountName = Read-Host -Prompt "Enter samAccountName"
$new = Read-Host -Prompt "Enter new alias"
$user = Get-ADuser $samAccountName -Properties proxyAddresses -Credential $credential
Set-ADuser -instance $user
misterpki / ansible-create-vm-vmware.yml
Created February 22, 2023 14:17
Create a VMware VM with an Ansible Playbook
- name: Create a VMware VM from an existing Redhat VMware template
hosts: localhost
connection: local
gather_facts: no
- name: Clone the template
username: <username>
misterpki /
Created February 21, 2023 22:05
Send email in Windows with Perl
use strict;
use warnings;
use Email::Sender::Simple qw(sendmail);
use Email::Sender::Transport::SMTP ();
use Email::Simple ();
use Email::Simple::Creator ();
misterpki / add-ad-group-member.ps1
Last active February 16, 2023 20:43
Add AD Group Member PowerShell Wrapper
$credential = Get-Credential
Invoke-Command -ComputerName "" -Credential $credential -ScriptBlock {
$groupSamAccountName = Read-Host -Prompt "Enter group samAccountName"
$members = Read-Host -Prompt "Enter comma delimitered list of members"
Write-Host "Adding group member(s) '$members' to group '$groupSamAccountName'"
Add-ADGroupMember -Identity $groupSamAccountName -Members $members
misterpki / dns-remote.ps1
Last active February 16, 2023 20:41
Add Active Directory DNS A record remotely
$credential = Get-Credential
Invoke-Command -ComputerName "" -Credential $credential -ScriptBlock {
$hostname = Read-Host -Prompt "Enter host name"
$ip = Read-Host -Prompt "Enter IP Address"
Write-Host "Creating A Record for host '$hostname' having IP '$ip'"
Add-DNsServerResourceRecordA -Name $hostname `