Skip to content

Commit e43369e

Browse files
committed
Add SetUserFTA 1.7.1 and update Edge scripts
- Add SetUserFTA.exe v1.7.1 to tools/ (last freeware version) - Update user script to download from limehawk repo - Add UCPD disable option to system script
1 parent 625c179 commit e43369e

3 files changed

Lines changed: 42 additions & 20 deletions

File tree

scripts/edge_set_chrome_default_user.ps1

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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
156158
Write-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 ]"
250247
Write-Host "--------------------------------------------------------------"
251248

252249
$chromeProgId = "ChromeHTML"
253-
$totalAssociations = 0
254250

255251
if ($setDefaultHttp) {
256252
$totalAssociations++

scripts/edge_suppress_policies_system.ps1

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $ErrorActionPreference = 'Stop'
77
███████╗██║██║ ╚═╝ ██║███████╗██║ ██║██║ ██║╚███╔███╔╝██║ ██╗
88
╚══════╝╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝╚══╝ ╚═╝ ╚═╝
99
================================================================================
10-
SCRIPT : Edge Suppress Policies v1.1.0
10+
SCRIPT : Edge Suppress Policies v1.2.0
1111
AUTHOR : Limehawk.io
1212
DATE : December 2024
1313
USAGE : .\edge_suppress_policies_system.ps1
@@ -57,6 +57,7 @@ $ErrorActionPreference = 'Stop'
5757
Maintenance:
5858
- $disableScheduledTasks: Disable EdgeUpdate scheduled tasks
5959
- $cleanStartupEntries: Remove Edge from startup programs
60+
- $disableUCPD: Disable User Choice Protection Driver (allows setting defaults)
6061
6162
SETTINGS
6263
@@ -143,6 +144,7 @@ $ErrorActionPreference = 'Stop'
143144
--------------------------------------------------------------------------------
144145
CHANGELOG
145146
--------------------------------------------------------------------------------
147+
2024-12-27 v1.2.0 Added UCPD disable to allow setting browser defaults
146148
2024-12-27 v1.1.0 Added boolean settings at top for each feature
147149
2024-12-27 v1.0.0 Initial release - split from combined script
148150
================================================================================
@@ -177,6 +179,7 @@ $disableDesktopShortcut = $true # Prevent Edge shortcut creation
177179
# Maintenance
178180
$disableScheduledTasks = $true # Disable EdgeUpdate scheduled tasks
179181
$cleanStartupEntries = $true # Remove Edge from startup programs
182+
$disableUCPD = $true # Disable User Choice Protection Driver (required for setting defaults)
180183

181184
# ============================================================================
182185
# STATE VARIABLES
@@ -412,6 +415,29 @@ if ($cleanStartupEntries) {
412415
}
413416
}
414417

418+
# ============================================================================
419+
# DISABLE UCPD (User Choice Protection Driver)
420+
# ============================================================================
421+
if ($disableUCPD) {
422+
Write-Host ""
423+
Write-Host "[ DISABLE UCPD ]"
424+
Write-Host "--------------------------------------------------------------"
425+
426+
try {
427+
$ucpdPath = "HKLM:\SYSTEM\CurrentControlSet\Services\UCPD"
428+
if (Test-Path $ucpdPath) {
429+
New-ItemProperty -Path $ucpdPath -Name "Start" -Value 4 -PropertyType DWORD -Force | Out-Null
430+
Write-Host "Disabled User Choice Protection Driver"
431+
Write-Host "Reboot required for UCPD change to take effect"
432+
$changesApplied++
433+
} else {
434+
Write-Host "UCPD service not found (may not exist on this Windows version)"
435+
}
436+
} catch {
437+
Write-Host "Could not disable UCPD: $($_.Exception.Message)"
438+
}
439+
}
440+
415441
# ============================================================================
416442
# FINAL STATUS
417443
# ============================================================================

tools/SetUserFTA.exe

59.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)