Skip to content

Instantly share code, notes, and snippets.

View BanterBoy's full-sized avatar
⚙️
Automating things.......from home!

Luke Leigh BanterBoy

⚙️
Automating things.......from home!
View GitHub Profile
@BanterBoy
BanterBoy / Get-PatchTue.ps1
Created June 10, 2020 18:27
PowerShell function to show you when the next patch Tuesday will occur. You can also specify month/year to find historical or future dates.
function Get-PatchTue {
<#
.SYNOPSIS
Get the Patch Tuesday of a month
.PARAMETER month
The month to check
.PARAMETER year
The year to check
.EXAMPLE
Get-PatchTue -month 6 -year 2015

Keybase proof

I hereby claim:

  • I am banterboy on github.
  • I am lukeleigh (https://keybase.io/lukeleigh) on keybase.
  • I have a public key ASDtkLpfa19ylVA7cUgFDXSqwo7cScFxbEWP786RCZsIvAo

To claim this, I am signing this object:

@BanterBoy
BanterBoy / IP-Scan.ps1
Last active August 6, 2018 12:41
Resolve PTR for an array of IP's
$IPs = New-Object System.Collections.ArrayList
$IPs.AddRange(
(
"64.4.250.33",
"64.4.250.32",
"23.43.65.124",
"23.195.132.187",
"52.23.120.130",
"52.20.68.174",
@BanterBoy
BanterBoy / Find-Domainadmins.ps1
Created July 27, 2018 14:49
Find Domain Admins
Get-ADGroupMember -Identity Administrators -Recursive |
ForEach-Object { get-aduser $_} |
Select-Object SamAccountName, GivenName, Surname, objectclass, name, enabled |
Sort-Object SamAccountName |
Format-Table -AutoSize
@BanterBoy
BanterBoy / Capture-MainWindowTitle.ps1
Last active July 25, 2018 10:15
Snippet used to capture the title bar for all active windows for all foreground processes
$p = @(Get-Process -Name *)
$p | Select-Object -Property MainWindowTitle | Where-Object { $_.MainWindowTitle -match "\w+" }
@BanterBoy
BanterBoy / Find-FilesLastDays.ps1
Created June 29, 2018 22:01
Short scrappy script to locate recently created files (scripts/notes)
Clear-Host
$DaysPast = Read-Host "Enter Number of Days"
$Start = (Get-Date).AddDays(-$DaysPast)
$Path = Read-Host "Enter Search Path"
$Extenstion = Read-Host "Enter Extenstion"
Clear-Host
$Stopwatch = [system.diagnostics.stopwatch]::startNew()
Get-ChildItem -Path $Path -Include $Extenstion -Recurse |
Where-Object { $_.LastWriteTime -ge "$Start" } |
@BanterBoy
BanterBoy / Check-HIPBPwned.ps1
Created June 2, 2018 20:30
Quick script to check an Email address against https://haveibeenpwned.com/api also creates object $Pwned which can then be interrogated further.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$PwnedSite = "https://haveibeenpwned.com/api/v2/breachedaccount/"
$PwnedAddress = Read-Host "Email Address"
Invoke-RestMethod -Uri ($PwnedSite + $PwnedAddress) -OutVariable Pwned