This dispute began on January 3, 1978, when the plaintiff filed a written complaint with the New Canaan police department alleging that a police officer used excessive force on a prisoner in his custody. After a preliminary investigation, the chief of police brought the charges to the attention of the police trial board1 (hereinafter the board), which considered the charges in closed sessions on February 16 and 23, 1978. Except when he testified, the plaintiff was excluded from the proceedings. The press and public were barred from the entire hearing. After these sessions, the board cleared the officer in question of all of the charges against him.
About a year later, on March 21,1979, the present action was commenced. The plaintiff claimed that the board had violated the Freedom of Information Act; General Statutes § 1-15 et seq.; by improperly closing the sessions at which his original complaint was considered. Specifically, the plaintiff argued to the court below that the board’s meetings were not properly “executive sessions” as defined in § l-18a (e) and that the sessions should have been open to the public under § 1-21. To remedy this wrongful exclusion, the plaintiff sought a writ of mandamus directing the board to hold an open meeting to reconsider the charges leveled by the *140plaintiff against the officer. The trial court granted the defendants’ motion to strike, holding that the consideration of the charges by the board was a “[djiscussion concerning the appointment, employment, performance, evaluation, health or dismissal of a public officer or employee” and thus proper subject matter for an executive session under §l-18a (e) (1). From the judgment rendered, the plaintiff has appealed.
The plaintiff alleged that he was aggrieved because his complaint against Sergeant William Ferri of the New Canaan police department was not heard in public. He therefore requested that the court order the board to conduct a public hearing on his complaint. Such an order would reopen a matter which the board had already concluded in Ferri’s favor. Ferri was not made a party to the present action. Although as a general rule the only necessary party to a mandamus action is the officer, body, corporation or person whose duty it is to perform the act sought to be enforced; Jones v. Ricker, 172 Conn. 572, 575-76, 375 A.2d 1034 (1977); where the performance of the duty will adversely affect the rights of a third person, the determination to enforce the duty cannot be made unless the person whose rights may be so affected is made a party to the proceeding. See State ex rel. Guglielmo v. Bergin, 149 Conn. 631, 640, 183 A.2d 607 (1962); 52 Am. Jur. 2d, Mandamus § 398.
In ruling on a motion to strike the trial court is limited to considering the grounds specified in the motion. Stradmore Development Corporation v. Commissioners, 164 Conn. 548, 551, 324 A.2d 919 (1973). Because nonjoinder of a necessary party was not specified in the defendants’ motion, non*141joinder could not furnish a basis for the court’s decision. On the other hand, without the presence of the necessary party the court could not fully adjudicate the matter before it. Cavalli v. McMahon, 174 Conn. 212, 215, 384 A.2d 374 (1978); Talarico v. Conkling, 168 Conn. 194, 197, 362 A.2d 862 (1975). In these circumstances, the trial court should have afforded the plaintiff a reasonable opportunity to cite in the necessary party. Upon failure of the plaintiff to do so the court, on its own motion with proper notice, could have stricken the complaint for nonjoinder.
As presented to the court, the motion to strike relied solely on the discretionary nature of the relief requested by the plaintiff’s complaint.2 See Light v. Board of Education, 170 Conn. 35, 38, 364 A.2d 229 (1975). A trial court in passing upon a motion to strike should not consider grounds other than those specified.3 Turrill v. Erskine, 134 Conn. 16, 19-20, 54 A.2d 494 (1947).
There is error, the judgment is set aside and the case is remanded with direction to vacate the decision granting the motion to strike.
In this opinion the other judges concurred.
The police trial board is composed of all members of the police commission. Under the town charter, the commission is charged with the authority to remove, suspend or fine police officers after proper notice and a hearing.
The court did not squarely rule on this ground. Thus we have no occasion to review the defendants’ claim in that regard. Por similar reasons we decline to rule on the qüestion whether mandamus is inappropriate in this case since it appears that the plaintiff failed to appeal to the freedom of information commission, which in ordinary circumstances is the normal legal remedy for being wrongfully excluded from a public meeting. See General Statutes § l-21i(b).
Although we may, on appeal, sustain a proper ruling even though reached on grounds other than those asserted in the motion; Joseph Rugo, Inc. v. Henson, 148 Conn. 430, 433, 171 A.2d 409 (1961); but cf. Webel v. Yale University, 125 Conn. 515, 526, 7 A.2d 215 (1939); Maltbie, Conn. App. Proc. § 65; the present posture of this case makes such an approach inappropriate.