Skip to content

Instantly share code, notes, and snippets.

@wpsmith

wpsmith/mac.sh

Last active Sep 18, 2020
Embed
What would you like to do?
Chrome: Disable Guest and Incognito
#!/bin/sh
defaults write com.google.Chrome BrowserGuestModeEnabled -bool false
defaults write com.google.chrome IncognitoModeAvailability -integer 1
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