dissent in a memorandum by Sullivan, J. P., as follows: In this CPLR article 78 proceeding petitioners, defendants in the recently filed underlying action brought by the City of New York, seek to have that action transferred pursuant to section 202.3 (c) (2) of the Uniform Rules for Trial Courts (22 NYCRR 202.3 [c] [2]) and the IAS Manual for Justices of the Supreme Court, New York County, Civil Branch, dated December 4, 1985, to the ex parte motion office of the Supreme Court for random assignment to 1 of the 5 IAS Parts established to handle cases in which the city is a party. Petitioners allege that the underlying action was, in the first instance, improperly assigned by the ex parte motion office to Justice Wilk in violation of the Uniform Rules for Trial Courts and IAS Manual. I find merit to petitioners’ claims and would grant the petition.
The underlying action seeks the abatement of hazardous conditions alleged to exist in 15 different buildings owned or managed by petitioners, the appointment of a receiver to operate the buildings until such conditions are remedied, the establishment of a fund to be used by the receiver to abate the conditions, and the imposition of various penalties. That action was not randomly assigned to 1 of the 5 City Parts, but, rather, referred directly by the ex parte motion clerk’s office to Justice Wilk on the basis of a statement contained in the request for judicial intervention (RJI) that a pending related case was being handled by Justice Wilk. The RJI, prepared and filed by the Corporation Counsel, was never served on any of the defendants, petitioners herein, as required by section 202.6 of the Uniform Rules for Trial Courts.
Section 202.3 (c) (2) of the Uniform Rules for Trial Courts requires the assignment of cases by random selection to *248Judges specially assigned to hear a particular category of actions or proceedings as authorized by the Chief Administrator. The Administrative Judge has established five IAS Parts to handle cases in which the city is a party. The IAS Manual and an October 1986 memorandum from the Administrative Judge require the assignment of any case in which the city is a party to the Justices presiding in the five designated Parts. The same memorandum stated that if in the normal course a city case were sent to a Justice other than one of those presiding over a City Part it should be transferred to one of the designated Justices.
That the Uniform Rules for Trial Courts require that all city cases be handled by 1 of the 5 City Parts is beyond dispute. Section 202.3, in pertinent part, provides:
"(b) Assignments * * * Assignments shall be made by the clerk of the court pursuant to a method of random selection authorized by the Chief Administrator * * *
"(c) Exceptions * * *
"(2) The Chief Administrator may authorize the establishment in any court-of special categories of actions and proceedings * * * for assignment to judges specially assigned to hear such actions or proceedings. Where more than one judge is specially assigned to hear a particular category of action or proceeding, the assignment of such actions or proceedings to the judges so assigned shall be at random.” (Emphasis added.) As used in statutes or rules or the like, words of command such as "shall” are generally construed as mandatory. (Daytop Vil. v Consolidated Edison Co., 61 NY2d 933, 934; Dashinsky v Santjer, 32 AD2d 382, 387.) Thus, assignment by random selection is mandatory, except, for purposes of this controversy, in the case of a Judge specially assigned to hear a certain case; in the event, however, that more than one Judge is so assigned, the assignment "shall be at random” (22 NYCRR 202.3 [c] [2]).
No one argues with the proposition that the principle of random selection should, even in the absence of a specific provision therefor in the Uniform Rules for Trial Courts, yield in a "related case” situation. Not only does such an exception make sense in terms of judicial economy but, undeniably, court administrators should have the flexibility to allow a departure from the random selection principle when the interests of justice compel the continuous supervision of related cases by a single Judge. Neither the viability nor the rationale of "related case” referrals is the issue here, however, where *249the referral was accomplished by an ex parte maneuver in violation of section 202.6 of the Uniform Rules for Trial Courts and the claim of "related case” is specious at best.
The basis for the "related case” reference is that Justice Wilk had before him a mortgage foreclosure proceeding, Gabriel v 351 St. Nicholas Equities, involving 1 of the 15 buildings that are the subject of the underlying action, and in which the city was a nominal party. The complaint in the mortgage foreclosure action alleged that the City Franchise Tax Bureau might have a claim or lien against the premises subordinate to the lien of the plaintiffs’ mortgage and that the Department of Rental Housing and Maintenance was a judgment creditor with liens subordinate to the plaintiffs’. When the city, by order to show cause, sought a preliminary injunction compelling the abatement of certain hazardous conditions in the underlying action, its RJI, referring to the mortgage foreclosure action, stated, "Both [cases] concern possession and control of same premises.” That statement appears to be as inaccurate now as it was when made.
Possession and control of the mortgaged premises was never an issue in the foreclosure action, the sole basis of which was the alleged nonpayment of principal and interest. Only the city appeared, claiming a $929.22 priority over the plaintiffs’ lien. A judgment of foreclosure and sale preserving the city’s claim was entered even before the underlying action was ever commenced. On the other hand, the latter action, as already noted, seeks, inter alia, the abatement of alleged hazardous conditions in 15 different buildings, penalties of $1,000 per nuisance for each day that the same is permitted to exist, $5,000 for each Building Code violation and $150 per day per violation for each day that the petitioners fail to remove such violation, and an award of $43,684 for the cost of emergency repairs. Thus, it is obvious that the "related” mortgage foreclosure action and the underlying public nuisance action have nothing in common, except for the irrelevant coincidence that 1 of the 15 buildings involved in the latter action is the subject of the mortgage foreclosure.*
The city now attempts to justify its claim that the two matters are related by arguing that the condition of the mortgaged premises was an issue in the foreclosure proceed*250ing. In support of this argument it claims that attorneys for the Department of Housing Preservation and Development (HPD) had advised Justice Wilk on July 29, 1987, prior to the commencement of the underlying action, that HPD intended to seek to remove and consolidate a pending Civil Court action commenced by it against the owners of the premises in the mortgage foreclosure action with the foreclosure action. In the Civil Court action HPD sought the correction of 236 outstanding Housing Maintenance Code violations, the recovery of fines and penalties and the payment of moneys expended by HPD for emergency repairs. Consolidation was allegedly sought so that the receiver appointed in the foreclosure action could be authorized to make urgently needed repairs. Of course, consolidation was not required to achieve such a result. The same receiver already appointed in the mortgage foreclosure could have been appointed in the Civil Court action. It is also noteworthy that HPD never sought to have -a receiver appointed in that action. Moreover, the consolidation motion had not even been made at the time of the filing of the RJI. In fact, although pending, it had not yet been decided at the time issue was joined in this proceeding. In any event, the argument based on the consolidation motion is sheer bootstrapping.
Equally meritless is the suggestion that the ex parte motion clerk "independently determined” that the underlying action and the previously filed mortgage foreclosure were sufficiently related so as to justify assignment of the case to Justice Wilk. The city has submitted neither an affidavit nor any other documentation to support such a conclusion, and petitioners were never given the opportunity to be heard since the RJI was never served on them. It seems fairly obvious that the clerk in such cases accepts at face value the representation set forth in the RJI, which is signed by the attorney for the party seeking intervention.
In the circumstances presented, assigning this case to Justice Wilk, rather than permitting random selection among the five Parts designated to hear cases in which the city is a party, appears to be nothing less than a deliberate attempt to circumvent the IAS rules and to steer the underlying nuisance abatement action to a particular Judge. The case was not related at all to the private mortgage foreclosure action and, even if it were, petitioners, by virtue of the city’s failure to serve them with a copy of the RJI, were never given notice of the city’s attempt to bypass the random assignment of the case to a City Part. To countenance what has occurred here is *251to condone a form of Judge-shopping, and to wreak havoc upon the IAS system, which, to prove successful, must have the confidence of the Bar that cases are truly being assigned on a random selection basis. Nothing, of course, precludes the city from moving on the basis of additional facts before the Judge to whom the underlying case is assigned for a referral to Justice Wilk on the ground that he has before him a related case.
The writ should be granted and the underlying action returned to the ex parte motion clerk for assignment to one of the City Parts in accordance with the Uniform Rules for Trial Courts.
The majority’s stress on Justice Wilk’s conclusion in the determination of petitioners’ motion to transfer the underlying case, decided subsequent to the commencement of this proceeding, that "the matters bear sufficient relationship to warrant consideration by a single judge” is unavailing. Notably absent is any explanation as to how the cases are related.