I'm using this PowerShell code for getting a txt file with all the files in Recycle bin with their original location (got from Listing files in recycle bin):
(New-Object -ComObject Shell.Application).NameSpace(0x0a).Items()|select @{n="OriginalLocation";e={$_.ExtendedProperty("{9B174B33-40FF-11D2-A27E-00C04FC30871} 2")}},Name| export-csv -delimiter "\" -path C:\Desktop\file_list_$(get-date -f yyyyMMdd).txt -NoTypeInformation
(gc C:\Desktop\file_list_$(get-date -f yyyyMMdd).txt | select -Skip 1)| % {$_.Replace('"','')}| set-content C:\Desktop\file_list_$(get-date -f yyyyMMdd).txt
and it works great. The problem now is that I've been asked to launch this .ps1 file from computer A for getting the files in recycle bin of computer B (for example \172.00.00.00), going in \172.00.00.00\folder and launching a cmd file that launch that .ps1 file.
I've set
(New-Object -ComObject Shell.Application).NameSpace(0x0a).Items()|select @{n="OriginalLocation";e={$_.ExtendedProperty("{9B174B33-40FF-11D2-A27E-00C04FC30871} 2")}},Name| export-csv -delimiter "\" -path \\172.00.00.00\C\Desktop\file_list_$(get-date -f yyyyMMdd).txt -NoTypeInformation
(gc \\172.00.00.00\C\Desktop\file_list_$(get-date -f yyyyMMdd).txt | select -Skip 1)| % {$_.Replace('"','')}| set-content \\172.00.00.00\C\Desktop\file_list_$(get-date -f yyyyMMdd).txt
but how do I tell it to check recycle bin of computer B?
Thanks!