Setting a firewall exception is a simple job, right? Well, it is if you are running an English OS. As soon as the OS language is something else, the exception group will also change to that language. In the case of Swedish, the name will be “Fjärrskrivbord” instead of “Remote Desktop.” This might be tricky if you want to do this on quite a few computers with different languages.

How to configure a remote desktop exception

One way of doing it is by writing a Powershell script:

unction FirewallException ($LanguageCode)
    switch ($LanguageCode)
    1033 {netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes}
    1053 {netsh advfirewall firewall set rule group="Fjärrstyrning" new enable=yes} 
    Default {netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes}

function GetOSLanguage
   $OSLanguage = Get-WmiObject win32_operatingsystem | foreach {$_.oslanguage}

FirewallException (GetOSLanguage)

An easier solution to this problem is using the rule group “@FirewallAPI.dll,-28752”, which is independent of the language installed.

This would mean you would put this in your script:

netsh advfirewall firewall set rule group="@FirewallAPI.dll,-28752" new enable=yes

There are, of course, many more ways of doing this, but these are two ways you can do it.

Subscribe to newsletter:

If you want to receive the latest news for MEMCM, Windows 10, and Powershell, please subscribe to my monthly newsletter!


Please enter your comment!
Please enter your name here