Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Last active November 3, 2021 23:33
Show Gist options
  • Save wpsmith/ad50f8e7c2c63296587af8d5d40c0233 to your computer and use it in GitHub Desktop.
Save wpsmith/ad50f8e7c2c63296587af8d5d40c0233 to your computer and use it in GitHub Desktop.
Chrome: Disable Guest and Incognito
#!/bin/sh
defaults write com.google.Chrome BrowserGuestModeEnabled -bool false
defaults write com.google.chrome IncognitoModeAvailability -integer 1
defaults write com.google.Chrome BrowserAddPersonEnabled -bool false
defaults write com.google.chrome AllowDeletetingBrowserHistory -bool false
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome
BrowserGuestModeEnabled: 0
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome
IncognitoModeAvailability: 1
$registryPath = "HKLM:\SOFTWARE\Policies\Google\Chrome"
IF(!(Test-Path $registryPath)) {
New-Item -Path $registryPath -Confirm:$false -Force | Out-Null
}
New-ItemProperty -Name BrowserGuestModeEnabled -Path $registryPath -Confirm:$false -Force -Value 0 -PropertyType DWORD
New-ItemProperty -Name IncognitoModeAvailability -Path $registryPath -Confirm:$false -Force -Value 1 -PropertyType DWORD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment