In
SDL Web 8.1/8.5, you want to use the Powershell script Remove-TcmItemsOldVersions to remove older versioned items from the Content Manager system. At times a large amount of data is needed to be removed and the query on the Content Manager database takes an extended amount of time. This leads to an error as such:
Remove-TcmItemsOldVersions : The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded
by the remote host, or an underlying network resource issue. Local socket timeout was '1.06:00:00'.
The time in the error message may vary.