tiNGrundpaketClient.txt aktualisiert

This commit is contained in:
2025-08-20 13:49:06 +00:00
parent baa93dcb61
commit 1728162194

View File

@ -1,64 +1,99 @@
#Windows 11 Pro Client Boxstarter Script: Grundpaket und Konfiguration (c) Tüit GmbH # Windows 11 Pro Client Boxstarter Script: Grundpaket und Konfiguration (c) Tüit GmbH
#TODO: Defaultprograms for Datatypes, Install all Updates (not only critical) # Erweiterungen: Vollständige Updates, Schnellstart deaktivieren, LibreOffice, Bugfix, Admin aktivieren, Firefox Default, Logging, Abschlussbericht
#----------------Logging starten------------------------
$LogFile = "C:\temp\setup-log-$(Get-Date -Format yyyy-MM-dd_HH-mm-ss).txt"
Start-Transcript -Path $LogFile -Append
Write-Host "Logging gestartet. Alle Ausgaben werden in $LogFile gespeichert."
#----------------Setting Variables------------------------ #----------------Setting Variables------------------------
# Hostname abfragen (Pflichtfeld)
do {
$dHostname = Read-Host 'Input desired Hostname (required)'
} until ($dHostname -ne "")
#Other Variables #---------------Helper Functions--------------------------
$dHostname = Read-Host 'Input desired Hostname (Default: Keep current hostname)' $SuccessInstalls = @()
if($dHostname -eq ""){$dHostname = [Net.Dns]::GetHostName()} $FailedInstalls = @()
function Install-ChocoPackage {
param([string]$pkg)
choco install $pkg -y --cacheLocation="c:\temp"
if ($LASTEXITCODE -eq 0) {
Write-Host "[$pkg] erfolgreich installiert."
$SuccessInstalls += $pkg
} else {
Write-Host "FEHLER: [$pkg] konnte nicht installiert werden!" -ForegroundColor Red
$FailedInstalls += $pkg
}
}
function removeApp {
Param ([string]$appName)
Write-Output "Trying to remove $appName"
Get-AppxPackage $appName -AllUsers | Remove-AppxPackage -ErrorAction SilentlyContinue
Get-AppXProvisionedPackage -Online | Where-Object DisplayName -like $appName | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
}
#---------------Configure Chocolatey and Environment------------------------------- #---------------Configure Chocolatey and Environment-------------------------------
choco features enable -n=allowGlobalConfirmation choco features enable -n=allowGlobalConfirmation
choco feature enable -n=allowEmptyChecksums choco feature enable -n=allowEmptyChecksums
New-Item -ErrorAction Ignore -Path "C:\" -Name "temp" -ItemType "directory"` New-Item -ErrorAction Ignore -Path "C:\" -Name "temp" -ItemType "directory"
#----------------Configure Windows------------------------ #----------------Configure Windows------------------------
#Set Hostname # Set Hostname
Write-Host "Setting Hostname to $dHostname": Write-Host "Setting Hostname to $dHostname"
Rename-Computer -NewName "$dHostname" -Force Rename-Computer -NewName "$dHostname" -Force
#Enable RemoteDesktop
# Enable RemoteDesktop
Enable-RemoteDesktop Enable-RemoteDesktop
#Remove annoying Windows Stuff
# Remove annoying Windows Stuff
Disable-GameBarTips Disable-GameBarTips
#Set Taskbar to Lock and put it to the bottom and show all icons
# Taskbar Optionen
Set-TaskbarOptions -Size Small -Dock Bottom -Combine Full -Lock Set-TaskbarOptions -Size Small -Dock Bottom -Combine Full -Lock
Set-TaskbarOptions -Size Small -Dock Bottom -Combine Full -AlwaysShowIconsOn Set-TaskbarOptions -Size Small -Dock Bottom -Combine Full -AlwaysShowIconsOn
#Show Hidden Files, File Extensions, Systemfiles and Full-Path in Titlebar
# Explorer Optionen
Set-WindowsExplorerOptions -EnableShowFullPathInTitleBar Set-WindowsExplorerOptions -EnableShowFullPathInTitleBar
#Disable IPv6
# Disable IPv6
Write-Host DisabledComponents registry key: Write-Host DisabledComponents registry key:
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 0xFF /f reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 0xFF /f
#Zeitserver einstellen
#reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /v (Standard) /t REG_SZ /d 1 /f # Zeitserver einstellen
#reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /v 1 /t REG_SZ /d 0.de.pool.ntp.org /f
#reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /v 2 /t REG_SZ /d 1.de.pool.ntp.org /f
net time /setsntp:"0.de.pool.ntp.org" net time /setsntp:"0.de.pool.ntp.org"
# Schnellstart deaktivieren
Write-Host "Schnellstart wird deaktiviert..."
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t REG_DWORD /d 0 /f
# Lokalen Administrator aktivieren
Write-Host "Lokalen Administrator aktivieren..."
net user Administrator /active:yes
#---------------Install important Windows Packages--------------- #---------------Install important Windows Packages---------------
#Install all critical OS Updates # Install all Updates (inkl. optionale Updates, MicrosoftUpdate, Autoreboot)
Install-WindowsUpdate -AcceptEula -GetUpdatesFromMS Write-Host "Starte Windows Update (alle Updates inkl. optional)..."
choco install javaruntime -y --cacheLocation="c:\temp" Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot
#---------------Install Tueit Basic Software--------------------- #---------------Install Tueit Basic Software---------------------
choco install vlc -y --cacheLocation="c:\temp" Install-ChocoPackage "javaruntime"
#choco install adobereader -y --cacheLocation="c:\temp" Install-ChocoPackage "vlc"
choco install 7zip -y --cacheLocation="c:\temp" Install-ChocoPackage "7zip"
choco install firefox -y --cacheLocation="c:\temp" Install-ChocoPackage "firefox"
#choco install googlechrome -y --cacheLocation="c:\temp" Install-ChocoPackage "greenshot"
choco install greenshot -y --cacheLocation="c:\temp" Install-ChocoPackage "thunderbird"
choco install thunderbird -y --cacheLocation="c:\temp" Install-ChocoPackage "openvpn-connect"
#choco install pdf24 -y --cacheLocation="c:\temp" Install-ChocoPackage "rustdesk --params '\"/config: host=rd.tueit.de,key=udW7BhgOOwFypZX4KKGMBORO4EG6+MvsPVEmY99F4UA=\"'"
choco install openvpn-connect -y --cacheLocation="c:\temp" Install-ChocoPackage "libreoffice-fresh"
choco install rustdesk --params "'/config: host=rd.tueit.de,key=udW7BhgOOwFypZX4KKGMBORO4EG6+MvsPVEmY99F4UA='"
# Firefox als Standard-Browser setzen
Write-Host "Setze Firefox als Standardbrowser..."
Start-Process -FilePath "C:\Program Files\Mozilla Firefox\firefox.exe" -ArgumentList "--setDefaultBrowser" -Wait
#---------------Remove junk--------------- #---------------Remove junk---------------
function removeApp {
Param ([string]$appName)
Write-Output "Trying to remove $appName"
Get-AppxPackage $appName -AllUsers | Remove-AppxPackage
Get-AppXProvisionedPackage -Online | Where DisplayNam -like $appName | Remove-AppxProvisionedPackage -Online
}
$applicationList = @( $applicationList = @(
"*MarchofEmpires*" "*MarchofEmpires*"
"*Autodesk*" "*Autodesk*"
@ -73,18 +108,15 @@ $applicationList = @(
"*Facebook*" "*Facebook*"
"*Keeper*" "*Keeper*"
"*.EclipseManager" "*.EclipseManager"
"ActiproSoftwareLLC.562882FEEB491" # Code Writer "ActiproSoftwareLLC.562882FEEB491"
"*DolbyAccess*" "*DolbyAccess*"
"*disney*" "*disney*"
"*HiddenCityMysteryofShadows*" "*HiddenCityMysteryofShadows*"
"*Dell*" "*Dell*"
"*Dropbox*" "*Dropbox*"
"*Facebook*"
"*Keeper*"
"*McAfee*" "*McAfee*"
"*Minecraft*" "*Minecraft*"
"*Twitter*" "*Twitter*"
"*outlook*" "*outlook*"
"*onedrive*" "*onedrive*"
"*onenote*" "*onenote*"
@ -112,8 +144,29 @@ $applicationList = @(
"Microsoft.Zune*" "Microsoft.Zune*"
"MicrosoftTeams" "MicrosoftTeams"
"*WebExperience*" "*WebExperience*"
); )
foreach ($app in $applicationList) { foreach ($app in $applicationList) {
removeApp $app removeApp $app
} }
#---------------Abschlussbericht---------------------
Write-Host "`n========== ABSCHLUSSBERICHT =========="
Write-Host "Erfolgreich installierte Pakete:"
if ($SuccessInstalls.Count -gt 0) {
$SuccessInstalls | ForEach-Object { Write-Host " - $_" }
} else {
Write-Host " (keine)"
}
Write-Host "`nFehlgeschlagene Pakete:"
if ($FailedInstalls.Count -gt 0) {
$FailedInstalls | ForEach-Object { Write-Host " - $_" }
} else {
Write-Host " (keine)"
}
Write-Host "======================================"
#----------------Logging beenden------------------------
Stop-Transcript
Write-Host "Setup abgeschlossen. Logdatei: $LogFile"