Enable Remote Desktop firewall rule locale-independently (netsh -28752) - #12
Open
isss802 wants to merge 1 commit into
Open
Enable Remote Desktop firewall rule locale-independently (netsh -28752)#12isss802 wants to merge 1 commit into
isss802 wants to merge 1 commit into
Conversation
## Problem
Unattended installs reach the desktop, but **RDP (port 3389) is unreachable on
any non-English (localized) Windows** — even though Remote Desktop itself is
enabled.
The `specialize` pass opens the Remote Desktop firewall group by its **display
name**:
```xml
<FirewallGroups>
<FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
<Active>true</Active>
<Group>Remote Desktop</Group>
<Profile>all</Profile>
</FirewallGroup>
</FirewallGroups>
```
`<Group>` matches by the group's **localized** display name. On Japanese Windows
that group is "リモート デスクトップ", so the literal `Remote Desktop` matches
nothing and the inbound RDP rule is never enabled. `fDenyTSConnections=false`
has already switched RDP on, so the service listens — but the OS firewall drops
the connection. English Windows is unaffected only because its display name
happens to be `Remote Desktop`.
## Fix
Add a `FirstLogonCommands` entry that enables the same group by its **numeric
resource id**, which is identical on every UI language:
```
netsh advfirewall firewall set rule group="@FirewallAPI.dll,-28752" new enable=Yes
```
`@FirewallAPI.dll,-28752` is the resource id of the "Remote Desktop" group;
`netsh` resolves it the same regardless of localization. Added to **both**
autounattend templates (`w11` and `2k22`). The existing `<Group>` block is left
in place — it is harmless and still works on English media.
## Testing
Deployed on Linode (`jp-tyo-3`, `g6-standard-4`) from this StackScript.
- **Discriminating A/B (Japanese Windows 11), one variable:** two builds
identical except for this exact `FirstLogonCommands` block (`git diff` = these
7 lines only).
- **Without it:** RDP stays closed; the firewall had to be opened by hand.
- **With it:** RDP auto-opens ~16 min after first boot, no manual step.
- **English Windows 11 25H2:** RDP reachable — raw X.224 Connection Confirm
`03 00 00 13 0e d0 …`. Non-discriminating on en-US (the English display name
also matches), so this only confirms the change is non-breaking there.
- **Japanese Windows Server 2022 (eval):** RDP reachable — X.224 CC
`03 00 00 13 0e d0 00 00 12 34 00 02 1f …`. Confirms the fix works on the
**Server** SKU and on a **localized** OS, where the display-name approach fails.
(X.224 = an RDP client connection request. A `0e d0` Connection Confirm proves
the Windows RDP service — not just an open TCP port — is answering.)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Unattended installs reach the desktop, but RDP (port 3389) is unreachable on any non-English (localized) Windows — even though Remote Desktop itself is enabled.
The
specializepass opens the Remote Desktop firewall group by its display name:<Group>matches by the group's localized display name. On Japanese Windows that group is "リモート デスクトップ", so the literalRemote Desktopmatches nothing and the inbound RDP rule is never enabled.fDenyTSConnections=falsehas already switched RDP on, so the service listens — but the OS firewall drops the connection. English Windows is unaffected only because its display name happens to beRemote Desktop.Fix
Add a
FirstLogonCommandsentry that enables the same group by its numeric resource id, which is identical on every UI language:@FirewallAPI.dll,-28752is the resource id of the "Remote Desktop" group;netshresolves it the same regardless of localization. Added to both autounattend templates (w11and2k22). The existing<Group>block is left in place — it is harmless and still works on English media.Testing
Deployed on Linode (
jp-tyo-3,g6-standard-4) from this StackScript.FirstLogonCommandsblock (git diff= these 7 lines only).03 00 00 13 0e d0 …. Non-discriminating on en-US (the English display name also matches), so this only confirms the change is non-breaking there.03 00 00 13 0e d0 00 00 12 34 00 02 1f …. Confirms the fix works on the Server SKU and on a localized OS, where the display-name approach fails.(X.224 = an RDP client connection request. A
0e d0Connection Confirm proves the Windows RDP service — not just an open TCP port — is answering.)🤖 Generated with Claude Code