Monthly Archives: October 2012

Regular Expression to select mulicast and broadcast ip addresses

This is a powershell code snippet I used to find security log event entries that had a multicast or broadcast source ip address: Get-EventLog -LogName Security -instanceid 5156 | where {$_.message -match ‘Source Add.*\.255\s|Source Add.*\s22[4-9]|Source Add.*\s23[0-9]’} Advertisements

Posted in Uncategorized | Leave a comment

Powershell script to show duplicate tv episodes

This powershell script will look in my recorded tv folder for my media center pc and count the number of episodes displaying any duplicates: $sh = new-object -com shell.application $hash = $null $hash = @{} $folder = $sh.namespace(“F:\Recorded TV”) if … Continue reading

Posted in Powershell | Leave a comment

Powershell script to display Top CPU processes

This is a quick little script that you can use to view CPU usage by process from a CLI interface: while (1)  { $Proc = Get-counter “\Process(*)\% processor time”; $Proc.CounterSamples | where {$_.instanceName -ne “idle”} | where {$_.instanceName -ne “_total”} … Continue reading

Aside | Posted on by | Leave a comment