$RegistryPath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\AAD' $PropertyName = 'AutoAcceptSsoPermission' try { if (-not (Test-Path -LiteralPath $RegistryPath)) { New-Item -Path $RegistryPath -Force -ErrorAction Stop | Out-Null } New-ItemProperty ` -Path $RegistryPath ` -Name $PropertyName ` -PropertyType DWord ` -Value 1 ` -Force ` -ErrorAction Stop | Out-Null Write-Host "Impostazione '$PropertyName' configurata correttamente." -ForegroundColor Green } catch { Write-Error "Errore durante la modifica del registro: $($_.Exception.Message)" exit 1 }