Appeal from a judgment of the County Court of Montgomery County (Aison, J.), rendered March 4, 1992, convicting defendant upon his plea of guilty of the crime of criminal possession of a controlled substance in the fourth degree.
Upon entering a plea of guilty of the crime of criminal possession of a controlled substance in the fourth degree, defendant was sentenced as a second felony offender to a term of imprisonment of 7 to 14 years. As a part of his guilty plea, defendant agreed to waive his right to appeal. Defendant now *977contends that his waiver of his right to appeal was not knowing and voluntary and that the sentence he received is harsh and excessive.
Defendant failed to move to withdraw his plea or to vacate the judgment of conviction; he has therefore failed to preserve his challenge to the sufficiency of the plea for review (see, People v Lopez, 71 NY2d 662; People v Schouenborg, 188 AD2d 625; People v Linares, 174 AD2d 847, lv denied 78 NY2d 969). In any event, the record establishes that defendant knowingly and voluntarily waived his right to appeal (see, People v Seaberg, 74 NY2d 1). Given that defendant was allowed to plead guilty to one count of criminal possession of a controlled substance in the fourth degree in satisfaction of a nine-count indictment, pleaded guilty knowing that he would receive the sentence imposed, has a prior criminal history and was not given the harshest possible sentence, there is no reason to disturb the sentence imposed by County Court (see, People v Mackey, 136 AD2d 780, lv denied 71 NY2d 899; People v Du Bray, 76 AD2d 976).
Weiss, P. J., Levine, Crew III, Casey and Harvey, JJ., concur. Ordered that the judgment is affirmed.