<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Usage Examples on PowerShell module DNSServer.DebugLogParser</title><link>https://DNSServerDebugLogParser.andibellstedt.com/v1.2.1.0/docs/examples/</link><description>Recent content in Usage Examples on PowerShell module DNSServer.DebugLogParser</description><generator>Hugo</generator><language>en</language><atom:link href="https://DNSServerDebugLogParser.andibellstedt.com/v1.2.1.0/docs/examples/index.xml" rel="self" type="application/rss+xml"/><item><title>Practical usage in a Domain Environment (GPO-driven collection and conversion)</title><link>https://DNSServerDebugLogParser.andibellstedt.com/v1.2.1.0/docs/examples/gpo-driven-collection/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://DNSServerDebugLogParser.andibellstedt.com/v1.2.1.0/docs/examples/gpo-driven-collection/</guid><description>&lt;p&gt;This document outlines a practical, end-to-end example of running DNSServer.DebugLogParser in an Active Directory domain environment, focused on converting Windows DNS Server debug logs on domain controllers.&lt;/p&gt;
&lt;p&gt;This example is accompanied by a &lt;a href="../gpo/T0-C-Analytics-DNSDebugLogging.zip"&gt;ZIP archive&lt;/a&gt;, which provide the policy artifacts used to implement the workflow described here.&lt;br&gt;
The most relevant artifacts are &lt;a href="../gpo/backup/manifest.xml" target="_blank" rel="noopener noreferrer"&gt;backup manifest&lt;/a&gt;, &lt;a href="../gpo/backup/{2B6F16BC-0E7C-4787-83D7-2854FED882EE}/gpreport.xml" target="_blank" rel="noopener noreferrer"&gt;GPO report&lt;/a&gt;, &lt;a href="../gpo/backup/{2B6F16BC-0E7C-4787-83D7-2854FED882EE}/DomainSysvol/GPO/Machine/Preferences/Files/Files.xml" target="_blank" rel="noopener noreferrer"&gt;Files.xml&lt;/a&gt;, &lt;a href="../gpo/backup/{2B6F16BC-0E7C-4787-83D7-2854FED882EE}/DomainSysvol/GPO/Machine/Preferences/Files/Set-DNSServerDebugLogging.ps1" target="_blank" rel="noopener noreferrer"&gt;Set-DNSServerDebugLogging.ps1&lt;/a&gt;, and &lt;a href="../gpo/backup/{2B6F16BC-0E7C-4787-83D7-2854FED882EE}/DomainSysvol/GPO/Machine/Preferences/ScheduledTasks/ScheduledTasks.xml" target="_blank" rel="noopener noreferrer"&gt;ScheduledTasks.xml&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="scenario"&gt;Scenario&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Multiple domain controllers (DCs) host the DNS Server role.&lt;/li&gt;
&lt;li&gt;DNS debug logging is enabled and configured consistently on each DC via a scheduled task (writing log files to &lt;code&gt;C:\Administration\Logs\DNSServer&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;A centrally managed process converts logs into CSV for:
&lt;ul&gt;
&lt;li&gt;security analytics&lt;/li&gt;
&lt;li&gt;operational reporting&lt;/li&gt;
&lt;li&gt;troubleshooting&lt;/li&gt;
&lt;li&gt;compliance/retention&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="target-outcomes"&gt;Target outcomes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Consistent conversion settings across all DCs&lt;/li&gt;
&lt;li&gt;Predictable output location and naming&lt;/li&gt;
&lt;li&gt;Optional compression to reduce storage footprint&lt;/li&gt;
&lt;li&gt;Optional statistics outputs for quick daily rollups&lt;/li&gt;
&lt;li&gt;Minimal host-side risk, with explicit rerun and cleanup considerations&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="suggested-architecture"&gt;Suggested architecture&lt;/h2&gt;
&lt;h3 id="collection-model-local-convert--central-pull"&gt;Collection model: local convert + central pull&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Each DC writes DNS debug logs to disk with rollover enabled.&lt;/li&gt;
&lt;li&gt;Each DC converts rotated &lt;code&gt;*.log&lt;/code&gt; files into a data CSV and statistics CSVs, then compresses the outputs into &lt;code&gt;*.zip&lt;/code&gt; on a schedule (Task Scheduler).&lt;/li&gt;
&lt;li&gt;Outputs are written next to the log files so the pipeline stays simple.&lt;/li&gt;
&lt;li&gt;A central server collects the &lt;code&gt;*.zip&lt;/code&gt; outputs, for example via file share ingestion, scheduled copy, SIEM forwarder, or an agent-based collector.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This model minimizes network reads of large raw log files and keeps parsing close to the data.&lt;/p&gt;</description></item><item><title>Scheduled Task Example</title><link>https://DNSServerDebugLogParser.andibellstedt.com/v1.2.1.0/docs/examples/scheduletask/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://DNSServerDebugLogParser.andibellstedt.com/v1.2.1.0/docs/examples/scheduletask/</guid><description>&lt;p&gt;This script creates a Windows Scheduled Task that runs daily at 2:00 AM. It imports the module and processes all the log file in the folder where the script is executed (in this example &amp;ldquo;C:\Administration\Logs\DNS&amp;rdquo;). The process does compress the output into ZIP-files and removes the original to maintain hygiene.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-powershell"&gt;$actionParams = @{
 Execute = &amp;quot;powershell.exe&amp;quot;
 Argument = '-ExecutionPolicy RemoteSigned -Command &amp;quot;Import-Module DNSServer.DebugLogParser; Get-ChildItem .\*.log | Sort-Object lastwritetime, Name -Descending | Convert-DNSDebugLogFile -ComputerName $env:COMPUTERNAME -Delimiter \&amp;quot;;\&amp;quot; -OutputType Both -ContextFilter Packet -OutputCulture sv-SE -CompressOutput&amp;quot;'
 WorkingDirectory = &amp;quot;C:\Administration\Logs\DNS&amp;quot;
}
$Action = New-ScheduledTaskAction @actionParams

