Delete files listed in CSV the PowerShell script will read and clean it up from physical location.
1 2 3 4 5 6 7 8 9 |
$Termed_Users = “C:\Data\Termed_Users.csv” $Home_Folders = “X:” $UserList = Import-Csv $Termed_Users $UserList | ForEach-Object { $ID = $_.ID $User_Home = $Home_Folders + “\” + $_.ID Remove-Item -recurse -force $User_Home -erroraction silentlycontinue } |