underline the subject and object in 'He was laughed at by all his friends.'

The subject is "He".

There is no direct object in that sentence, but yes, "friends" is an object -- object of the preposition "by".