Files
Intune/intune/Externally Sourced Remediations/DeviceConfiguration/Get-LocalDNSSettings/Detect_LocalDNSSettings.ps1
2025-05-19 15:19:36 -04:00

10 lines
303 B
PowerShell

# Check DNS settings
$dnsServers = Get-DnsClientServerAddress -AddressFamily IPv4 | Select-Object -ExpandProperty ServerAddresses
if ($dnsServers -notcontains "8.8.8.8") {
Write-Output "DNS settings need to be updated"
exit 1
} else {
Write-Output "DNS settings are correct"
exit 0
}