$Trigger = New-ScheduledTaskTrigger -Daily -At &amp;quot;2:00AM&amp;quot;

Register-ScheduledTask -TaskName &amp;quot;Process DNS Logs&amp;quot; -Action $Action -Trigger $Trigger -Description &amp;quot;Convert DNS debug logs to CSV daily&amp;quot;
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Security Analysis Workflow with SQL Server</title><link>https://DNSServerDebugLogParser.andibellstedt.com/v1.2.1.0/docs/examples/security-analysis-sql/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://DNSServerDebugLogParser.andibellstedt.com/v1.2.1.0/docs/examples/security-analysis-sql/</guid><description>&lt;p&gt;This example shows a practical workflow for security analytics: parse a DNS
debug log with &lt;code&gt;Convert-DNSDebugLogFile&lt;/code&gt;, import the generated CSV into SQL
Server, and run a query that highlights unusually high volumes of TXT record
lookups.&lt;/p&gt;
&lt;p&gt;For best interoperability, this example writes timestamps in an ISO-like format
by using &lt;code&gt;-OutputCulture 'sv-SE'&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="required-modules"&gt;Required modules&lt;/h2&gt;
&lt;p&gt;This example uses the following PowerShell modules:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;DNSServer.DebugLogParser&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SqlServer&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Install them if needed:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-powershell"&gt;Install-Module -Name DNSServer.DebugLogParser -Scope CurrentUser
Install-Module -Name SqlServer -Scope CurrentUser
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="scenario"&gt;Scenario&lt;/h2&gt;
&lt;p&gt;Use this workflow when you want to move parsed DNS debug log data into SQL
Server so you can:&lt;/p&gt;</description></item></channel></rss>