Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel dstreefkerk

  • Sydney, Australia
View GitHub Profile
@dstreefkerk
dstreefkerk / dns_client_log.ps1
Created Mar 21, 2019 — forked from randomvariable/dns_client_log.ps1
DNS Client Logging on Windows
View dns_client_log.ps1
function Start-DNSClientLog {
$DnsOpLog = Get-WinEvent -ListLog Microsoft-Windows-DNS-Client/Operational
$DnsOpLog.IsEnabled = $true
$DnsOpLog.SaveChanges()
}
function Get-DNSClientQueries {
foreach($event in (get-winevent Microsoft-Windows-DNS-Client/Operational | % { [xml]$_.ToXml() })) {
$Query = ($event.Event.EventData.Data | Where-Object { $_.Name -eq "QueryName" }).'#text'