Hi guys,
I found the following script that works well, but it will only search the first level of folders. Any way t o edit this guy to search the entire C: drive? thanks!!
function delete-remotefile {
PROCESS {
$file = "\\$_\c$\**\*.pst"
if (test-path $file)
{
echo "$_ *.pst exists"
Remove-Item $file -force -Recurse
echo "$_ *.pst file deleted"
}
}
}
Get-Content C:\Scripts\Active_Computers.txt | delete-remotefile