Hello All, I know it's been a while since anybody has posted, but this thread still comes up at the top of google searches on the topic so I thought I'd comment.This has been an intermittent issue (couple times a year) for me since Server 2012R2. Almost always when this happens on a 2012R2 server I can just reboot and it will return to the correct domain profile.
As has been stated here there just is no solid fix for this, and it happens periodically with no reason that I can find. I've never found a "fix" for it, or a good reason of what causes it. Certainly I've never seen any official Microsoft documentation on it that addresses what is very obvious to all of us a fundamental and ongoing BUG with the windows firewall.
I just had this happen to a freshly built 2022 server. I was actually in the firewall (hadn't changed anything yet) and got kicked off the server (I was remoted in.) I had to call someone at that location and have him go to the server room and verify the server was still up (it was.) Then I had him turn the firewall off and I was able to reconnect. What had happened is it had just flipped to the Public Firewall profile on it's own in the middle of me working on it for no real reason.
I tried all of the fixes here to get it to change, nothing worked.
Couple things I found - If I set a reservation for the nic on DHCP and let it pull an address, it would return to the Domain Firewall profile immediately (didn't even need to reboot.) Change it back to static and it would go to Public again. I was finally able to fix it by setting the Automatic Metric of the NIC to 1. After that, when I changed the NIC back to a static address it stayed in the Domain Profile. Fingers cross on how long it will last.
In the name of full disclosure, I also had disabled other nics on the server and reactivated them, basically just seeing what I could get to stick to the wall.
Again, this is very obviously a fundamental problem with the windows firewall that has existed for more than a decade that they just don't seem to care about.