Skip to content

Instantly share code, notes, and snippets.

@raspi
Created October 5, 2018 20:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raspi/7752a156e1860c8fbfd0ccd81f48dffd to your computer and use it in GitHub Desktop.
Save raspi/7752a156e1860c8fbfd0ccd81f48dffd to your computer and use it in GitHub Desktop.
$items = Get-ItemProperty -Path 'Registry::HKey_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\ProfileList\*'
Foreach ($item in $items) {
$objUser = New-Object System.Security.Principal.SecurityIdentifier($item.PSChildName)
$objName = $objUser.Translate([System.Security.Principal.NTAccount])
$item.PSChildName = $objName.value
}
Write-Output $items | Select-Object -Property PSChildName, ProfileImagePath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment