Created
August 7, 2014 13:13
-
-
Save mikebuchanon/dc6a9a9ba39d5a9842da to your computer and use it in GitHub Desktop.
List Putty all Sessions and IPs from the registry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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