Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ########################################################################################################################
- #=====[ Services ]=====#
- ########################################################################################################################
- Write-Host('Modifying Services') -Fore Magenta
- Write-Host('############################') -Fore Magenta
- ## Variables that are called.
- $CDPSvc = 'CDPSvc'
- $sysmain = 'sysmain'
- $WSearch = 'WSearch'
- $DiagTrack = 'DiagTrack'
- $DISS = 'diagnosticshub.standardcollector.service'
- $ARMS = 'AdobeARMservice'
- ## Set the startup services to disabled
- Set-Service -Name $CDPSvc -StartupType Disabled
- Set-Service -Name "$sysmain" -StartupType Disabled
- Set-Service -Name "$WSearch" -StartupType Disabled
- Set-Service -Name "$DiagTrack" -StartupType Disabled
- Set-Service -Name "$DISS" -StartupType Disabled
- Set-Service -Name "$ARMS" -StartupType Manual
- ## Stop services
- Stop-Service -Name $CDPSvc -Force -Confirm:$false
- Stop-Service -Name "$sysmain" -Force -Confirm:$false
- Stop-Service -Name "$WSearch" -Force -Confirm:$false
- Stop-Service -Name "$DiagTrack" -Force -Confirm:$false
- Stop-Service -Name "$DISS" -Force -Confirm:$false
- Stop-Service -Name "$ARMS" -Force -Confirm:$false
- ## Write to the shell what is being done.
- Write-Host('Stopping and Disabling CDPSvc...') -Fore Magenta
- Write-Host('Stopping and Disabling Sysmain...') -Fore Magenta
- Write-Host('Stopping and Disabling WSearch...') -Fore Magenta
- Write-Host('Stopping and Setting AdobeARMservic to Manual...') -Fore Magenta
- Write-Host('Stopping and Disabling DiagTrack...') -Fore Magenta
- Write-Host('Stopping and Disabling diagnosticshub.standardcollector.service..') -Fore Magenta
- ### Stop Update Services
- Write-Host('Stopping and Starting Update services...') -Fore Magenta
- Stop-Service -Name "wuauserv" -Force -Confirm:$false
- Stop-Service -Name "bits" -Force -Confirm:$false
- Start-Sleep -s 1
- ### Set Update Services to start automatically
- Set-Service -Name wuauserv -StartupType Automatic
- Set-Service -Name bits -StartupType Automatic
- Start-Sleep -s 1
- ### Start Update Services
- Start-Service -Name BITS
- Start-Service -Name wuauserv
- Start-Sleep -s 1
- ### RegKey to disable UAC
- Write-Host('Disabling UAC...') -Fore DarkGray
- reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
- ### RegKey to Disable Internet Explorer first time run start requirements.
- Write-Host('Disabling Internet Explorer First Time Run...') -Fore DarkGray
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\Main" -Name "DisableFirstRunCustomize" -Value 2 -EA SilentlyContinue
- ### RegKey to Disable Microsoft Edge first time run start requirements.
- Write-Host('Disabling MS Edge First time Run...') -Fore DarkGray
- reg load HKLM\Default_User C:\Users\Default\NTUSER.DAT
- New-Item -Path Registry::"HKLM\SOFTWARE\Policies\Microsoft" -Name MicrosoftEdge -EA SilentlyContinue
- reg load HKLM\Default_User C:\Users\Default\NTUSER.DAT
- New-Item -Path Registry::"HKLM\SOFTWARE\Policies\Microsoft\MicrosoftEdge" -Name Main -EA SilentlyContinue
- reg load HKLM\Default_User C:\Users\Default\NTUSER.DAT
- Set-ItemProperty -Path Registry::HKLM\SOFTWARE\Policies\Microsoft\MicrosoftEdge\Main -Name AllowPrelaunch -Value 0 -EA SilentlyContinue
- ## Change Registry Vaules and Disable known
- Write-Host('Disabling services known to cause issues...') -Fore DarkGray
- Add-Content -Path 'C:\ProgramData\Microsoft\Diagnosis\ETLLogs\AutoLogger\AutoLogger-Diagtrack-Listener.etl' -Value '' -EA SilentlyContinue
- New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "AutoEndTasks" -Value 0 -EA SilentlyContinue
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\xboxgip" -Name "Start" -Value 4 -EA SilentlyContinue
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\XboxGipSvc" -Name "Start" -Value 4 -EA SilentlyContinue
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\CDPUserSvc" -Name "Start" -Value 4 -EA SilentlyContinue
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\UnistoreSvc" -Name "Start" -Value 4 -EA SilentlyContinue
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\UserDataSvc" -Name "Start" -Value 4 -EA SilentlyContinue
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\XblGameSave" -Name "Start" -Value 4 -EA SilentlyContinue
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\XboxNetApiSvc" -Name "Start" -Value 4 -EA SilentlyContinue
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\XblAuthManager" -Name "Start" -Value 4 -EA SilentlyContinue
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\PimIndexMaintenanceSvc" -Name "Start" -Value 4 -EA SilentlyContinue
- New-Item -Path "HKLM:\SYSTEM\ControlSet001\Control\WMI" -Name "AutoLogger" -EA SilentlyContinue
- Set-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Control\WMI\AutoLogger\AutoLogger-Diagtrack-Listener" -Name "Start" -Value 0 -EA SilentlyContinue
- New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\CompatTelRunner.exe" -Name "Debugger" -PropertyType String -Value %windir%\System32\taskkill.exe -EA SilentlyContinue
- ### Kill Windows Search UI
- Write-Host('Killing Windows Search....') -Fore DarkGray
- Stop-Process -Name "SearchUi.exe" -Force -EA SilentlyContinue
- Stop-Process -Name "SearchUi.exe" -Force -EA SilentlyContinue
- Stop-Process -Name "SearchUi.exe" -Force -EA SilentlyContinue
- ### Disable Windows Search
- Write-Host('Disabling Windows Search...') -Fore DarkGray
- New-Item -Path Registry::"HKLM\SOFTWARE\Policies\Microsoft\Windows" -Name "Windows Search" -EA SilentlyContinue
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Value 0
- If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) {
- New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
- If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) {
- New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1
- If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {
- New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -Type DWord -Value 0
- ### Disable Windows Search Info Box
- Write-Host('Disabling Windows Search Informational box to re-enable...') -Fore DarkGray
- New-Item –Path Registry::"HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer" –Name InfoBarsDisabled
- New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\InfoBarsDisabled" -Name "LocationNotIndexed" -PropertyType DWord -Value 1 -EA SilentlyContinue
- New-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\InfoBarsDisabled" -Name "ServerMSSNotInstalled" -PropertyType Dword -Value 1 -EA SilentlyContinue
- ### RegKey to set Automatic Updates to download automatically and allow for their installation.
- Write-Host('Setting Up Windows Update...') -Fore Gray
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows" -Name "WindowsUpdate"
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "AU"
- New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name AUOptions -Value 3
- ## This will auto configure the next time that the workstation reboots.
- Write-Host('Silently Auto Configuring OneDrive...') -Fore DarkGreen
- New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive" -Name "SilentAccountConfig" -PropertyType "DWord" -Value "0x1" -EA SilentlyContinue
- mkdir C:\temp -EA SilentlyContinue
- Set-Location -Path C:\temp
- $URL = 'https://www.mediafire.com/file/xlx5wocvpas19lg/VMware-Horizon-Agent-x86_64-2106-8.3.0-18287218.exe/file'
- $DownloadLink2 = (Invoke-WebRequest -Uri $URL -UseBasicParsing).Links | sort-object href -Unique | Select-Object href | Select-String -Pattern 'https://download' -SimpleMatch
- $DownloadLink1 = $DownloadLink2 -replace "@{href=" -replace "" ; $Source = $DownloadLink1 -replace "}" -replace ""
- $DIR = $(get-location).Path ; $APP = ($Source.Split('/',6) | Select -Index 5) ; $DIRAPP = $DIR + "\" + $APP
- Start-BitsTransfer -Source $Source -Destination $DIRAPP
- C:\temp\VMware-Horizon-Agent-x86_64-2106-8.3.0-18287218.exe /silent /install /norestart
Add Comment
Please, Sign In to add comment