In the sentence

In the past keepers operated all lighthouses.

Is lighthouses the direct object?

In this sentence
Now, lighthouses are beacons run by computers.

Is beacons neither a direct object or an indirect object?

Both of your answers are correct.

Beacons in the second sentence is a predicate nominative.

Lighthouses are towers with extremely strong lights

In the first sentence, "lighthouses" is not the direct object. A direct object is a noun or noun phrase that receives the action of the verb. In this case, the verb "operated" is being performed by the subject "keepers" on "lighthouses." Therefore, "lighthouses" is actually the object of the preposition "on" and is functioning as the object of the prepositional phrase, not as the direct object.

To find the direct object in a sentence, you can ask the question "What?" or "Whom?" after the verb. In this case, asking "What did the keepers operate?" would lead to the answer "lighthouses," which confirms that "lighthouses" is the object of the preposition, not the direct object.

In the second sentence, "beacons" is indeed neither a direct object nor an indirect object. It is the subject of the sentence, as it is performing the action described by the verb "are run." The verb "are run" describes the state or condition of "beacons" being operated by computers. So in this case, "beacons" is the subject of the sentence, not an object.

Understanding the roles of different parts of speech and sentence structures can be helpful in determining the functions of words within a sentence. Asking questions to understand the relationships between the subjects, verbs, and objects can further clarify the roles and functions of different elements in a sentence.