The degree of simulation varied, organizers said. Nobody touched actual operating equipment, but some companies sent trucks with linemen aboard to investigate the status of key transformers because the “scenarios” written by Mr. Cauley’s group included computer viruses that kept technicians at the control centers from knowing the condition of crucial equipment.

The drill also involved “denial of service” attacks, in which hackers flooded a computer connected to the Internet with so many messages that it could not handle the load. In real life, banks and other companies have been hit with such attacks.

Drill participants said they would not talk about the specific locations of the simulated attacks, for two reasons: The locations were chosen at points that the insiders knew were vulnerable, and the companies involved were promised that if they participated, their performance would not be held up to public criticism. The purpose, organizers said, was to pose problems that were hard to solve, to expose areas that needed improvement.

In a much smaller drill two years ago, known as GridEx, for Grid Exercise, analysis afterward found that participants were good at communicating with their neighbors, electrically speaking, but not with national organizations like the electric reliability corporation, making it hard for anyone to get an overview of what was happening.

How well they did this time in what the national group called GridEx II will not be clear for weeks.

One main component of the drill was a log of all communications to record who said what to whom, by email or phone, to determine whether the participants could promptly reach the appropriate people at power companies, police stations or distant cybersecurity centers, and whether they could convey the appropriate information. The information supplied by the game controllers included some “fog of war” confusion, Mr. Cauley said.