This is my personal blog. The opinions and views I express are my own. The information I provide is on an as-is basis. I make no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this blog and will not be liable for any errors, omissions, or delays in this information or any losses, injuries or damages arising from its use.

Scan for Pii with Powershell

I use this script to search our fileshare for Social Security Numbers… or something that has the same format as a SSN.

Get-ChildItem -Path "z:\share" -Recurse -Force -Include *.doc, *.docx, *.xls, *.xlsx, *.txt, *.pdf, *.ppt, *.pptx | Select-String "[0-9]{3}[-| ][0-9]{2}[-| ][0-9]{4}" | Select-Object Path, Line, LineNumber | Export-Csv "c:\scripts\pii.csv" -Append


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.