Disclaimer
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 "{3}{2}{4}" | Select-Object Path, Line, LineNumber | Export-Csv "c:\scripts\pii.csv"...

Delete multiple files or folders input from a CSV file (Powershell)

*** THIS SCRIPT IS PROVIDED WITHOUT WARRANTY, USE AT YOUR OWN RISK *** This script will delete one or more files or folders based on input of a list from a CSV file. I wrote this to work in conjunction with this script: https://www.signalwarrant.com/2013/04/20/search-file-structure-for-a-file-or-file-type-and-put-the-results-in-a-csv-file-powershell/. Pretty simple but very effective....

Search file structure for a file or file type and put the results in a CSV file (Powershell)

*** THIS SCRIPT IS PROVIDED WITHOUT WARRANTY, USE AT YOUR OWN RISK *** I put this script together to search my SAN for some files we didn’t want taking up space on our device. It’s essentially a re-work of this script (https://www.signalwarrant.com/2012/07/31/search-for-specific-file-extension-powershell/) from a few months ago. It’s pretty...