2
0
tcse-deploy/GCPW/GCPW-AllowDomains.ps1
2024-12-11 12:42:52 -06:00

20 lines
695 B
PowerShell

# Define the registry path and value name
$registryPath = 'HKLM:\Software\Google\GCPW'
$valueName = 'domains_allowed_to_login'
# Check if the GCPW key exists
if (Test-Path -Path $registryPath) {
Write-Warning "GCPW key already exists. Skipping creation."
} else {
# Create the GCPW key
New-Item -Path $registryPath -Force | Out-Null
}
# Define the allowed domains (replace with your actual domains)
$allowedDomains = "tcse.us"
# Set the registry value with allowed domains
New-ItemProperty -Path $registryPath -Name $valueName -Value $allowedDomains -PropertyType MultiString -Force
# Confirmation message
Write-Host "GCPW registry key configured with allowed domains: $allowedDomains"