Skip to content

Instantly share code, notes, and snippets.

@JFFail
JFFail / gist:6442b27225eb71b30d26
Created January 6, 2015 15:27
Script to pull the end of netlogon.log files on a list of DCs to check for entries in the last two months.
#Get the list of servers.
$serverList = Get-Content -Path .\servers.txt
#Loop through each.
foreach($server in $serverList) {
#Get the contents of the netlogon file.
$netlogonContent = Get-Content -Path \\$server\C$\Windows\debug\netlogon.log -Tail 5
#Boolean to only write the server name once if at all.
$serverNameWritten = $false