commit 2d84c850f75e355f408cd3cd0f54c4e36f584eb7 Author: bschaper Date: Mon Dec 9 21:16:35 2024 -0600 Partial Initial Upload diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/Login/Disable-EdgeStartup.ps1 b/Login/Disable-EdgeStartup.ps1 new file mode 100644 index 0000000..8dc74b8 --- /dev/null +++ b/Login/Disable-EdgeStartup.ps1 @@ -0,0 +1,28 @@ +# Get the registry key where startup programs are stored +$registryKey = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" + +# Get all registry values (not child items) from the Run key +$edgeEntries = Get-ItemProperty -Path $registryKey | + Get-Member -MemberType NoteProperty | + Where-Object { $_.Name -like "MicrosoftEdgeAutoLaunch_*" } + +# Check if any Edge entries were found +if ($edgeEntries) { + foreach ($edgeEntry in $edgeEntries) { + try { + # Remove the registry value + Remove-ItemProperty -Path $registryKey -Name $edgeEntry.Name + # Verify removal + $checkRemoval = Get-ItemProperty -Path $registryKey -Name $edgeEntry.Name -ErrorAction SilentlyContinue + if ($null -eq $checkRemoval) { + Write-Host "Microsoft Edge startup entry removed: $($edgeEntry.Name)" + } else { + Write-Warning "Failed to remove Microsoft Edge startup entry: $($edgeEntry.Name)" + } + } catch { + Write-Warning "Error removing Microsoft Edge startup entry: $($_.Exception.Message)" + } + } +} else { + Write-Warning "No Microsoft Edge startup entries found. Please manually verify the registry key." +} \ No newline at end of file diff --git a/Login/Disable-OneDriveStartup.ps1 b/Login/Disable-OneDriveStartup.ps1 new file mode 100644 index 0000000..824dae4 --- /dev/null +++ b/Login/Disable-OneDriveStartup.ps1 @@ -0,0 +1,28 @@ +# Get the registry key where startup programs are stored +$registryKey = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" + +# Get all registry values (not child items) from the Run key +$driveEntries = Get-ItemProperty -Path $registryKey | + Get-Member -MemberType NoteProperty | + Where-Object { $_.Name -like "OneDriveSetup" -or $_.Name -like "OneDrive" } + +# Check if any OneDrive entries were found +if ($driveEntries) { + foreach ($driveEntry in $driveEntries) { + try { + # Remove the registry value + Remove-ItemProperty -Path $registryKey -Name $driveEntry.Name + # Verify removal + $checkRemoval = Get-ItemProperty -Path $registryKey -Name $driveEntry.Name -ErrorAction SilentlyContinue + if ($null -eq $checkRemoval) { + Write-Host "OneDrive startup entry removed: $($driveEntry.Name)" + } else { + Write-Warning "Failed to remove OneDrive startup entry: $($driveEntry.Name)" + } + } catch { + Write-Warning "Error removing OneDrive startup entry: $($_.Exception.Message)" + } + } +} else { + Write-Warning "No OneDrive startup entries found. Please manually verify the registry key." +} \ No newline at end of file diff --git a/Login/Remove-EdgeShortcut.ps1 b/Login/Remove-EdgeShortcut.ps1 new file mode 100644 index 0000000..4f8a015 --- /dev/null +++ b/Login/Remove-EdgeShortcut.ps1 @@ -0,0 +1,35 @@ +# Script to remove Microsoft Edge desktop shortcut if it exists +# Get the currently logged in username +$currentUser = [System.Environment]::UserName + +# Define the path to the current user's desktop +$desktopPath = "C:\Users\$currentUser\Desktop" + +# Define the possible Edge shortcut names +$edgeShortcuts = @( + "Microsoft Edge.lnk", + "Microsoft Edge (Beta).lnk", + "Microsoft Edge (Dev).lnk", + "Microsoft Edge (Canary).lnk" +) + +# Loop through potential shortcut names +foreach ($shortcut in $edgeShortcuts) { + $fullPath = Join-Path -Path $desktopPath -ChildPath $shortcut + + # Check if the shortcut exists + if (Test-Path $fullPath) { + try { + # Remove the shortcut + Remove-Item $fullPath -Force + Write-Host "Deleted shortcut: $shortcut from $currentUser's desktop" + } + catch { + Write-Host "Error deleting shortcut $shortcut : $_" + } + } + else { + Write-Host "Shortcut $shortcut not found on $currentUser's desktop" + } +} +Write-Host "Edge shortcut removal process completed for user $currentUser." \ No newline at end of file diff --git a/Login/Uninstall-OneDrive.bat b/Login/Uninstall-OneDrive.bat new file mode 100755 index 0000000..fec92b6 --- /dev/null +++ b/Login/Uninstall-OneDrive.bat @@ -0,0 +1,23 @@ +@echo off +:: Check if OneDrive is installed +echo Checking if Microsoft OneDrive is installed... + +:: Check for OneDrive installation by looking for its executable +if exist "%LOCALAPPDATA%\Microsoft\OneDrive\OneDrive.exe" ( + echo OneDrive is installed. Proceeding with uninstallation... + + echo Uninstalling OneDrive... >> "%LOGFILE%" + if exist "%SystemRoot%\System32\OneDriveSetup.exe" ( + "%SystemRoot%\System32\OneDriveSetup.exe" /uninstall + if !errorlevel! neq 0 ( + echo ERROR: Failed to uninstall OneDrive + ) else ( + echo Successfully uninstalled OneDrive + ) + ) else ( + echo WARNING: OneDriveSetup.exe not found + ) +) else ( + echo WARNING: Microsoft OneDrive is not installed. Skipping uninstallation. +) +endlocal \ No newline at end of file diff --git a/StartLayouts/TCSE-Layout-Import-Admin.reg b/StartLayouts/TCSE-Layout-Import-Admin.reg new file mode 100644 index 0000000..9be068f Binary files /dev/null and b/StartLayouts/TCSE-Layout-Import-Admin.reg differ diff --git a/StartLayouts/TCSE-Layout-Import-User.reg b/StartLayouts/TCSE-Layout-Import-User.reg new file mode 100644 index 0000000..a8b38e5 Binary files /dev/null and b/StartLayouts/TCSE-Layout-Import-User.reg differ diff --git a/StartLayouts/TCSE-Layout.xml b/StartLayouts/TCSE-Layout.xml new file mode 100644 index 0000000..360ddf1 --- /dev/null +++ b/StartLayouts/TCSE-Layout.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TCSE-Computer-Deploy.bat b/TCSE-Computer-Deploy.bat new file mode 100644 index 0000000..ff15b57 --- /dev/null +++ b/TCSE-Computer-Deploy.bat @@ -0,0 +1,80 @@ +@echo off + +:: Install Winget Package Manager +C:\Scripts\Software\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle + +:: Install Chocolatey Package Manager +timeout /t 30 +echo Installing Chocolatey... +C:\Users\Tech\AppData\Local\Microsoft\WindowsApps\winget.exe install --id chocolatey.chocolatey --source winget + +:: Install Chocolatey Software +echo Installing Chocolatey Software... +C:\ProgramData\Chocolatey\choco.exe upgrade adobereader -y --ignore-checksums +C:\ProgramData\Chocolatey\choco.exe install googlechrome -y --ignore-checksums +C:\ProgramData\Chocolatey\choco.exe install google-drive-file-stream -y --ignore-checksums + +:: Install Printers +powershell -ExecutionPolicy Bypass -File "C:\Scripts\Printers\01-Printer-Scripts\01-PrinterInstall-AllPrinters.ps1" +powershell -ExecutionPolicy Bypass -File "C:\Scripts\Printers\01-Printer-Scripts\02.2-PrinterProperties-Import.ps1" + +:: Set Time Zone +tzutil /s "Central Standard Time" + +:: Install Additional Software +echo Installing Additional Software... +echo Installing GCPW... +C:\Scripts\Software\gcpwstandaloneenterprise64.exe /silent /fullinstall +echo GCPW Installed... +echo Installing MeshCentral... +C:\Scripts\Software\RemoteAgent64-TCSE.exe -fullinstall +echo MeshCentral Installed... +echo Installing Office 2016... +C:\Scripts\Software\Office2016\setup.exe /adminfile C:\Scripts\Software\Office2016\TCSE.MSP +echo Office 2016 Installed... + +:: Run Debloat Script +powershell -ExecutionPolicy Bypass -File "C:\Scripts\Software\Win11Debloat\Win11Debloat.ps1" -Silent -Sysprep -RemoveApps -RemoveCommApps -RemoveW11Outlook -RemoveDevApps -RemoveGamingApps -DisableDVR -ClearStartAllUsers -DisableTelemetry -DisableBing -DisableSuggestions -DisableLockscreenTips -ShowKnownFileExt -TaskbarAlignLeft -ShowSearchIconTb -HideTaskview -HideChat -DisableWidgets -DisableCopilot -DisableRecall + +::: Define Taskbar Layout Path +set "REG_FILES_DIR=C:\Scripts\StartLayouts" + +::: Loop through each .reg file in the directory +for %%f in (%REG_FILES_DIR%\*.reg) do ( + reg import "%%f" +) + +echo Taskbar layout successfully imported... + +:: Remove All Shortcuts from Public Desktop Folder +:: Set the path to the Public Desktop folder +set "PUBLIC_DESKTOP=%PUBLIC%\Desktop" + +:: Counter for deleted shortcuts +set "deleted_count=0" + +:: Check if the Public Desktop folder exists +if not exist "%PUBLIC_DESKTOP%" ( + echo Error: Public Desktop folder not found. + exit /b 1 +) + +:: Remove all .lnk files from the Public Desktop +for %%F in ("%PUBLIC_DESKTOP%\*.lnk") do ( + del "%%F" + if !errorlevel! equ 0 ( + set /a "deleted_count+=1" + ) +) + +:: Display results +echo Deleted !deleted_count! shortcut(s) from the Public Desktop. + +:: 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' + +:: Restart System +echo Restarting system in 5 minutes... +timeout /t 300 +shutdown /r /t 0 \ No newline at end of file diff --git a/TCSE-Login.bat b/TCSE-Login.bat new file mode 100644 index 0000000..ee01a92 --- /dev/null +++ b/TCSE-Login.bat @@ -0,0 +1,53 @@ +@echo off +setlocal EnableDelayedExpansion + +:: Script to configure default file associations, remove OneDrive, disable Edge, and launch Google Drive +:: Created: 2024-11-21 + +:: Set up logging +set "LOGFILE=%TEMP%\tcse-login-script.log" +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 + +:: Disable OneDrive Startup +echo Disable OneDrive Startup... >> "%LOGFILE%" +powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\Disable-OneDriveStartup.ps1" + +:: Disable Edge Startup +echo Disable Edge Startup... >> "%LOGFILE%" +powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\Disable-EdgeStartup.ps1" + +:: Remove Edge Desktop Shortcut +echo Remove Edge Desktop Shortcut... >> "%LOGFILE%" +powershell -ExecutionPolicy Bypass -File "C:\Scripts\Login\Remove-EdgeShortcut.ps1" + +:: Launch Google Drive for Desktop +:: Check if Google Drive File Stream is already set to launch on startup +reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "GoogleDriveFS" >nul 2>&1 +if %errorlevel% equ 0 ( + echo Google Drive File Stream is already set to launch on startup. >> "%LOGFILE%" +) else ( + echo Launching Google Drive for Desktop... >> "%LOGFILE%" + start /B "" "C:\Program Files\Google\Drive File Stream\launch.bat" + + :: Wait for Google Drive to launch + timeout /t 5 /nobreak > nul +) + +:: Uninstall OneDrive +echo Uninstall OneDrive... >> "%LOGFILE%" +"C:\Scripts\Login\Uninstall-OneDrive.bat" + +echo Script completed at %DATE% %TIME% >> "%LOGFILE%" +echo Log file created at: %LOGFILE% + +endlocal \ No newline at end of file diff --git a/TCSE-Login.vbs b/TCSE-Login.vbs new file mode 100644 index 0000000..44e12dd --- /dev/null +++ b/TCSE-Login.vbs @@ -0,0 +1,4 @@ +Dim WshShell +Set WshShell = CreateObject("Wscript.Shell") +WshShell.Run "cmd /c C:\Scripts\TCSE-Login.bat", 0, False +Set WshShell = Nothing \ No newline at end of file