Initial commit for powershell scripts.

This commit is contained in:
mattspeer committed 2026-10-04 10:22:22 -05:00
1 parent f4e5d9dcbd
commit 4fd95b76d6
18 files changed
+1803

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
'''
Created: 2025-03-05
Modified: 2025-03-05
Description: This script checks to ensure the DNS servers are set to the DNS servers that filter malware
'''
# Get all network adapters
$adapters = Get-NetAdapter | Where-Object { $_.Status -eq 'Up' }
# Check DNS server settings
foreach ($adapter in $adapters) {
$dnsServers = Get-DnsClientServerAddress -InterfaceIndex $adapter.InterfaceIndex
$staticDnsServers = $dnsServers | Where-Object { $_.ServerAddresses -contains '9.9.9.9' -or $_.ServerAddresses -contains '149.112.112.11' -or $_.ServerAddresses -contains '1.1.1.3' -or $_.ServerAddresses -contains '1.0.0.3' }
if ($staticDnsServers.Count -eq 0) {
Write-Host "Adapter $($adapter.Name) does not have the correct DNS servers configured."
$compliance = "false"
}
else {
Write-Host "Adapter $($adapter.Name) has the correct DNS servers configured."
$compliance = "true"
}
}
$hash = @{ Compliant = $compliance}
return $hash | ConvertTo-Json -Compress