172 lines
5.5 KiB
Plaintext
172 lines
5.5 KiB
Plaintext
# Windows 11 Pro Client Boxstarter Script: Grundpaket und Konfiguration (c) Tüit GmbH
|
|
# 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------------------------
|
|
# Hostname abfragen (Pflichtfeld)
|
|
do {
|
|
$dHostname = Read-Host 'Input desired Hostname (required)'
|
|
} until ($dHostname -ne "")
|
|
|
|
#---------------Helper Functions--------------------------
|
|
$SuccessInstalls = @()
|
|
$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-------------------------------
|
|
choco features enable -n=allowGlobalConfirmation
|
|
choco feature enable -n=allowEmptyChecksums
|
|
New-Item -ErrorAction Ignore -Path "C:\" -Name "temp" -ItemType "directory"
|
|
|
|
#----------------Configure Windows------------------------
|
|
# Set Hostname
|
|
Write-Host "Setting Hostname to $dHostname"
|
|
Rename-Computer -NewName "$dHostname" -Force
|
|
|
|
# Enable RemoteDesktop
|
|
Enable-RemoteDesktop
|
|
|
|
# Remove annoying Windows Stuff
|
|
Disable-GameBarTips
|
|
|
|
# Taskbar Optionen
|
|
Set-TaskbarOptions -Size Small -Dock Bottom -Combine Full -Lock
|
|
Set-TaskbarOptions -Size Small -Dock Bottom -Combine Full -AlwaysShowIconsOn
|
|
|
|
# Explorer Optionen
|
|
Set-WindowsExplorerOptions -EnableShowFullPathInTitleBar
|
|
|
|
# Disable IPv6
|
|
Write-Host DisabledComponents registry key:
|
|
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 0xFF /f
|
|
|
|
# Zeitserver einstellen
|
|
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 all Updates (inkl. optionale Updates, MicrosoftUpdate, Autoreboot)
|
|
Write-Host "Starte Windows Update (alle Updates inkl. optional)..."
|
|
Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot
|
|
|
|
#---------------Install Tueit Basic Software---------------------
|
|
Install-ChocoPackage "javaruntime"
|
|
Install-ChocoPackage "vlc"
|
|
Install-ChocoPackage "7zip"
|
|
Install-ChocoPackage "firefox"
|
|
Install-ChocoPackage "greenshot"
|
|
Install-ChocoPackage "thunderbird"
|
|
Install-ChocoPackage "openvpn-connect"
|
|
Install-ChocoPackage "rustdesk --params '\"/config: host=rd.tueit.de,key=udW7BhgOOwFypZX4KKGMBORO4EG6+MvsPVEmY99F4UA=\"'"
|
|
Install-ChocoPackage "libreoffice-fresh"
|
|
|
|
# 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---------------
|
|
$applicationList = @(
|
|
"*MarchofEmpires*"
|
|
"*Autodesk*"
|
|
"*BubbleWitch*"
|
|
"*garden*"
|
|
"*hidden*"
|
|
"*deezer*"
|
|
"*phototastic*"
|
|
"*tunein*"
|
|
"king.com*"
|
|
"G5*"
|
|
"*Facebook*"
|
|
"*Keeper*"
|
|
"*.EclipseManager"
|
|
"ActiproSoftwareLLC.562882FEEB491"
|
|
"*DolbyAccess*"
|
|
"*disney*"
|
|
"*HiddenCityMysteryofShadows*"
|
|
"*Dell*"
|
|
"*Dropbox*"
|
|
"*McAfee*"
|
|
"*Minecraft*"
|
|
"*Twitter*"
|
|
"*outlook*"
|
|
"*onedrive*"
|
|
"*onenote*"
|
|
"Microsoft.*advertising*"
|
|
"Microsoft.*3D*"
|
|
"Microsoft.Bing*"
|
|
"Microsoft.Copilot*"
|
|
"Microsoft.Getstarted"
|
|
"Microsoft.Messaging"
|
|
"Microsoft.MicrosoftOfficeHub"
|
|
"Microsoft.MicrosoftStickyNotes"
|
|
"Microsoft.Music*"
|
|
"Microsoft.Office.OneNote"
|
|
"Microsoft.Office.Sway"
|
|
"Microsoft.OneConnect"
|
|
"Microsoft.OneDriveSync"
|
|
"Microsoft.People"
|
|
"Microsoft.SkypeApp"
|
|
"Microsoft.MicrosoftSolitaireCollection"
|
|
"Microsoft.Wallet"
|
|
"Microsoft.WindowsFeedbackHub"
|
|
"Microsoft.WindowsMaps"
|
|
"Microsoft.WindowsSoundRecorder"
|
|
"microsoft.windowscommunicationsapps"
|
|
"Microsoft.Zune*"
|
|
"MicrosoftTeams"
|
|
"*WebExperience*"
|
|
)
|
|
|
|
foreach ($app in $applicationList) {
|
|
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" |