Get Recycle Bin information on Local/Remote Computers

This function will query and calculate the size of each users Recycle Bin Folder. The function uses the Get-ChildItem cmdlet to determine items in each users Recycle Bin Folder. Remove-Item is used to remove all items in all Recycle Bin Folders. The function uses WMI and the System.Security.Principal.SecurityIdentifier .NET Class to determine User Account to Recycle Bin Folder. Due to the number of objects and their values the default object output is in a “Format-List” format. There may be SIDs that aren’t translated for various reasons, the function will not return an error if it is unable to do so, it will however, return a $null value for the User property. If there are a great number of items in the Recycle Bin Folders, the function will take a few minutes to calculate.

Get Recycle Bin information on Local/Remote Computers from PowerShell