Sycnex / Windows10Debloater

Script to remove Windows 10 bloatware.
MIT License
17.93k stars 2.03k forks source link

Settings for Current_User or Default_User #21

Closed rom-1 closed 6 years ago

rom-1 commented 6 years ago

Hi,

I am trying to understand why some privacy settings are only set for the current user, and some settings are applied to the Default_User. Regarding the sysprep PS1 Script, I would think that most settings should apply to the DEFAULT_USER instead of the current_user, right?

After Line 159, for testing purposes we added the following code:

  #Stops the Windows Feedback Experience from sending anonymous data
    Write-Output "Stopping the Windows Feedback Experience program"
    $Period1 = 'Registry::HKU\Default_User\SOFTWARE\Microsoft\Siuf'
    $Period2 = 'Registry::HKU\Default_User\SOFTWARE\Microsoft\Siuf\Rules'
    $Period3 = 'Registry::HKU\Default_User\SOFTWARE\Microsoft\Siuf\Rules\PeriodInNanoSeconds'
    If (!(Test-Path $Period3)) { 
        mkdir $Period1 -ErrorAction SilentlyContinue
        mkdir $Period2 -ErrorAction SilentlyContinue
        mkdir $Period3 -ErrorAction SilentlyContinue
        New-ItemProperty $Period3 -Name PeriodInNanoSeconds -Value 0 -Verbose -ErrorAction SilentlyContinue
    }

    Write-Output "Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings"
    $Holo = 'Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\Holographic'    
    If (Test-Path $Holo) {
        Set-ItemProperty $Holo -Name FirstRunSucceeded -Value 0 -Verbose
    }

    #Disables live tiles
    Write-Output "Disabling live tiles"
    $Live = 'Registry::HKU\Default_User\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications'    
    If (!(Test-Path $Live)) {
        mkdir $Live -ErrorAction SilentlyContinue     
        New-ItemProperty $Live -Name NoTileApplicationNotification -Value 1 -Verbose
    }

    #Disables People icon on Taskbar
    Write-Output "Disabling People icon on Taskbar"
    $People = 'Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People'    
    If (!(Test-Path $People)) {
        mkdir $People -ErrorAction SilentlyContinue
        New-ItemProperty $People -Name PeopleBand -Value 0 -Verbose
    }

    #Disables suggestions on start menu
    Write-Output "Disabling suggestions on the Start Menu"
    $Suggestions = 'Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'    
    If (Test-Path $Suggestions) {
        Set-ItemProperty $Suggestions -Name SystemPaneSuggestionsEnabled -Value 0 -Verbose
    }

So far, this works for us just fine. Can you please explain why these settings are only applied to the Current User by your script? I guess there is a reason behind this?

Sycnex commented 6 years ago

I primarily did it for people who wanted it to apply to just their own account, and not all of the user profiles. However, I can make it so it applies to all of the user profiles.

rom-1 commented 6 years ago

Ah ok, I did not know that. My impression was that the Syprep Script is primarily targeted to MDT/Sysprep Deployment, not to peoples own account. Sorry.

Sycnex commented 6 years ago

Oh whoops, you're correct. I thought you were speaking of the SysPrep script.

What suggestions do you have that I can do? Run everything under Default User?

On Fri, May 4, 2018, 12:44 AM rom-1 notifications@github.com wrote:

Ah ok, I did not know that. My impression was that the Syprep Script is primarily targeted to MDT/Sysprep Deployment, not to peoples own account. Sorry.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Sycnex/Windows10Debloater/issues/21#issuecomment-386527616, or mute the thread https://github.com/notifications/unsubscribe-auth/AHCc4L1-Eg81jgwFMiCseGwAjPTN3D4_ks5tvAbSgaJpZM4TvjC_ .

rom-1 commented 6 years ago

Just to be perfectly clear: When referring to the sysprep script I am talking about the file Windows10SysPrepDebloater.ps1.

To be honest I am currently in a very early learning phase about MDT & Windows 10 Deployment, so I am in no situation to give you a professional advice or suggestion. At the moment I am setting up my first MDT Deployment which involves using your script. It just seemed odd to me to set all the privacy settings to the current user only instead of default user. I simply wanted to learn your reason behind this.

Going forward: For our current environment I now have set up your sysprep script accordingly to your manual, and added a separate script called "Debloat-Default-User.ps1" which is called right after your script in the MDT Deployment Process. I have no idea if this is going to break something in the long run, or if this is a good idea, as I am fairly new to the process. So a MDT/Powershell expert should definitely look over this. Please note that I disabled the "reg unload" line as it stops the MDT capturing process by throwing a fatal error (Access denied).

Content of our Debloat-Default-User.ps1:

# We use this script to further debloat some Windows 10 Settings for Default User

Function Debloat-DefaultUser {

    reg load HKU\Default_User C:\Users\Default\NTUSER.DAT

    #Stops the Windows Feedback Experience from sending anonymous data
    Write-Output "Stopping the Windows Feedback Experience program"
    $Period1 = 'Registry::HKU\Default_User\SOFTWARE\Microsoft\Siuf'
    $Period2 = 'Registry::HKU\Default_User\SOFTWARE\Microsoft\Siuf\Rules'
    $Period3 = 'Registry::HKU\Default_User\SOFTWARE\Microsoft\Siuf\Rules\PeriodInNanoSeconds'
    If (!(Test-Path $Period3)) { 
        mkdir $Period1 -ErrorAction SilentlyContinue
        mkdir $Period2 -ErrorAction SilentlyContinue
        mkdir $Period3 -ErrorAction SilentlyContinue
        New-ItemProperty $Period3 -Name PeriodInNanoSeconds -Value 0 -Verbose -ErrorAction SilentlyContinue
    }

    Write-Output "Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings"
    $Holo = 'Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\Holographic'    
    If (Test-Path $Holo) {
        Set-ItemProperty $Holo -Name FirstRunSucceeded -Value 0 -Verbose
    }

    #Disables live tiles
    Write-Output "Disabling live tiles"
    $Live = 'Registry::HKU\Default_User\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications'    
    If (!(Test-Path $Live)) {
        mkdir $Live -ErrorAction SilentlyContinue     
        New-ItemProperty $Live -Name NoTileApplicationNotification -Value 1 -Verbose
    }

    #Disables People icon on Taskbar
    Write-Output "Disabling People icon on Taskbar"
    $People = 'Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People'    
    If (!(Test-Path $People)) {
        mkdir $People -ErrorAction SilentlyContinue
        New-ItemProperty $People -Name PeopleBand -Value 0 -Verbose
    }

    #Disables suggestions on start menu
    Write-Output "Disabling suggestions on the Start Menu"
    $Suggestions = 'Registry::HKU\Default_User\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager'    
    If (Test-Path $Suggestions) {
        Set-ItemProperty $Suggestions -Name SystemPaneSuggestionsEnabled -Value 0 -Verbose
    }

   # The following line throws an error in the capture process -> MDT Capturing fails! 
   # Thats why we disable it for now. Should not be a problem as the default_user registry should unload automatically after reboot   
   # reg unload HKU\Default_User

}

Write-Output "DefaultUser Debloat..."
Debloat-DefaultUser
Write-Output "Finished all tasks."
Sycnex commented 6 years ago

That script looks completely fine and shouldn't break anything. I am looking to make some changes to the script when I have some more time, perhaps tomorrow. I'll see if I can run it under the Default User's context and not just the current user profile.

rom-1 commented 6 years ago

Thanks :)

Sycnex commented 6 years ago

This has been done.