Access Recycle Bin on a Remote PC

create share 671 Reputation points
2024-12-07T20:55:04.04+00:00

Hi,

I need to access the Recycle Bin of a domain user on a remote PC to delete or empty it, but when I access it through Windows Explorer, it shows the recycle bin of my PC instead of the remote PC. I don't want to use PSEXEC because it is not allowed.

Thanks.

Windows Network
Windows Network
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Network: A group of devices that communicate either wirelessly or via a physical connection.
802 questions
Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,971 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,367 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marcin Policht 31,300 Reputation points MVP
    2024-12-07T22:30:08.8833333+00:00

    Try any of the following:

    Method 1: Use UNC Path to Access the User's Directory

    1. Access the remote user's profile directory through the network share:
      • Open the Run dialog (Win + R) and type \RemotePCName\C$\Users\UserName Replace RemotePCName with the name of the remote computer and UserName with the domain user's profile folder.
    2. Navigate to the hidden Recycle Bin folder:
      • Enable the viewing of hidden and system-protected files:
        • In File Explorer, go to View > Options > Change folder and search options.
        • In the View tab, enable Show hidden files, folders, and drives and uncheck Hide protected operating system files.
      • In the user profile directory, locate the folder $Recycle.Bin
      • Open the folder corresponding to the user's SID (Security Identifier).
    3. Delete the contents of the Recycle Bin:
      • Select and delete the files/folders in the $Recycle.Bin folder.

    Method 2: Use PowerShell Remoting

    1. Enable PowerShell Remoting on the remote PC (if not already enabled):
      • Run the following command on the remote PC (can be done via Group Policy or other tools):
             Enable-PSRemoting -Force
        
    2. Use PowerShell to empty the Recycle Bin:
      • Open PowerShell on your PC and execute:
             Invoke-Command -ComputerName RemotePCName -ScriptBlock {
                 Get-ChildItem -Path "C:\$Recycle.Bin" -Recurse | Remove-Item -Force -Recurse
             }
        
      • Replace RemotePCName with the name of the remote computer.

    Method 3: Manually Browse the Hidden Admin Share

    1. Access the $Recycle.Bin folder on the remote PC via the admin share:
      • In File Explorer, open \RemotePCName\C$$Recycle.Bin
      • Navigate to the appropriate SID folder for the user.
    2. Delete the contents:
      • Select and remove the files in the $Recycle.Bin folder.

    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.