In the episode Spock’s Brain, widely regarded as the worst episode of ST, ever, space bimbos steal his brain to run their underground complex.
It was SO bad.
Spock, the Controller, operates the essential systems of the Eymorgs’ underground complex, recirculating the air, running heating plants, and purifying water, among other things.
Kara informs them that the new Controller is expected to last 10,000 years.
She also reveals that the skills needed to acquire and install the Controller were provided by a machine called the “Teacher”, and that knowledge so obtained lasts no more than three hours.
Kirk forces Kara to use the Teacher again, hoping she can then be persuaded to restore Spock’s brain.
She refuses, instead threatening them with a phaser, which Kirk is able to take away.
McCoy decides to risk using the Teacher himself, and then quickly begins the procedure to restore Spock’s brain.
His new knowledge begins to leave him before the operation is complete, but Spock provides assistance after McCoy reestablishes his ability to speak.
Without their Controller, Kara fears for the Eymorgs’ existence. Kirk assures Kara that the Eymorgs and Morgs can learn to survive together.