I use this script to search our fileshare for Social Security Numbers… or something that has the same format as a SSN.
1 |
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 |