Skip to content

Instantly share code, notes, and snippets.

@jasonadsit
Created November 22, 2022 17:44
Show Gist options
  • Save jasonadsit/c92697a7f39606472d5fc532de7add2a to your computer and use it in GitHub Desktop.
Save jasonadsit/c92697a7f39606472d5fc532de7add2a to your computer and use it in GitHub Desktop.
GetAllUserDefaultBrowsers.ps1
New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS -ErrorAction SilentlyContinue 2>&1>$null
Resolve-Path -Path HKU:\*\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice | ForEach-Object {
$TheComputerName = $env:COMPUTERNAME
$TheUserSID = $_.Path.Split('\')[1]
$TheUserDefaultBrowser = $_ | Get-ItemPropertyValue -Name ProgId
[pscustomobject][ordered]@{
ComputerName = $TheComputerName
UserSID = $TheUserSID
DefaultBrowser = $TheUserDefaultBrowser
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment