We have a Windows Server 2008 R2 domain controller which always sets its NLA location to 'Network 3' after a reboot. Without fail, this defaults to Public, which screws with my Domain profile firewall settings. I have to manually disable and re-enable the network adapter before it will set itself back to the domain profile.
I've tried KB2524478 and a whole host of other things. Now I'm tired of trying to fix this problem (and fast running out of time) so just want to get around it. I was thinking about scripting the disable/enable with netsh
and being done with it, but I'd like to go one step further and make sure that the NLA location is actually "Network 3" and not "the-domain.example.org" (more specifically, just checking it is not the domain) before I do. That way, I can schedule it more frequently than just on startup.
I'm just missing a piece of this puzzle — how to retrieve the location using something I can pipe to FIND /i "the-domain.example.org"
, so I can run it as:
<something> | ...
FIND /i "the-domain.example.org" || ...
NETSH interface set interface name="Local Area Connection" admin=DISABLED & ...
NETSH interface set interface name="Local Area Connection" admin=ENABLED
So what is <something>
?