群組Group

Group設定會指定FirewallGroup的名稱。The Group setting specifies the name of a FirewallGroup. 可用的規則群組會因 Windows 版本而異。The available rule groups differ by Windows edition.

Values

GroupIDGroupID

指定 Windows 防火牆規則群組的資源識別碼。Specifies the resource ID of a Windows Firewall rule group. GroupID 是字串。GroupID is a string. 預設值為空字串。The default value is an empty string.

取得 GroupIDTo obtain a GroupID

  1. 開啟 PowerShell。Open PowerShell.

  2. 將 PowerShell 視窗最大化,使其包含全螢幕 (如果視窗未最大化,則不會顯示) 的資訊資料行。Maximize the PowerShell window so it encompasses the full screen (if the window is not maximized, it will not show both columns of information).

  3. 輸入下列命令,此命令會顯示電腦上可以有相關聯的防火牆規則的所有唯一群組:Enter the following command, which shows all unique groups on the computer which can have firewall rules associated with them:

    Get-NetFirewallRule | sort -unique Group | sort DisplayGroup | ft DisplayGroup, Group
    
  4. PowerShell 會顯示2個欄位的資訊。PowerShell will show 2 columns of information. 左欄會顯示群組的 DisplayGroup 或「易記」名稱。The left column shows the DisplayGroup, or the "friendly" name of the group. 右欄會顯示 Group 與相關聯的 DisplayGroupThe right column shows the Group associated with the DisplayGroup. Group 的值可能與相同 DisplayGroup ,也可能是包含資源識別碼的字串。Group may have the same value as DisplayGroup, or it may be a string containing a resource ID.

  5. 使用右側資料行中的值做為自動安裝檔案 Group 中的 GroupID。Use the value in the right column, Group, as the GroupID in your Unattend file.

如需命令的詳細資訊 Get-NetFirewallRule ,請參閱 Windows PowerShell 參考中的 Net SecurityFor more information on the Get-NetFirewallRule command, see Net Security in the Windows PowerShell Reference.

父階層Parent Hierarchy

網路-MPSSVC-Svc | FirewallGroups | FirewallGroup | 群組Networking-MPSSVC-Svc | FirewallGroups | FirewallGroup | Group

有效的設定階段Valid Configuration Passes

特殊化specialize

套用至Applies To

如需此元件支援的支援 Windows 版本與架構清單,請參閱 網路-MPSSVC-SvcFor a list of the supported Windows editions and architectures that this component supports, see Networking-MPSSVC-Svc.

XML 範例XML Example

下列 XML 輸出顯示如何設定兩個 Windows 防火牆群組、第一個的 File and Printer Sharing ,以及第二個 Remote DesktopThe following XML output shows how to set two Windows Firewall groups, the first for File and Printer Sharing, and the second for Remote Desktop.

<FirewallGroups>
      <FirewallGroup wcm:action="add" wcm:keyValue="FileAndPrinterSharing">
      <Active>true</Active>
      <Group>@FirewallAPI.dll,-28502</Group>
      <Profile>all</Profile>
   </FirewallGroup>
      <FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
      <Active>true</Active>
      <Group>@FirewallAPI.dll,-28752</Group>
      <Profile>all</Profile>
   </FirewallGroup>
</FirewallGroups>

FirewallGroupFirewallGroup