Skip to content

Instantly share code, notes, and snippets.

@mikebuchanon
Created August 7, 2014 13:13
Show Gist options
  • Save mikebuchanon/dc6a9a9ba39d5a9842da to your computer and use it in GitHub Desktop.
Save mikebuchanon/dc6a9a9ba39d5a9842da to your computer and use it in GitHub Desktop.
List Putty all Sessions and IPs from the registry
clear
$regpath = "HKCU:\Software\SimonTatham\PuTTY\Sessions"
$sessions = gci -path $regpath
foreach($session in $sessions){
$fixedsession = $session -replace 'HKEY_CURRENT_USER','HKCU:'
$sessionname = Split-Path $fixedsession -Leaf
Write-Host $($sessionname -replace 'RS:|%20|.public.','') `t`t $(Get-ItemProperty -path $fixedsession).HostName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment