Preheat the oven to 375°F with a rack in the center. Grease a deep 8x8-inch baking dish (or any 2 2quart baking dish) with nonstick spray or butter. (You can also bake this in a 9x13, just note it will be thinner and will bake in about 20 minutes.)
Place the diced potatoes in a large pot and cover by at least 1 inch with cold water. Bring to a rapid simmer over high heat, then reduce the heat to low and simmer until the potatoes are fork-tender but not mushy, about 10 minutes.
Drain the potatoes and return them to the pot over low heat. Cook for a few minutes to dry them out, stirring constantly.
Turn off the heat and stir in the butter, cream cheese, milk, green onions (reserving a few greens for garnish), garlic, onion powder, salt, and pepper. Gently stir to combine.
Fold in the ham and all but 2 tablespoons each of the cheddar and parmesan.
Transfer the potato mixture to the prepared baking dish. Sprinkle with the reserved 4 tablespoons of cheese.
Bake until golden and melty on top, 20 to 25 minutes. Let stand for 5 to 10 minutes before serving. Garnish with reserved green onion tops.
Notes
TO STORE: Cover the casserole dish tightly or transfer smaller portions of leftovers to an airtight container. Store in the refrigerator for 3-4 days. (I do not recommend freezing this recipe, as potatoes get mealy when frozen.)
TO REHEAT: Warm up individual portions in the microwave for a few minutes, or reheat the whole casserole in a 350ºF oven until heated through.