Script para Optimizar una VDI

 Ene, 03 - 2019   sin comentarios   Windows 10

Hola cuantaveces nos pasa que estamos creando un entorno de VDI y la imagen masestra no es una imagen LTSC… y solo tenemos una imagen windows 10 enterprise para hacer funcionar nuestro entorno..

Esto lleva muchos problemas:

Servicios de Netflix instalados, Tienda de windows, servicios de Xbox… esto hace que relantize todo el login de nuestra VDI.

pues señore he modificado uno de los tantos que existen en internet para que vuestros operadores de instalacion puedan entender el script…

OJO algunas linieas estan cargadas de Humor…

<#
.SINOPSIS
Tenga en cuenta que este script configura Windows 10 con una configuración mínima específicamente para escritorios virtuales: VDI.
.DESCRIPCIÓN
¡Este script se proporciona como está! Es decir, ¡blogs.itpro.es/maitchovcow no es accesible a ningún problema, problema u otro error del sistema que pueda o no pueda enfrentar!
Este script configura Windows 10 con una configuración mínima para VDI. No importa si usa Citrix XenDesktop o VMWare Horizon View, este script sintoniza Windows 10 como un sistema operativo.
// UTILIZAR CON PROPIO RIESGO - ¡NO UTILIZAR EN INSTALACIONES DE ESCRITORIO! ¡DESDE QUE SE ENGAÑARÁ CON MUCHAS CARACTERÍSTICAS! // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! Este script se proporciona TAL CUAL ES Es decir, ¡ blogs.itpro.es/maitchovcow NO es elegible para ningún problema, problema u otro error del sistema que pueda o no pueda enfrentar! Revise este script a FONDO antes de aplicar a su máquina virtual, y deshabilite los cambios a continuación según sea necesario para ajustarlo a su entorno actual. ¡Recuerda si lo rompes, es tu culpa! Tenga en cuenta también que es mejor usar esto con las versiones de Windows 10 Enterprise Basado en un Scritp con alguno ajustes propios de Alexander Ervik Johnsen http://www.ervik.as/
.PARÁMETRO NoWarn
¿Necesita depurar o ha agregado más ajustes? ¡Use esto para eliminar las indicaciones de advertencia al principio y al final del script!
.EJEMPLO
.\VDI_Tuner_AELM.ps1 -NoWarn $true
.NOTES
Author: Anatol Emilio Lopez Maitchovcow
Last Update: 19.09.2018
Version: 1.0.9
.LOG
1.0.1 – modified sc command to sc.exe to prevent PS from invoking set-content
1.0.2 – modified UWP Application section to avoid issues with CopyProfile, updated onedrive removal, updated for TH2
1.0.3 – modified UWP Application section to disable “Consumer Experience” features, modified scheduled tasks to align with 1511 and further version supportability
1.0.4 – fixed duplicates / issues in service config
1.0.5 – updated applist for Win10 1607, moved some things out of the critical area (if you’ve run this before, please review!)
1.0.6 – blocked disabling of the Device Association service, disabling service can cause logon delays on domain-joined Win10 1607 systems
1.0.7 – Changed OneDrive section to remove issues plaguing 1709+ installs using Folder Redirection
1.0.8 – modified UWP Application section to remove Applications added in 1703, 1709, and 1803, added additional code to remove OneDrive
1.0.9 – Se modifico y cambio las sentencias a español para entendimiento
>
>
Parse Params:
[CmdletBinding()]
Param(
[Parameter(
Position=0,
Mandatory=$False,
HelpMessage=”Verdadero o Falso, ¿quiere ver las advertencias?”
)]
[bool] $NoWarn = $False
)
Throw caution (to the wind?) – show if NoWarn param is not passed, or passed as $false:
If ($NoWarn -eq $False)
{
Write-Host “ESTE SEGUIMIENTO HACE MUCHOS CAMBIOS EN LA INSTALACIÓN PREDETERMINADA DE WINDOWS 10, TANTO ÚNICAMENTE PARA VDI Y BAJO SU PROPIO RIESGO.” -ForegroundColor Yellow
Write-Host “”
Write-Host “Revise este script a FONDO antes de aplicar a su máquina virtual, y deshabilite los cambios a continuación según sea necesario para adaptarse a su entorno actual.” -ForegroundColor Yellow
Write-Host “”
Write-Host “Esta secuencia de comandos se proporciona TAL CUAL, el uso de esta fuente supone que usted está al menos familiarizado con PowerShell y las herramientas utilizadas para crear y depurar esta secuencia de comandos.” -ForegroundColor Yellow
Write-Host “”
Write-Host “”
Write-Host “En otras palabras, si la rompes, puedes conservar las piezas.” -ForegroundColor Magenta
Write-Host “”
Write-Host “”
}
$ProgressPreference = “SilentlyContinue”
$ErrorActionPreference = “SilentlyContinue”
Configure Constants:
$BranchCache = “False”
$Cortana = “False”
$DiagService = “False”
$EAPService = “False”
$EFS = “False”
$FileHistoryService = “False”
$iSCSI = “False”
$MachPass = “True”
$MSSignInService = “True”
$OneDrive = “True”
$PeerCache = “False”
$Search = “True”
$SMB1 = “False”
$SMBPerf = “False”
$Themes = “True”
$Touch = “False”
$StartApps = “False”
$AllStartApps = “True”
$Install_NetFX3 = “True”
$NetFX3_Source = “D:\Sources\SxS”
$RDPEnable = 1
$RDPFirewallOpen = 1
$NLAEnable = 1
Set up additional registry drives:
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
Get list of Provisioned Start Screen Apps
$Apps = Get-ProvisionedAppxPackage -Online
// ============
// Begin Config
// ============
Set VM to High Perf scheme:
Write-Host “Configuración de VM en Esquema de potencia de alto rendimiento …” -ForegroundColor Green
Write-Host “”
POWERCFG -SetActive ‘8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c’
Install NetFX3
If ($Install_NetFX3 -eq “True”)
{
Write-Host “instalando .NET 3.5…” -ForegroundColor Green
dism /online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:$NetFX3_Source /NoRestart
Write-Host “”
Write-Host “”
}
Remove (Almost All) Inbox Universal Apps:
If ($StartApps -eq “False”)
{
# Disable “Consumer Features” (aka downloading apps from the internet automatically)
New-Item -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Windows\’ -Name ‘CloudContent’ | Out-Null
New-ItemProperty -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent’ -Name ‘DisableWindowsConsumerFeatures’ -PropertyType DWORD -Value ‘1’ | Out-Null
# Disable the “how to use Windows” contextual popups
New-ItemProperty -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent’ -Name ‘DisableSoftLanding’ -PropertyType DWORD -Value ‘1’ | Out-Null
Write-Host "Eliminado (la mayoría) de las aplicaciones universales integradas ..." -ForegroundColor Yellow Write-Host "" ForEach ($App in $Apps) { # Help / "Get" Apps If ($App.DisplayName -eq "Microsoft.Getstarted") { Write-Host "Eliminando la aplicación Get Started..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.SkypeApp") { Write-Host "no mas llamadas Skype App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.MicrosoftOfficeHub") { Write-Host "Eliminado Office 365..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } # Games / XBox apps If ($App.DisplayName -eq "Microsoft.XboxApp") { Write-Host "NO mas XBOX Eliminado XBOX..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.ZuneMusic") { Write-Host "Si quieres musica usa tu movil... Eliminado Grovee..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.ZuneVideo") { Write-Host "No veras TV... Eliminado TV..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.MicrosoftSolitaireCollection") { Write-Host "Te voy a quitar la divercion!!! Eliminado el solitario..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } # News / Sports / Weather If ($App.DisplayName -eq "Microsoft.BingFinance") { Write-Host "Si quieres ver tus acciones de la bolsa usa tu movil, Eliminado Finazas..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.BingNews") { Write-Host "Para que queremos estar informados? eliminado las noticias..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.BingSports") { Write-Host "Eliminado los deportes..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.BingWeather") { Write-Host "Removiendo el puto clima App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } # Others If ($App.DisplayName -eq "Microsoft.3DBuilder") { Write-Host "borrando 3D Builder App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.People") { Write-Host "Eliminado los putos contactos App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.WindowsAlarms") { Write-Host "Eliminado las putas Alarms App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.Windows.Photos") { Write-Host "Eliminado Photos App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.WindowsCalculator") { Write-Host "Eliminado la calculadora Store App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.WindowsCamera") { Write-Host "Eliminado Camera App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.WindowsMaps") { Write-Host "Eliminado Maps App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.WindowsPhone") { Write-Host "Eliminado Phone Companion App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.WindowsSoundRecorder") { Write-Host "Eliminado Voice Recorder App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.Office.Sway") { Write-Host "Eliminado Office Sway App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.Messaging") { Write-Host "Eliminado Messaging App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.ConnectivityStore") { Write-Host "Eliminando conectividad Store helper App ..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } } Start-Sleep -Seconds 5 Write-Host "" Write-Host "" # Remove (the rest of the) Inbox Universal Apps: If ($AllStartApps -eq "False") { Write-Host "Eliminado (el resto de la mierda) de las aplicaciones universales integradas.." -ForegroundColor Magenta Write-Host "" ForEach ($App in $Apps) { If ($App.DisplayName -eq "Microsoft.Office.OneNote") { Write-Host "Eliminado OneNote App..." -ForegroundColor Magenta Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.windowscommunicationsapps") { Write-Host "Eliminado People, Mail, and Calendar Apps support (Mas basura)..." -ForegroundColor Magenta Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.CommsPhone") { Write-Host "Eliminado CommsPhone helper App..." -ForegroundColor Yellow Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } If ($App.DisplayName -eq "Microsoft.WindowsStore") { Write-Host "quitando la puta Store App..." -ForegroundColor Red Remove-AppxProvisionedPackage -Online -PackageName $App.PackageName | Out-Null Remove-AppxPackage -Package $App.PackageName | Out-Null } } Start-Sleep -Seconds 5 Write-Host "" Write-Host "" }
}
Disable Cortana:
New-Item -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Windows\’ -Name ‘Windows Search’ | Out-Null
If ($Cortana -eq “False”)
{
Write-Host “Quitando Cortana…(Ya se quedara callada para siempre)” -ForegroundColor Yellow
Write-Host “”
New-ItemProperty -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search’ -Name ‘AllowCortana’ -PropertyType DWORD -Value ‘0’ | Out-Null
}
Remove OneDrive:
If ($OneDrive -eq “False”)
{
# Remove OneDrive (not guaranteed to be permanent – see https://support.office.com/en-US/article/Turn-off-or-uninstall-OneDrive-f32a17ce-3336-40fe-9c38-6efb09f944b0):
Write-Host “Quitando OneDrive …” -ForegroundColor Yellow
C:\Windows\SysWOW64\OneDriveSetup.exe /uninstall
Start-Sleep -Seconds 30
New-Item -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Windows\’ -Name ‘Skydrive’ | Out-Null
New-ItemProperty -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Windows\Skydrive’ -Name ‘DisableFileSync’ -PropertyType DWORD -Value ‘1’ | Out-Null
New-ItemProperty -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Windows\Skydrive’ -Name ‘DisableLibrariesDefaultSaveToSkyDrive’ -PropertyType DWORD -Value ‘1’ | Out-Null
Remove-Item -Path ‘HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions{A52BBA46-E9E1-435f-B3D9-28DAA648C0F6}’ -Recurse
Remove-Item -Path ‘HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions{A52BBA46-E9E1-435f-B3D9-28DAA648C0F6}’ -Recurse
Set-ItemProperty -Path ‘HKCR:\CLSID{018D5C66-4533-4307-9B53-224DE2ED1FE6}’ -Name ‘System.IsPinnedToNameSpaceTree’ -Value ‘0’
Set-ItemProperty -Path ‘HKCR:\Wow6432Node\CLSID{018D5C66-4533-4307-9B53-224DE2ED1FE6}’ -Name ‘System.IsPinnedToNameSpaceTree’ -Value ‘0’
}
Set PeerCaching to Disabled (0) or Local Network PCs only (1):
If ($PeerCache -eq “False”)
{
Write-Host “Desabilitando PeerCaching…” -ForegroundColor Yellow
Write-Host “”
Set-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config’ -Name ‘DODownloadMode’ -Value ‘0’
}
Else
{
Write-Host “Configurando PeerCaching…” -ForegroundColor Cyan
Write-Host “”
Set-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config’ -Name ‘DODownloadMode’ -Value ‘1’
}
Disable Services:
Write-Host “configurando Services…” -ForegroundColor Cyan
Write-Host “”
Write-Host “Deshabilitar todo el servicio RouterJoyn…” -ForegroundColor Cyan
Set-Service AJRouter -StartupType Disabled
Write-Host “Deshabilitar el servicio de puerta de enlace de la capa de aplicación…” -ForegroundColor Cyan
Set-Service ALG -StartupType Disabled
Write-Host “Deshabilitar el servicio de transferencia inteligente en segundo plano…” -ForegroundColor Cyan
Set-Service BITS -StartupType Disabled
Write-Host “Deshabilitar el servicio de encriptación de unidad Bitlocker…” -ForegroundColor Cyan
Set-Service BDESVC -StartupType Disabled
Write-Host “Deshabilitar el servicio de motor de copia de seguridad de nivel de bloque…” -ForegroundColor Cyan
Set-Service wbengine -StartupType Disabled
Write-Host “Deshabilitar el servicio Bluetooth manos libres (Por dios es un VDI)…” -ForegroundColor Cyan
Set-Service BthHFSrv -StartupType Disabled
Write-Host “Deshabilitar el servicio de soporte Bluetooth…” -ForegroundColor Cyan
Set-Service bthserv -StartupType Disabled
If ($BranchCache -eq “False”)
{
Write-Host “Deshabilitar el servicio BranchCache…” -ForegroundColor Yellow
Set-Service PeerDistSvc -StartupType Disabled
}
Write-Host “Deshabilitar el servicio del navegador de la computadora…” -ForegroundColor Cyan
Set-Service Browser -StartupType Disabled
Write-Host “Deshabilitar el servicio de asociación de dispositivos…” -ForegroundColor Cyan
Set-Service DeviceAssociationService -StartupType Disabled
Write-Host “Deshabilitar el servicio del administrador de instalación de dispositivos…” -ForegroundColor Cyan
Set-Service DsmSvc -StartupType Disabled
Write-Host “Desactivando el servicio de política de diagnóstico…” -ForegroundColor Cyan
Set-Service DPS -StartupType Disabled
Write-Host “Deshabilitar servicio de host de servicio de diagnóstico…” -ForegroundColor Cyan
Set-Service WdiServiceHost -StartupType Disabled
Write-Host “Deshabilitar el servicio de host del sistema de diagnóstico…” -ForegroundColor Cyan
Set-Service WdiSystemHost -StartupType Disabled
If ($DiagService -eq “False”)
{
Write-Host “Deshabilitar el servicio de seguimiento de diagnósticos…” -ForegroundColor Yellow
Set-Service DiagTrack -StartupType Disabled
}
If ($EFS -eq “False”)
{
Write-Host “Deshabilitar el servicio de sistema de archivos de cifrado…” -ForegroundColor Yellow
Set-Service EFS -StartupType Disabled
}
If ($EAPService -eq “False”)
{
Write-Host “Deshabilitar el servicio de protocolo de autenticación extensible…” -ForegroundColor Yellow
Set-Service Eaphost -StartupType Disabled
}
Write-Host “Deshabilitar el servicio de fax…” -ForegroundColor Cyan
Set-Service Fax -StartupType Disabled
Write-Host “Deshabilitar el servicio de publicación de recursos de descubrimiento de funciones…” -ForegroundColor Cyan
Set-Service FDResPub -StartupType Disabled
If ($FileHistoryService -eq “False”)
{
Write-Host “Deshabilitar el servicio de historial de archivos…” -ForegroundColor Yellow
Set-Service fhsvc -StartupType Disabled
}
Write-Host “Deshabilitar el servicio de geolocalización…” -ForegroundColor Cyan
Set-Service lfsvc -StartupType Disabled
Write-Host “Deshabilitar el servicio de escucha del grupo local…” -ForegroundColor Cyan
Set-Service HomeGroupListener -StartupType Disabled
Write-Host “Deshabilitar el servicio del proveedor del grupo local…” -ForegroundColor Cyan
Set-Service HomeGroupProvider -StartupType Disabled
Write-Host “Deshabilitar el servicio del proveedor del grupo local…” -ForegroundColor Cyan
Set-Service HomeGroupProvider -StartupType Disabled
Write-Host “Deshabilitar el servicio de Conexión compartida a Internet (ICS)…” -ForegroundColor Cyan
Set-Service SharedAccess -StartupType Disabled
If ($MSSignInService -eq “False”)
{
Write-Host “Deshabilitar el servicio de asistente de inicio de sesión de cuenta de Microsoft…” -ForegroundColor Yellow
Set-Service wlidsvc -StartupType Disabled
}
If ($iSCSI -eq “False”)
{
Write-Host “Deshabilitar el servicio iniciador iSCSI de Microsoft…” -ForegroundColor Yellow
Set-Service MSiSCSI -StartupType Disabled
}
Write-Host “Deshabilitar el servicio de proveedor de instantáneas de software de Microsoft…” -ForegroundColor Cyan
Set-Service swprv -StartupType Disabled
Write-Host “Deshabilitar el servicio SMP de Microsoft Storage Spaces…” -ForegroundColor Cyan
Set-Service swprv -StartupType Disabled
Write-Host “Deshabilitar el servicio de archivos sin conexión…” -ForegroundColor Cyan
Set-Service CscService -StartupType Disabled
Write-Host “Deshabilitar el servicio Optimizar unidades…” -ForegroundColor Cyan
Set-Service defragsvc -StartupType Disabled
Write-Host “Deshabilitar el servicio de asistente de compatibilidad de programas…” -ForegroundColor Cyan
Set-Service PcaSvc -StartupType Disabled
Write-Host “Deshabilitar el servicio de experiencia de video de audio de Windows de calidad…” -ForegroundColor Cyan
Set-Service QWAVE -StartupType Disabled
Write-Host “Deshabilitar el servicio de demostración de venta minorista…” -ForegroundColor Cyan
Set-Service RetailDemo -StartupType Disabled
Write-Host “Deshabilitar el servicio de protocolo de túnel de sockets seguros…” -ForegroundColor Cyan
Set-Service SstpSvc -StartupType Disabled
Write-Host “Deshabilitar el servicio de datos del sensor…” -ForegroundColor Cyan
Set-Service SensorDataService -StartupType Disabled
Write-Host “Deshabilitar el servicio de monitoreo del sensor…” -ForegroundColor Cyan
Set-Service SensrSvc -StartupType Disabled
Write-Host “Deshabilitar el servicio del sensor…” -ForegroundColor Cyan
Set-Service SensorService -StartupType Disabled
Write-Host “Deshabilitar el servicio de detección de hardware de shell…” -ForegroundColor Cyan
Set-Service ShellHWDetection -StartupType Disabled
Write-Host “Deshabilitar el servicio de trama SNMP…” -ForegroundColor Cyan
Set-Service SNMPTRAP -StartupType Disabled
Write-Host “Deshabilitar Spot Verifier Service…” -ForegroundColor Cyan
Set-Service svsvc -StartupType Disabled
Write-Host “Deshabilitar SSDP Discovery Service…” -ForegroundColor Cyan
Set-Service SSDPSRV -StartupType Disabled
Write-Host “Deshabilitar Still Image Acquisition Events Service…” -ForegroundColor Cyan
Set-Service WiaRpc -StartupType Disabled
Write-Host “Deshabilitar Telephony Service…” -ForegroundColor Cyan
Set-Service TapiSrv -StartupType Disabled
If ($Themes -eq “False”)
{
Write-Host “Deshabilitar los temas de mierda…” -ForegroundColor Yellow
Set-Service Themes -StartupType Disabled
}
If ($Touch -eq “False”)
{
Write-Host “Deshabilitar Touch Keyboard and Handwriting Panel Service…” -ForegroundColor Yellow
Set-Service TabletInputService -StartupType Disabled
}
Write-Host “Deshabilitar UPnP Device Host Service (No queremos que motes torrents)…” -ForegroundColor Cyan
Set-Service upnphost -StartupType Disabled
Write-Host “Disabling Volume Shadow Copy Service…” -ForegroundColor Cyan
Set-Service VSS -StartupType Disabled
Write-Host “Deshabilitar Windows Color System Service…” -ForegroundColor Cyan
Set-Service WcsPlugInService -StartupType Disabled
Write-Host “Deshabilitar Windows Connect Now – Config Registrar Service…” -ForegroundColor Cyan
Set-Service wcncsvc -StartupType Disabled
Write-Host “Deshabilitar Windows Error Reporting Service (Mis errores son mios y que no lo sepan los demas)…” -ForegroundColor Cyan
Set-Service WerSvc -StartupType Disabled
Write-Host “DDeshabilitar Windows Image Acquisition (WIA) Service…” -ForegroundColor Cyan
Set-Service stisvc -StartupType Disabled
Write-Host “Deshabilitar Windows Media Player Network Sharing Service (no queremos que compartas musica ni viedos con los demas…” -ForegroundColor Cyan
Set-Service WMPNetworkSvc -StartupType Disabled
Write-Host “Deshabilitar Windows Mobile Hotspot Service (no creo que necesites compartir el wifi con un VDI)…” -ForegroundColor Cyan
Set-Service icssvc -StartupType Disabled
If ($Search -eq “False”)
{
Write-Host “Deshabilitar Windows Search Service…” -ForegroundColor Yellow
Set-Service WSearch -StartupType Disabled
}
Write-Host “Deshabilitar WLAN AutoConfig Service…” -ForegroundColor Cyan
Set-Service WlanSvc -StartupType Disabled
Write-Host “Deshabilitar WWAN AutoConfig Service…” -ForegroundColor Cyan
Set-Service WwanSvc -StartupType Disabled
Write-Host “Deshabilitar Xbox Live Auth Manager Service…” -ForegroundColor Cyan
Set-Service XblAuthManager -StartupType Disabled
Write-Host “Disabling Xbox Live Game Save Service…” -ForegroundColor Cyan
Set-Service XblGameSave -StartupType Disabled
Write-Host “Deshabilitar Xbox Live Networking Service Service…” -ForegroundColor Cyan
Set-Service XboxNetApiSvc -StartupType Disabled
Write-Host “”
Reconfigure / Change Services:
Write-Host “Configurar el servicio de lista de red para iniciar Automático…” -ForegroundColor Green
Write-Host “”
Set-Service netprofm -StartupType Automatic
Write-Host “”
Write-Host “Configurar el servicio de actualización de Windows para que se ejecute en svchost independiente…” -ForegroundColor Cyan
Write-Host “”
sc.exe config wuauserv type= own
Write-Host “”
Disable Scheduled Tasks:
Write-Host “Deshabilitar tareas programadas…” -ForegroundColor Cyan
Write-Host “”
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Autochk\Proxy” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Bluetooth\UninstallDeviceTask” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Diagnosis\Scheduled” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticResolver” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Maintenance\WinSAT” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Maps\MapsToastTask” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Maps\MapsUpdateTask” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\MemoryDiagnostic\RunFullMemoryDiagnostic” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Mobile Broadband Accounts\MNO Metadata Parser” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Ras\MobilityManager” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Registry\RegIdleBackup” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Shell\FamilySafetyMonitor” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Shell\FamilySafetyRefresh” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\SystemRestore\SR” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\UPnP\UPnPHostConfig” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\WDI\ResolutionHost” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\Windows Media Sharing\UpdateLibrary” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\WOF\WIM-Hash-Management” | Out-Null
Disable-ScheduledTask -TaskName “\Microsoft\Windows\WOF\WIM-Hash-Validation” | Out-Null
Disable Hard Disk Timeouts:
Write-Host “Deshabilitar los tiempos de espera del disco duro…” -ForegroundColor Yellow
Write-Host “”
POWERCFG /SETACVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 0012ee47-9041-4b5d-9b77-535fba8b1442 6738e2c4-e8a5-4a42-b16a-e040e769756e 0
POWERCFG /SETDCVALUEINDEX 381b4222-f694-41f0-9685-ff5bb260df2e 0012ee47-9041-4b5d-9b77-535fba8b1442 6738e2c4-e8a5-4a42-b16a-e040e769756e 0
Disable Hibernate
Write-Host “Disabling Hibernate…” -ForegroundColor Green
Write-Host “”
POWERCFG -h off
Disable Large Send Offload
Write-Host “Deshabilitar la descarga de envío de TCP grande…” -ForegroundColor Green
Write-Host “”
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -Name ‘DisableTaskOffload’ -PropertyType DWORD -Value ‘1’ | Out-Null
Disable System Restore
Write-Host “Deshabilitar la restauración del sistema…” -ForegroundColor Green
Write-Host “”
Disable-ComputerRestore -Drive “C:\”
Disable NTFS Last Access Timestamps
Write-Host “Deshabilitar las marcas de tiempo de último acceso NTFS…” -ForegroundColor Yellow
Write-Host “”
FSUTIL behavior set disablelastaccess 1 | Out-Null
If ($MachPass -eq “False”)
{
# Disable Machine Account Password Changes
Write-Host “Deshabilitar cambios en la contraseña de la cuenta de la máquina…” -ForegroundColor Yellow
Write-Host “”
Set-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters’ -Name ‘DisablePasswordChange’ -Value ‘1’
}
Disable Default system Screensaver
Write-Host “Deshabilitar el salvapantallas predeterminado del sistema…” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKEY_USERS.DEFAULT\ControlPanel\Desktop’ -Name ‘ScreenSaveActive’ -PropertyType DWORD -Value ‘0’
Disable the Windows 10 First Logon Animation
Write-Host “Deshabilitar la primera animación de inicio de sesión de Windows 10…” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System’ -Name ‘EnableFirstLogonAnimation’ -PropertyType DWORD -Value ‘0’
Hide Hard Error Messages
Write-Host “Oculta los mensajes de error duro” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKEY_LOCAL_MACHINE\SOFTWARE\System\CurrentControlSet\Control\Windows’ -Name ‘ErrorMode’ -PropertyType DWORD -Value ‘2’
Settings “Visual Effects to Custom”
Write-Host “Establecer efectos visuales en personalizado” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects’ -Name ‘VisualFXSetting’ -PropertyType DWORD -Value ‘3’
Settings “Disable Show translucent selection rectangle”
Write-Host “Deshabilitar Mostrar rectángulo de selección translúcida” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced’ -Name ‘ListviewAlphaSelect’ -PropertyType DWORD -Value ‘0’
Settings “Deshabilitar Mostrar sombras debajo de Windows”
Write-Host “Deshabilitar Mostrar sombras debajo de Windows” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced’ -Name ‘ListviewShadow’ -PropertyType DWORD -Value ‘0’
Settings “Disable Animate windows when minimizing and maximizing”
Write-Host “Inhabilite las ventanas cuando minimiza y maximiza” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKEY_CURRENT_USER \ControlPanel\Desktop\WindowMetrics’ -Name ‘MinAnimate’ -Value ‘0’
Settings “Disable Animations in the taskbar”
Write-Host “Deshabilitar animaciones en la barra de tareas” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced’ -Name ‘TaskbarAnimations’ -PropertyType DWORD -Value ‘0’
Settings “Disable Save Taskbar Thumbnail Previews”
Write-Host “Deshabilitar las vistas previas en miniatura de la barra de tareas de guardar” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM’ -Name ‘AlwaysHibernateThumbnails’ -PropertyType DWORD -Value ‘0’
Settings “Disable Enable Peek”
Write-Host “Deshabilitar Habilitar Peek” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM’ -Name ‘EnableAeroPeek’ -PropertyType DWORD -Value ‘0’
Settings “Disable Smooth edges of screen fonts”
Write-Host “Deshabilitar bordes suaves de fuentes de pantalla” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKEY_CURRENT_USER \Control Panel\Desktop’ -Name ‘FontSmoothing’ -Value ‘0’
Settings “Reduce menu show delay”
Write-Host “Reducir el retraso de la presentación del menú” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKEY_CURRENT_USER\ControlPanel\Desktop’ -Name ‘MenuShowDelay’ -Value ‘0’
Disable Memory Dumps
Write-Host “Deshabilitar la creación de volcado de memoria…” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl’ -Name ‘CrashDumpEnabled’ -Value ‘1’
Set-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl’ -Name ‘LogEvent’ -Value ‘0’
Set-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl’ -Name ‘SendAlert’ -Value ‘0’
Set-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl’ -Name ‘AutoReboot’ -Value ‘1’
Increase Service Startup Timeout:
Write-Host “Aumentando el tiempo de espera de inicio de servicio a 180 segundos…” -ForegroundColor Yellow
Write-Host “”
Set-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Control’ -Name ‘ServicesPipeTimeout’ -Value ‘180000’
Increase Disk I/O Timeout to 200 Seconds:
Write-Host “Aumentando el tiempo de espera de E / S de disco a 200 segundos…” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Services\Disk’ -Name ‘TimeOutValue’ -Value ‘200’
Disable IE First Run Wizard:
Write-Host “Deshabilitar IE First Run Wizard…” -ForegroundColor Green
Write-Host “”
New-Item -Path ‘HKLM:\SOFTWARE\Policies\Microsoft’ -Name ‘Internet Explorer’ | Out-Null
New-Item -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer’ -Name ‘Main’ | Out-Null
New-ItemProperty -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Internet Explorer\Main’ -Name DisableFirstRunCustomize -PropertyType DWORD -Value ‘1’ | Out-Null
Disable New Network Dialog:
Write-Host “Deshabilitar el nuevo cuadro de diálogo de red…” -ForegroundColor Green
Write-Host “”
New-Item -Path ‘HKLM:\SYSTEM\CurrentControlSet\Control\Network’ -Name ‘NewNetworkWindowOff’ | Out-Null
If ($SMB1 -eq “False”)
{
# Disable SMB1:
Write-Host “Desactivando el soporte SMB1…” -ForegroundColor Yellow
dism /online /Disable-Feature /FeatureName:SMB1Protocol /NoRestart
Write-Host “”
Write-Host “”
}
If ($SMBPerf -eq “True”)
{
# SMB Modifications for performance:
Write-Host “Cambiar los parámetros de SMB…”
Write-Host “”
New-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters’ -Name ‘DisableBandwidthThrottling’ -PropertyType DWORD -Value ‘1’ | Out-Null
New-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters’ -Name ‘DisableLargeMtu’ -PropertyType DWORD -Value ‘0’ | Out-Null
New-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters’ -Name ‘FileInfoCacheEntriesMax’ -PropertyType DWORD -Value ‘8000’ | Out-Null
New-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters’ -Name ‘DirectoryCacheEntriesMax’ -PropertyType DWORD -Value ‘1000’ | Out-Null
New-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters’ -Name ‘FileNotFoundcacheEntriesMax’ -PropertyType DWORD -Value ‘1’ | Out-Null
New-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters’ -Name ‘MaxCmds’ -PropertyType DWORD -Value ‘8000’ | Out-Null
New-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters’ -Name ‘EnableWsd’ -PropertyType DWORD -Value ‘0’ | Out-Null
}
Remove Previous Versions:
Write-Host “Eliminar la capacidad de versiones anteriores…” -ForegroundColor Yellow
Write-Host “”
Set-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer’ -Name ‘NoPreviousVersionsPage’ -Value ‘1’
Change Explorer Default View:
Write-Host “Configurando el Explorador de Windows…” -ForegroundColor Green
Write-Host “”
New-ItemProperty -Path ‘HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced’ -Name ‘LaunchTo’ -PropertyType DWORD -Value ‘1’ | Out-Null
Configure Search Options:
Write-Host “Configurar opciones de búsqueda…” -ForegroundColor Green
Write-Host “”
New-ItemProperty -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search’ -Name ‘AllowSearchToUseLocation’ -PropertyType DWORD -Value ‘0’ | Out-Null
New-ItemProperty -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search’ -Name ‘ConnectedSearchUseWeb’ -PropertyType DWORD -Value ‘0’ | Out-Null
New-ItemProperty -Path ‘HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search’ -Name ‘SearchboxTaskbarMode’ -PropertyType DWORD -Value ‘1’ | Out-Null
Use Solid Background Color:
Write-Host “Configurando Winlogon…” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKLM:\SOFTWARE\Policies\Microsoft\Windows\System’ -Name ‘DisableLogonBackgroundImage’ -Value ‘1’
DisableTransparency:
Write-Host “Eliminar efectos de transparencia…” -ForegroundColor Green
Write-Host “”
Set-ItemProperty -Path ‘HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize’ -Name ‘EnableTransparency’ -Value ‘0’
Configure WMI:
Write-Host “Modificar la configuración de WMI…” -ForegroundColor Green
Write-Host “”
$oWMI=get-wmiobject -Namespace root -Class __ProviderHostQuotaConfiguration
$oWMI.MemoryPerHost=76810241024
$oWMI.MemoryAllHosts=153610241024
$oWMI.put()
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Winmgmt -Name ‘Group’ -Value ‘COM Infrastructure’
winmgmt /standalonehost
Write-Host “”
NLA (Network Level Authentication)
$NLA = Get-WmiObject -Class Win32_TSGeneralSetting -Namespace root\CIMV2\TerminalServices -Authentication PacketPrivacy
$NLA.SetUserAuthenticationRequired($NLAEnable) | Out-Null
$NLA = Get-WmiObject -Class Win32_TSGeneralSetting -Namespace root\CIMV2\TerminalServices -Authentication PacketPrivacy
if ($NLA.UserAuthenticationRequired -eq $NLAEnable){
Write-Host “El ajuste de NLA cambió con éxito” -ForegroundColor Cyan
} else {
Write-Host “Error al cambiar la configuración de NLA” -ForegroundColor Red
exit
}
Write-Host “”
Write-Host “”
Write-Host “”
Write-Host “”
Did this break?:
If ($NoWarn -eq $False)
{
Write-Host “El PowerShellScript se ha completado.” -ForegroundColor Green
Write-Host “”
Write-Host “Revise el resultado en su consola para ver si hay indicios de fallas y resuelva según sea necesario.” -ForegroundColor Yellow
Write-Host “”
Write-Host “Recuerde, este script se proporciona TAL CUAL: revise los cambios que ha realizado en esta máquina virtual para su validación en su entorno.(Estuputo problema si no funciona)” -ForegroundColor Magenta
Write-Host “”
Write-Host “Ahora, debes reiniciar” -ForegroundColor White
Write-Host “Recuerde visitar www.mordor.rocks para la última versión (se requiere reiniciar)” -ForegroundColor White
}


Artículos relacionados

Deja un comentario

A %d blogueros les gusta esto: