@@ -7,7 +7,7 @@ $ErrorActionPreference = 'Stop'
77███████╗██║██║ ╚═╝ ██║███████╗██║ ██║██║ ██║╚███╔███╔╝██║ ██╗
88╚══════╝╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝
99================================================================================
10- SCRIPT : Edge Set Chrome Default v1.1 .0
10+ SCRIPT : Edge Set Chrome Default v1.2 .0
1111 AUTHOR : Limehawk.io
1212 DATE : December 2024
1313 USAGE : .\edge_set_chrome_default_user.ps1
@@ -19,15 +19,15 @@ $ErrorActionPreference = 'Stop'
1919 PURPOSE
2020
2121 Sets Google Chrome as the default browser for the current user. Uses
22- SetUserFTA from Microsoft's GitHub to properly set file associations with
23- the correct UserChoice hash that Windows 10/11 requires.
22+ SetUserFTA to properly set file associations with the correct UserChoice
23+ hash that Windows 10/11 requires.
2424
2525 MUST run as the logged-in user (not SYSTEM) - default browser settings are
2626 per-user and stored in HKCU with hash validation.
2727
2828 DATA SOURCES & PRIORITY
2929
30- - SetUserFTA: Microsoft tool that calculates UserChoice hash
30+ - SetUserFTA: Tool that calculates UserChoice hash
3131 - Windows Registry: UserChoice keys for protocols/extensions
3232
3333 REQUIRED INPUTS
@@ -44,19 +44,19 @@ $ErrorActionPreference = 'Stop'
4444 - $cleanUserStartup: Remove Edge from user's startup programs
4545
4646 Tool Configuration:
47- - $setUserFtaUrl: URL to download SetUserFTA (change for internal hosting )
47+ - $setUserFtaUrl: URL to download SetUserFTA (hosted in this repo )
4848
4949 SETTINGS
5050
51- All options default to $true. The SetUserFTA URL points to Microsoft's
52- official GitHub release . Change it if you host the tool internally .
51+ All options default to $true. SetUserFTA is hosted in the limehawk
52+ rmm-scripts repo . Change the URL if you host it elsewhere .
5353
5454 BEHAVIOR
5555
5656 The script performs the following actions in order:
5757 1. Verifies Chrome is installed
5858 2. Checks that script is NOT running as SYSTEM
59- 3. Downloads SetUserFTA from Microsoft GitHub if not present
59+ 3. Downloads SetUserFTA if not present
6060 4. Sets Chrome as default for http, https, .htm, .html
6161
6262 PREREQUISITES
@@ -69,13 +69,13 @@ $ErrorActionPreference = 'Stop'
6969 SECURITY NOTES
7070
7171 - No secrets exposed in output
72- - SetUserFTA downloaded from official Microsoft GitHub
72+ - SetUserFTA downloaded from limehawk repo
7373 - Only modifies current user's default app associations
7474 - No admin rights required
7575
7676 ENDPOINTS
7777
78- - https://github.com/AzureAD/SetUserFTA - SetUserFTA download
78+ - https://github.com/limehawk/rmm-scripts - SetUserFTA download
7979
8080 EXIT CODES
8181
@@ -116,6 +116,7 @@ $ErrorActionPreference = 'Stop'
116116--------------------------------------------------------------------------------
117117 CHANGELOG
118118--------------------------------------------------------------------------------
119+ 2024-12-27 v1.2.0 Host SetUserFTA in limehawk repo, remove external dependency
119120 2024-12-27 v1.1.0 Added boolean settings at top for each feature
120121 2024-12-27 v1.0.0 Initial release - split from combined script
121122================================================================================
@@ -135,15 +136,16 @@ $setDefaultHtml = $true # Set Chrome as default for .html files
135136# Maintenance
136137$cleanUserStartup = $true # Remove Edge from user's startup programs
137138
138- # Tool Configuration - change URL if hosting SetUserFTA internally
139- $setUserFtaUrl = ' https://github.com/AzureAD/SetUserFTA/releases/download/v1.0.0 /SetUserFTA.exe'
139+ # Tool Configuration - SetUserFTA hosted in limehawk repo
140+ $setUserFtaUrl = ' https://github.com/limehawk/rmm-scripts/raw/main/tools /SetUserFTA.exe'
140141
141142# ============================================================================
142143# STATE VARIABLES
143144# ============================================================================
144145$errorOccurred = $false
145146$errorText = " "
146147$defaultsSet = 0
148+ $totalAssociations = 0
147149
148150# ============================================================================
149151# USER CHECK
@@ -155,16 +157,13 @@ Write-Host "--------------------------------------------------------------"
155157$currentUser = [System.Security.Principal.WindowsIdentity ]::GetCurrent().Name
156158Write-Host " Running as : $currentUser "
157159
158- # Check if running as SYSTEM - this won't work for setting user defaults
159- if ($currentUser -match " SYSTEM$" -or $currentUser -match " SYSTEM$" ) {
160+ if ($currentUser -match " SYSTEM$" ) {
160161 Write-Host " "
161162 Write-Host " [ ERROR OCCURRED ]"
162163 Write-Host " --------------------------------------------------------------"
163164 Write-Host " This script must run as the logged-in user, not SYSTEM"
164165 Write-Host " "
165166 Write-Host " Default browser is a per-user setting stored in HKCU."
166- Write-Host " Windows validates it with a hash tied to the user's SID."
167- Write-Host " Running as SYSTEM sets defaults for SYSTEM, not the user."
168167 Write-Host " "
169168 Write-Host " Solutions:"
170169 Write-Host " - RMM: Run as 'logged-in user' instead of 'SYSTEM'"
@@ -237,8 +236,6 @@ try {
237236 Write-Host " SetUserFTA is required because Windows 10/11 uses hash"
238237 Write-Host " validation on UserChoice registry keys. Without the correct"
239238 Write-Host " hash, Windows ignores registry changes to default apps."
240- Write-Host " "
241- Write-Host " Manual download: https://github.com/AzureAD/SetUserFTA"
242239 exit 1
243240}
244241
@@ -250,7 +247,6 @@ Write-Host "[ SET CHROME DEFAULT ]"
250247Write-Host " --------------------------------------------------------------"
251248
252249$chromeProgId = " ChromeHTML"
253- $totalAssociations = 0
254250
255251if ($setDefaultHttp ) {
256252 $totalAssociations ++
0 commit comments