Merge branch 'main' of https://gitea.tcse.us/tricounty/tcse-deploy
This commit is contained in:
commit
a5124f3154
20
GCPW/GCPW-AllowDomains.ps1
Normal file
20
GCPW/GCPW-AllowDomains.ps1
Normal file
@ -0,0 +1,20 @@
|
||||
# Define the registry path and value name
|
||||
$registryPath = 'HKLM:\Software\Google\GCPW'
|
||||
$valueName = 'domains_allowed_to_login'
|
||||
|
||||
# Check if the GCPW key exists
|
||||
if (Test-Path -Path $registryPath) {
|
||||
Write-Warning "GCPW key already exists. Skipping creation."
|
||||
} else {
|
||||
# Create the GCPW key
|
||||
New-Item -Path $registryPath -Force | Out-Null
|
||||
}
|
||||
|
||||
# Define the allowed domains (replace with your actual domains)
|
||||
$allowedDomains = "tcse.us"
|
||||
|
||||
# Set the registry value with allowed domains
|
||||
New-ItemProperty -Path $registryPath -Name $valueName -Value $allowedDomains -PropertyType MultiString -Force
|
||||
|
||||
# Confirmation message
|
||||
Write-Host "GCPW registry key configured with allowed domains: $allowedDomains"
|
||||
42
Login/DefaultApp-Adobe.ps1
Normal file
42
Login/DefaultApp-Adobe.ps1
Normal file
@ -0,0 +1,42 @@
|
||||
# Script to set Adobe Acrobat as default for specified file types
|
||||
$fileTypes = @(".pdf")
|
||||
$setUserFtaPath = "C:\Scripts\Software\setuserfta.exe"
|
||||
|
||||
# Function to check and set default app for a file type
|
||||
function Set-DefaultAppIfNeeded {
|
||||
param(
|
||||
[string]$fileType
|
||||
)
|
||||
|
||||
try {
|
||||
# Get the current default app for the file type
|
||||
$currentDefault = (Get-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$fileType\UserChoice" -ErrorAction SilentlyContinue).ProgId
|
||||
|
||||
# Check if Adobe Acrobat is not the default
|
||||
if ($currentDefault -ne "AcroExch.Document") {
|
||||
Write-Host "Setting Adobe Acrobat as default for $fileType"
|
||||
|
||||
# Ensure setuserfta.exe path exists
|
||||
if (-not (Test-Path $setUserFtaPath)) {
|
||||
Write-Error "setuserfta.exe not found at $setUserFtaPath"
|
||||
return
|
||||
}
|
||||
|
||||
# Run setuserfta.exe to set Adobe Acrobat as default
|
||||
Start-Process $setUserFtaPath -ArgumentList "`"$fileType`" AcroExch.Document" -Wait -NoNewWindow
|
||||
}
|
||||
else {
|
||||
Write-Host "Adobe Acrobat is already the default for $fileType"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Error "Error processing $fileType`: $_"
|
||||
}
|
||||
}
|
||||
|
||||
# Process each file type
|
||||
foreach ($type in $fileTypes) {
|
||||
Set-DefaultAppIfNeeded -fileType $type
|
||||
}
|
||||
|
||||
Write-Host "File type default app check completed."
|
||||
77
Login/DefaultApp-Chrome.ps1
Normal file
77
Login/DefaultApp-Chrome.ps1
Normal file
@ -0,0 +1,77 @@
|
||||
# Script to set Google Chrome as default for specified file types and link types
|
||||
$fileTypes = @(".htm", ".html", ".mhtml", ".svg", ".shtml", ".webp", ".xht", ".xhtml")
|
||||
$linkTypes = @("http", "https")
|
||||
$setUserFtaPath = "C:\Scripts\Software\setuserfta.exe"
|
||||
|
||||
# Function to check and set default app for file types
|
||||
function Set-DefaultFileTypeIfNeeded {
|
||||
param(
|
||||
[string]$fileType
|
||||
)
|
||||
|
||||
try {
|
||||
# Get the current default app for the file type
|
||||
$currentDefault = (Get-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$fileType\UserChoice" -ErrorAction SilentlyContinue).ProgId
|
||||
|
||||
# Check if Chrome is not the default
|
||||
if ($currentDefault -ne "ChromeHTML") {
|
||||
Write-Host "Setting Chrome as default for file type $fileType"
|
||||
|
||||
# Ensure setuserfta.exe path exists
|
||||
if (-not (Test-Path $setUserFtaPath)) {
|
||||
Write-Error "setuserfta.exe not found at $setUserFtaPath"
|
||||
return
|
||||
}
|
||||
|
||||
# Run setuserfta.exe to set Chrome as default
|
||||
Start-Process $setUserFtaPath -ArgumentList "`"$fileType`" ChromeHTML" -Wait -NoNewWindow
|
||||
}
|
||||
else {
|
||||
Write-Host "Chrome is already the default for file type $fileType"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Error "Error processing file type $fileType`: $_"
|
||||
}
|
||||
}
|
||||
|
||||
# Function to check and set default app for link types
|
||||
function Set-DefaultLinkTypeIfNeeded {
|
||||
param(
|
||||
[string]$linkType
|
||||
)
|
||||
|
||||
try {
|
||||
# Registry path for URL protocol handlers
|
||||
$registryPath = "HKCU:\SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\$linkType\UserChoice"
|
||||
|
||||
# Get the current default app for the link type
|
||||
$currentDefault = (Get-ItemProperty $registryPath -ErrorAction SilentlyContinue).ProgId
|
||||
|
||||
# Check if Chrome is not the default
|
||||
if ($currentDefault -ne "ChromeHTML") {
|
||||
Write-Host "Setting Chrome as default for link type $linkType"
|
||||
|
||||
# Run setuserfta.exe to set Chrome as default
|
||||
Start-Process $setUserFtaPath -ArgumentList "`"$linkType`" ChromeHTML" -Wait -NoNewWindow
|
||||
}
|
||||
else {
|
||||
Write-Host "Chrome is already the default for link type $linkType"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Error "Error processing link type $linkType`: $_"
|
||||
}
|
||||
}
|
||||
|
||||
# Process each file type
|
||||
foreach ($type in $fileTypes) {
|
||||
Set-DefaultFileTypeIfNeeded -fileType $type
|
||||
}
|
||||
|
||||
# Process each link type
|
||||
foreach ($type in $linkTypes) {
|
||||
Set-DefaultLinkTypeIfNeeded -linkType $type
|
||||
}
|
||||
|
||||
Write-Host "File and link type default app check completed."
|
||||
@ -97,6 +97,11 @@ echo Deleted !deleted_count! shortcut(s) from the Public Desktop.
|
||||
:: C:\Scripts\Software\gcpwstandaloneenterprise64.exe /silent /fullinstall
|
||||
:: echo Google Cloud Provider for Windows Installed Third Time...
|
||||
|
||||
:: GCPW Add Allowed Domain to Registry
|
||||
echo Adding Domain to GCPW Registry...
|
||||
powershell -ExecutionPolicy Bypass -File "C:\Scripts\GCPW\GCPW-AllowDomains.ps1"
|
||||
echo Allowed Domain Added to Registry...
|
||||
|
||||
:: Copy Login Scripts to User Startup
|
||||
echo Copying Login Scripts to All Users...
|
||||
powershell Copy-Item 'C:\Scripts\TCSE-Login.vbs' 'C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup'
|
||||
|
||||
@ -10,17 +10,13 @@ set "LOGFILE=%LOGFILE: =0%"
|
||||
|
||||
echo Starting setup script at %DATE% %TIME% > "%LOGFILE%"
|
||||
|
||||
:: Set App Defaults
|
||||
echo Setting Default Apps... >> "%LOGFILE%"
|
||||
C:\Scripts\Software\setuserfta.exe .pdf AcroExch.Document
|
||||
C:\Scripts\Software\setuserfta.exe .htm ChromeHTML
|
||||
C:\Scripts\Software\setuserfta.exe .html ChromeHTML
|
||||
C:\Scripts\Software\setuserfta.exe http ChromeHTML
|
||||
C:\Scripts\Software\setuserfta.exe https ChromeHTML
|
||||
C:\Scripts\Software\setuserfta.exe .mhtml ChromeHTML
|
||||
C:\Scripts\Software\setuserfta.exe .svg ChromeHTML
|
||||
C:\Scripts\Software\setuserfta.exe .xht ChromeHTML
|
||||
C:\Scripts\Software\setuserfta.exe .xhtml ChromeHTML
|
||||
:: Set Adobe Acrobat to Default PDF Viewer
|
||||
echo Setting Adobe Acrobat to Default PDF Viewer... >> "%LOGFILE%"
|
||||
powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\DefaultApp-Adobe.ps1"
|
||||
|
||||
:: Set Google Chrome to Default Browser
|
||||
echo Setting Google Chrome to Default Browser... >> "%LOGFILE%"
|
||||
powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\DefaultApp-Chrome.ps1"
|
||||
|
||||
:: Run Debloat Script
|
||||
powershell -ExecutionPolicy Bypass -File "C:\Scripts\Software\Win11Debloat\Win11Debloat.ps1" -Silent -RemoveW11Outlook -DisableTelemetry -DisableBing -DisableSuggestions -DisableLockscreenTips -ShowKnownFileExt
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user