Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #//Admin-Loader
  2. If  (-NOT([Security.Principal.WindowsPrincipal]`
  3.           [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
  4.           [Security.Principal.WindowsBuiltInRole] “Administrator”))
  5. {
  6.     $Arguments = "& '" + $script:MyInvocation.MyCommand.Path + "'"
  7.     Start-Process powershell -argumentlist $arguments -Verb runAs
  8.     Break
  9. }
  10.  
  11. #//Script-Start
  12.     #//Advanced Firewall profile
  13.     netsh advfirewall import $env:userprofile\desktop\default.wfw | out-null
  14.    
  15.     #//Poweroptions
  16.     powercfg -h off
  17.    
  18.     #//Setting registry keys
  19.         #// Initialize an array
  20.         $RegistryEntries = @()
  21.  
  22.             #// Create a PSObject with the associated properties hashtable
  23.                 #//Disabling Xbox Capture
  24.                 $RegTable = new-object PSObject -Property @{ Key          = 'Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR';
  25.                                                              Name         = 'AppCaptureEnabled';
  26.                                                              PropertyType = 'Dword';
  27.                                                              Value        = '00000000'}
  28.                 $RegistryEntries += $regtable
  29.  
  30.                 #//Disabling Xbox GameDVR overlay
  31.                 $RegTable = new-object PSObject -Property @{ Key          = 'Registry::HKEY_CURRENT_USER\SYSTEM\GameConfigStore';
  32.                                                              Name         = 'GameDVR_Enabled';
  33.                                                              PropertyType = 'Dword';
  34.                                                              Value        = '00000000'}
  35.                 $RegistryEntries += $regtable
  36.  
  37.                 #//Disabling Cortana
  38.                 $RegTable = new-object PSObject -Property @{ Key          = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search';
  39.                                                              Name         = 'AllowCortana';
  40.                                                              PropertyType = 'Dword';
  41.                                                              Value        = '00000000'}
  42.                 $RegistryEntries += $regtable
  43.  
  44.                 #//Disabling Cortana Lock Screen
  45.                 $RegTable = new-object PSObject -Property @{ Key          = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search';
  46.                                                              Name         = 'AllowCortanaAboveLock';
  47.                                                              PropertyType = 'Dword';
  48.                                                              Value        = '00000000'}
  49.                 $RegistryEntries += $regtable
  50.  
  51.                 #//Disabling UAC
  52.                 $RegTable = new-object PSObject -Property @{ Key          = 'REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System';
  53.                                                              Name         = 'EnableLUA';
  54.                                                              PropertyType = 'Dword';
  55.                                                              Value        = '00000000'}
  56.                 $RegistryEntries += $regtable
  57.  
  58.                 #//Disabling Start Menu suggested content
  59.                 $RegTable = new-object PSObject -Property @{ Key          = 'REGISTRY::HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\CloudContent';
  60.                                                              Name         = 'DisableWindowsConsumerFeatures';
  61.                                                              PropertyType = 'Dword';
  62.                                                              Value        = '00000001'}
  63.                 $RegistryEntries += $regtable
  64.  
  65.         #//Invoking registry changes
  66.         ForEach ($line in $RegistryEntries)
  67.         {
  68.             IF ((Test-Path -Path $line.key)-ne "True")
  69.             {
  70.             New-Item -Path $line.key | out-Null
  71.             }
  72.             New-ItemProperty -Force -Path $line.key -Name $line.name -Value $line.value -PropertyType $line.propertytype
  73.         }
  74.  
  75.         #//Nulling Variables
  76.         $line = $null
  77.         $RegistryEntries = $null
  78.         $RegTable = $null
  79.  
  80.  
  81.     #//Configuring Services
  82.     $StopServiceArray = @('HomeGroupListener';
  83.                           'HomeGroupProvider')
  84.                      
  85.      ForEach ($line in $StopServiceArray)
  86.         {
  87.             Stop-Service -Name $line
  88.             Set-Service -Name $line -Status Stopped -StartupType Disabled
  89.         }
  90.  
  91.         #//Nulling Variables
  92.         $line = $null
  93.         $StopServiceArray = $null
  94.  
  95.     #//uninstalling store apps
  96.     Get-AppxPackage *3dbuilder* | Remove-AppxPackage
  97.     Get-AppxPackage *windowsalarms* | Remove-AppxPackage
  98.     Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
  99.     Get-AppxPackage *windowscamera* | Remove-AppxPackage
  100.     Get-AppxPackage *officehub* | Remove-AppxPackage
  101.     Get-AppxPackage *skypeapp* | Remove-AppxPackage
  102.     Get-AppxPackage *getstarted* | Remove-AppxPackage
  103.     Get-AppxPackage *zunemusic* | Remove-AppxPackage
  104.     Get-AppxPackage *windowsmaps* | Remove-AppxPackage
  105.     Get-AppxPackage *solitairecollection* | Remove-AppxPackage
  106.     Get-AppxPackage *bingfinance* | Remove-AppxPackage
  107.     Get-AppxPackage *zunevideo* | Remove-AppxPackage
  108.     Get-AppxPackage *bingnews* | Remove-AppxPackage
  109.     Get-AppxPackage *onenote* | Remove-AppxPackage
  110.     Get-AppxPackage *people* | Remove-AppxPackage
  111.     Get-AppxPackage *windowsphone* | Remove-AppxPackage
  112.     Get-AppxPackage *bingsports* | Remove-AppxPackage
  113.     Get-AppxPackage *soundrecorder* | Remove-AppxPackage
  114.     Get-AppxPackage *bingweather* | Remove-AppxPackage
  115.     Get-AppxPackage *xboxapp* | Remove-AppxPackage
  116.     Get-AppxPackage *phone* | Remove-AppxPackage
  117.     Get-AppxPackage *messaging* | Remove-AppxPackage
  118.     Get-AppxPackage *oneconnect* | Remove-AppxPackage
  119.     Get-AppxPackage *Minecraft* | Remove-AppxPackage
  120.     Get-AppxPackage *HPPrinterControl* | Remove-AppxPackage
  121.     Get-AppxPackage *CandyCrush* | Remove-AppxPackage
  122.     Get-AppxPackage *Playtika.CaesarsSlotsFreeCasino* | Remove-AppxPackage
  123.     Get-AppxPackage *advertising* | Remove-AppxPackage
  124.     Get-AppxPackage *DesktopAppInstaller* | Remove-AppxPackage
  125.     Get-AppxPackage *XboxIdentityProvider* | Remove-AppxPackage
  126.     Get-AppxPackage *WindowsFeedbackHub* | Remove-AppxPackage
  127.     Get-AppxPackage *Facebook* | Remove-AppxPackage
  128.     Get-AppxPackage *twitter* | Remove-AppxPackage
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement