Place potatoes in a 8-in. Square baking dish. Sprinkle with cheese, ham and onions. Beat eggs, milk, pepper and salt; pour over all. Cover and refrigerate for several hours or overnight. Remove from refrigerator 30 minutes before baking. Bake, uncovered, at 350 degrees for 55-60 minutes or until a knife inserted in the center comes out clean.