—In an action, inter alia, to vacate a judgment of foreclosure and sale, the plaintiff appeals from an order of the Supreme Court, Nassau County (Yachnin, J.), dated November 21, 1994, which denied her motion which was, in effect, for summary judgment.
Ordered that the order is modified, on the law, with one bill of costs to the defendants appearing separately and filing separate briefs, by adding a provision thereto, which, upon searching the record, grants summary judgment to the defendants dismissing the complaint.
The plaintiff’s motion which was, in effect, for summary judgment, was properly denied, since the underlying action was improper. Rather than commence a plenary action to vacate the judgment of foreclosure and sale, the plaintiff should have made a motion to vacate in the foreclosure action (see, CPLR 5015; James v Shave, 97 AD2d 927, affd 62 NY2d 712). Since the underlying action is improper, we search the record and grant summary judgment in favor of the defendants dismissing the complaint (CPLR 3212 [b]). Mangano, P. J., Bracken, Copertino and Pizzuto, JJ., concur.