From 60e12d3df840b1a3c032a4a0854927a9e56623df Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov <10544660+farag2@users.noreply.github.com> Date: Mon, 29 Jun 2020 16:49:06 +0300 Subject: [PATCH] v4.5.4 29.06.2020 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Windows 10 2004 | 1903/1909 Version ## Updated - Updated "Turn off Cortana autostarting" section - Updated "Create "Process Creation" Event Viewer Custom View" section - Closed #37 - Removed "Uninstall all Xbox related UWP apps from all accounts" section because it's unnecassary - Removed "Show accent color on Start, taskbar, and action center" section - Closed #36 - Comments; - Minor changes ## Версия для Windows 10 2004 | 1903/1909 ## Обновлено - Обновлен раздел "Удалить Кортана из автозагрузки" - Обновлен раздел "Создать настаиваемое представление "Создание процесса" в Просмотре событий" - Закрыто #37 - Удален раздел "Удалить все UWP-приложения, связанные с Xbox, из всех учетных записей", так как он не - Удален раздел "Отображать цвет элементов в меню "Пуск", на панели задач и в центре уведомлений" - Закрыто #36 - Незначительные изменения --- Win 10 1903-1909.ps1 | 42 +++++++++++------------- Win 10 2004.ps1 | 76 +++++++++++++------------------------------- 2 files changed, 40 insertions(+), 78 deletions(-) diff --git a/Win 10 1903-1909.ps1 b/Win 10 1903-1909.ps1 index be394a0e..0864c040 100644 --- a/Win 10 1903-1909.ps1 +++ b/Win 10 1903-1909.ps1 @@ -2,8 +2,8 @@ .SYNOPSIS "Windows 10 Setup Script" is a set of tweaks for OS fine-tuning and automating the routine tasks - Version: v4.4.4 - Date: 23.06.2020 + Version: v4.4.5 + Date: 29.06.2020 Copyright (c) 2020 farag & oZ-Zo Thanks to all http://forum.ru-board.com members involved @@ -15,10 +15,10 @@ Tested on Home/Pro/Enterprise editions Due to the fact that the script includes about 150 functions, - you must read the entire script and comment out those sections that you do not want to be execute, + you must read the entire script and comment out those sections that you do not want to be executed, otherwise likely you will enable features that you do not want to be enabled - Running the script is best done on a fresh install because running the script on tweaked system may result in occurring errors + Running the script is best done on a fresh install because running it on tweaked system may result in errors occurring Check whether the .ps1 file is encoded in UTF-8 with BOM The script can not be executed via PowerShell ISE @@ -616,13 +616,6 @@ switch ($Result) } } -# Show accent color on Start, taskbar, and action center -# Отображать цвет элементов в меню "Пуск", на панели задач и в центре уведомлений -if ((Get-ItemPropertyValue -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme) -ne 1) -{ - New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name ColorPrevalence -PropertyType DWord -Value 1 -Force -} - # Show accent color on the title bars and window borders # Отображать цвет элементов в заголовках окон и границ окон New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\DWM -Name ColorPrevalence -PropertyType DWord -Value 1 -Force @@ -3051,6 +3044,7 @@ New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Security Health\State" # Turn on events auditing generated when a process is created or starts # Включить аудит событий, возникающих при создании или запуске процесса auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable +$ProcessCreation = $true # Include command line in process creation events # Включать командную строку в событиях создания процесса @@ -3058,27 +3052,23 @@ if ($RU) { $OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 } -$ProcessCreation = auditpol /get /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /r | ConvertFrom-Csv | Select-Object -ExpandProperty "Inclusion Setting" -if ($ProcessCreation -ne "No Auditing") + +if ($ProcessCreation) { New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -PropertyType DWord -Value 1 -Force + $ProcessCreationIncludeCmdLine_Enabled = $true } # Create "Process Creation" Event Viewer Custom View -# Создать настаиваемое представление "Создание процесса" в Настраиваемых представлениях +# Создать настаиваемое представление "Создание процесса" в Просмотре событий if ($RU) { $OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 } -$ProcessCreation = auditpol /get /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /r | ConvertFrom-Csv | Select-Object -ExpandProperty "Inclusion Setting" -if (Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -ErrorAction Ignore) -{ - $ProcessCreationIncludeCmdLine_Enabled = $true -} -if (($ProcessCreation -ne "No Auditing") -and ($ProcessCreationIncludeCmdLine_Enabled -eq $true)) +if ($ProcessCreation -and $ProcessCreationIncludeCmdLine_Enabled) { - $XMLfile = @" + $XML = @" @@ -3096,14 +3086,18 @@ if (($ProcessCreation -ne "No Auditing") -and ($ProcessCreationIncludeCmdLine_En "@ - $ProcessCreationPath = "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" + if (-not (Test-Path -Path "$env:ProgramData\Microsoft\Event Viewer\Views")) + { + New-Item -Path "$env:ProgramData\Microsoft\Event Viewer\Views" -ItemType Directory -Force + } + $ProcessCreationFilePath = "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" # Saving ProcessCreation.xml in UTF-8 encoding # Сохраняем ProcessCreation.xml в кодировке UTF-8 - Set-Content -Value (New-Object System.Text.UTF8Encoding).GetBytes($XMLfile) -Encoding Byte -Path $ProcessCreationPath -Force + Set-Content -Value (New-Object System.Text.UTF8Encoding).GetBytes($XML) -Encoding Byte -Path $ProcessCreationFilePath -Force if ($RU) { - [xml]$XML = Get-Content -Path $ProcessCreationPath + [xml]$XML = Get-Content -Path $ProcessCreationFilePath $XML.ViewerConfig.QueryConfig.QueryNode.Name = "Создание процесса" $XML.ViewerConfig.QueryConfig.QueryNode.Description = "События содания нового процесса и аудит командной строки" $xml.Save("$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml") diff --git a/Win 10 2004.ps1 b/Win 10 2004.ps1 index 18d7f0a6..1aae39d4 100644 --- a/Win 10 2004.ps1 +++ b/Win 10 2004.ps1 @@ -2,8 +2,8 @@ .SYNOPSIS "Windows 10 Setup Script" is a set of tweaks for OS fine-tuning and automating the routine tasks - Version: v4.5.3 - Date: 23.06.2020 + Version: v4.5.4 + Date: 29.06.2020 Copyright (c) 2020 farag & oZ-Zo Thanks to all http://forum.ru-board.com members involved @@ -15,9 +15,10 @@ Tested on Home/Pro/Enterprise editions Due to the fact that the script includes about 150 functions, - you should read the entire script and comment out those sections that you do not want to be execute + you must read the entire script and comment out those sections that you do not want to be executed, + otherwise likely you will enable features that you do not want to be enabled - Running the script is best done on a fresh install because running the script on tweaked system may result in occurring errors + Running the script is best done on a fresh install because running it on tweaked system may result in errors occurring Check whether the .ps1 file is encoded in UTF-8 with BOM The script can not be executed via PowerShell ISE @@ -615,13 +616,6 @@ switch ($Result) } } -# Show accent color on Start, taskbar, and action center -# Отображать цвет элементов в меню "Пуск", на панели задач и в центре уведомлений -if ((Get-ItemPropertyValue -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name SystemUsesLightTheme) -ne 1) -{ - New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name ColorPrevalence -PropertyType DWord -Value 1 -Force -} - # Show accent color on the title bars and window borders # Отображать цвет элементов в заголовках окон и границ окон New-ItemProperty -Path HKCU:\Software\Microsoft\Windows\DWM -Name ColorPrevalence -PropertyType DWord -Value 1 -Force @@ -2431,7 +2425,7 @@ if (Get-AppxPackage -Name Microsoft.ZuneVideo) # Turn off Cortana autostarting # Удалить Кортана из автозагрузки -if (Get-AppxPackage -AllUsers -Name Microsoft.549981C3F5F10) +if (Get-AppxPackage -Name Microsoft.549981C3F5F10) { if (-not (Test-Path -Path "Registry::HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\Microsoft.549981C3F5F10_8wekyb3d8bbwe\CortanaStartupId")) { @@ -2455,33 +2449,6 @@ New-ItemProperty -Path HKCU:\System\GameConfigStore -Name GameDVR_Enabled -Prope # Отключить советы Xbox Game Bar New-ItemProperty -Path HKCU:\Software\Microsoft\GameBar -Name ShowStartupPanel -PropertyType DWord -Value 0 -Force -<# -Uninstall all Xbox related UWP apps from all accounts -App packages will not be installed when new user accounts are created - -Удалить все UWP-приложения, связанные с Xbox, из всех учетных записей -Приложения не будут установлены при создании новых учетных записей -#> -$XboxAppxPackages = @( - # Xbox Identity Provider - # Поставщик удостоверений Xbox - "Microsoft.XboxIdentityProvider" - # Xbox - # Компаньон консоли Xbox - "Microsoft.XboxApp" - # Xbox TCUI - "Microsoft.Xbox.TCUI" - # Xbox Speech To Text Overlay - "Microsoft.XboxSpeechToTextOverlay" - # Xbox Game Bar - "Microsoft.XboxGamingOverlay" - # Xbox Game Bar Plugin - "Microsoft.XboxGameOverlay" -) -$OFS = "|" -Get-AppxPackage -PackageTypeFilter Bundle -AllUsers | Where-Object -FilterScript {$_.Name -cmatch $XboxAppxPackages} | Remove-AppxPackage -AllUsers -Verbose -$OFS = " " - # Set "High performance" in graphics performance preference for apps # Установить параметры производительности графики для отдельных приложений на "Высокая производительность" if (Get-CimInstance -ClassName Win32_VideoController | Where-Object -FilterScript {$_.AdapterDACType -ne "Internal" -and $null -ne $_.AdapterDACType}) @@ -3051,8 +3018,8 @@ switch ($Result) # Включить защиту сети в Microsoft Defender Exploit Guard Set-MpPreference -EnableNetworkProtection Enabled -# Turn on detection for potentially unwanted applications -# Включить обнаружение потенциально нежелательных приложений +# Turn on detection for potentially unwanted applications and block them +# Включить обнаружение потенциально нежелательных приложений и блокировать их Set-MpPreference -PUAProtection Enabled # Run Microsoft Defender within a sandbox @@ -3070,6 +3037,7 @@ New-ItemProperty -Path "HKCU:\Software\Microsoft\Windows Security Health\State" # Turn on events auditing generated when a process is created or starts # Включить аудит событий, возникающих при создании или запуске процесса auditpol /set /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /success:enable /failure:enable +$ProcessCreation = $true # Include command line in process creation events # Включать командную строку в событиях создания процесса @@ -3077,27 +3045,23 @@ if ($RU) { $OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 } -$ProcessCreation = auditpol /get /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /r | ConvertFrom-Csv | Select-Object -ExpandProperty "Inclusion Setting" -if ($ProcessCreation -ne "No Auditing") + +if ($ProcessCreation) { New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -PropertyType DWord -Value 1 -Force + $ProcessCreationIncludeCmdLine_Enabled = $true } # Create "Process Creation" Event Viewer Custom View -# Создать настаиваемое представление "Создание процесса" в Настраиваемых представлениях +# Создать настаиваемое представление "Создание процесса" в Просмотре событий if ($RU) { $OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 } -$ProcessCreation = auditpol /get /subcategory:"{0CCE922B-69AE-11D9-BED3-505054503030}" /r | ConvertFrom-Csv | Select-Object -ExpandProperty "Inclusion Setting" -if (Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -Name ProcessCreationIncludeCmdLine_Enabled -ErrorAction Ignore) -{ - $ProcessCreationIncludeCmdLine_Enabled = $true -} -if (($ProcessCreation -ne "No Auditing") -and ($ProcessCreationIncludeCmdLine_Enabled -eq $true)) +if ($ProcessCreation -and $ProcessCreationIncludeCmdLine_Enabled) { - $XMLfile = @" + $XML = @" @@ -3115,14 +3079,18 @@ if (($ProcessCreation -ne "No Auditing") -and ($ProcessCreationIncludeCmdLine_En "@ - $ProcessCreationPath = "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" + if (-not (Test-Path -Path "$env:ProgramData\Microsoft\Event Viewer\Views")) + { + New-Item -Path "$env:ProgramData\Microsoft\Event Viewer\Views" -ItemType Directory -Force + } + $ProcessCreationFilePath = "$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml" # Saving ProcessCreation.xml in UTF-8 encoding # Сохраняем ProcessCreation.xml в кодировке UTF-8 - Set-Content -Value (New-Object System.Text.UTF8Encoding).GetBytes($XMLfile) -Encoding Byte -Path $ProcessCreationPath -Force + Set-Content -Value (New-Object System.Text.UTF8Encoding).GetBytes($XML) -Encoding Byte -Path $ProcessCreationFilePath -Force if ($RU) { - [xml]$XML = Get-Content -Path $ProcessCreationPath + [xml]$XML = Get-Content -Path $ProcessCreationFilePath $XML.ViewerConfig.QueryConfig.QueryNode.Name = "Создание процесса" $XML.ViewerConfig.QueryConfig.QueryNode.Description = "События содания нового процесса и аудит командной строки" $xml.Save("$env:ProgramData\Microsoft\Event Viewer\Views\ProcessCreation.xml")