GoogleCloudPlatform / GoogleCloudPlatform/compute-image-windows

GCESysprep failed when using on a non-English Windows

Open
#290 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
112
Forks
68
PR merge metrics
No merged PRs in 30d

Description

When trying to perform GCESysprep on an imported, non-English Windows, the following line will fail due to the firewall group display name is not `Remote Desktop` but its localized name, like `遠端桌面` in Chinese (Traditional) systems.

```powershell
Set-NetFirewallRule -DisplayGroup 'Remote Desktop' -Enabled True
```

PowerShell is unable to find any matching rule, which caused GCESysprep to stop.

PowerShell Error

```
2026/06/17 11:02:43 GCESysprep: 找不到內容 'DisplayGroup' 等於 'Remote Desktop' 的 MSFT_NetFirewallRule 物件。請確認內容的值然後重試。 {Line: 289 : Set-NetFirewallRule -DisplayGroup 'Remote Desktop' -Enabled True
, HResult: -2146233087, Script: C:\\Program Files\\Google\\Compute Engine\\sysprep\\sysprep.ps1}
```

The logs above can be translated as follow:

```
2026/06/17 11:02:43 GCESysprep: No MSFT_NetFirewallRule objects found with property 'DisplayGroup' equal to 'Remote Desktop''. Verify the value of the property and retry. {Line: 289 : Set-NetFirewallRule -DisplayGroup 'Remote Desktop' -Enabled True
, HResult: -2146233087, Script: C:\\Program Files\\Google\\Compute Engine\\sysprep\\sysprep.ps1}
```

---

Instead, it can use something like this:

```powershell
Set-NetFirewallRule -Group '@FirewallAPI.dll,-28752' -Enabled True
```

The `Group` property is not localized and `@FirewallAPI.dll,-28752` is for [Remote Desktop Firewall Group](https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/networking-mpssvc-svc-firewallgroups-firewallgroup).

---

Alternatively, this also works:

```powershell
Get-NetFirewallRule -Name 'RemoteDesktop-*' | Where-Object {$_.Name -notmatch '.*WSS?'} | Set-NetFirewallRule -Enabled True
```

The `Name` property is not localized and remained in English (for Remote Desktop rules at least).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.