on the end of the cable that connects to the laptop not the power outlet
That cylinder is called a choke. The purpose of the item is to deflect electrical interferences from the outside sources...like telephones, 2-way radios, ect. It also works as a shield for the brick or power converter that your laptop uses. It also puts out signals that could interfere in other devices.
It's a ferrite bead, used to filter electrical noise on the cable before it enters your laptop.