Heat the oven to 400°F. Wrap the grated potatoes in a clean towel and squeeze repeatedly until very dry.
Toss the potatoes with melted butter, 1/2 teaspoon salt and 1/4 teaspoon pepper. Press firmly into a greased 9-by-13-inch dish and bake for 25 minutes.
Reduce the oven to 350°F. Scatter the ham and Swiss over the browned potato layer.
Whisk the eggs, milk, Dijon, remaining salt and pepper and pour evenly over the filling.
Bake for 30 to 35 minutes, until the center reaches 160°F. Rest 10 minutes before cutting.