Skip to content

Instantly share code, notes, and snippets.

Avatar

Luke Humberdross lukejjh

  • Brisbane, Australia
View GitHub Profile
@lukejjh
lukejjh / AddOutlookToStartup.ps1
Created Aug 22, 2021
Short PowerShell one-liner to make Outlook run at startup (user logon).
View AddOutlookToStartup.ps1
cp(gci([Environment]::GetFolderPath(22)) -r -fi *Outlook*.lnk).FullName ([Environment]::GetFolderPath(7))
@lukejjh
lukejjh / ToggleDarkMode.ps1
Created Aug 22, 2021
PowerShell script that toggles dark mode in Windows 10/11, for both apps and system.
View ToggleDarkMode.ps1
$k = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize"
$v = (Get-ItemProperty -Path $k).SystemUsesLightTheme -bxor 1
Set-ItemProperty -Path $k -Name "SystemUsesLightTheme" -Value $v
Set-ItemProperty -Path $k -Name "AppsUseLightTheme" -Value $v
@lukejjh
lukejjh / ssh-fingerprints.sh
Created Jul 5, 2021
Get all SSH server fingerprints, both in SHA256 and MD5, on Linux using Bash.
View ssh-fingerprints.sh
for h in {sha256,md5}; do for f in /etc/ssh/ssh_host_*_key.pub; do ssh-keygen -lf $f -E $h; done; done
@lukejjh
lukejjh / ssh-fingerprints.ps1
Created Jul 5, 2021
Get all SSH server fingerprints, both in SHA256 and MD5, on Windows using PowerShell.
View ssh-fingerprints.ps1
"sha256","md5" | % { $h = $_; gi "${env:ProgramData}\SSH\ssh_host_*_key.pub" | % { ssh-keygen -lf $_.FullName -E $h } }
@lukejjh
lukejjh / Get-DistributionGroupRecursive.ps1
Created Jun 23, 2021
Function providing missing -Recurse parameter for Get-DistributionGroup.
View Get-DistributionGroupRecursive.ps1
function Get-DistributionGroupRecursive {
<#
.SYNOPSIS
Function providing missing -Recurse parameter for Get-DistributionGroup.
.DESCRIPTION
Takes an identity string and returns the matching distribution group and any nested groups beneath it.
Only distribution groups are returned, not mailboxes, etc.
.EXAMPLE