Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Rimuove il suffisso DNS inserito in maniera forzata dai router Telecom Italia sulle schede di rete Windows -
Remove from Windows DNS Suffix
GSolone 22/3/22
try {
$dnsCGSetting = Get-DnsClientGlobalSetting
if($dnsCGSetting.SuffixSearchList.Contains('')) {
$dnsCGClean = $dnsCGSetting.SuffixSearchList.replace('','')
Set-DnsClientGlobalSetting -SuffixSearchList $dnsCGClean
Write-Host "Telecom suffix removed."
} else {
Write-Host "No Telecom suffix found."
} catch {
Write-Host "An error occurred:"
Write-Host $_.ScriptStackTrace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment