<?xml version="1.0" encoding="utf-8"?>
<!--
  ExtensionChrome.admx
  Money Forward Admina ブラウザ拡張機能（Google Chrome 用）を
  Microsoft Intune の ADMX ingestion で配布するためのカスタム ADMX テンプレート。

  対象: Intune（MDM）で管理された Windows 端末
  対になるファイル: ExtensionChrome.adml（同じフォルダに置いてペアでインポートする）

  このテンプレートが書き込む内容:
    - ExtensionSettings   : 拡張機能の強制インストール（force_installed）
    - 3rdparty policy     : ApiKey / CreatedDate / OrganizationID / UserEmail / UserPC

  設定値は Intune の設定画面から入力する。ApiKey / CreatedDate / OrganizationID は
  Admina 管理画面から取得した値をそのまま入力すること。

  UserEmail と UserPC は expandable="true" のため REG_EXPAND_SZ として書き込まれ、
  ブラウザがポリシーを読み込む際に環境変数として展開される。
    UserEmail = %USEREMAIL%      ← Set-UserEmailEnv.ps1 が各ユーザーに設定する
    UserPC    = %COMPUTERNAME%   ← Windows の標準環境変数

  ※ %USEREMAIL% は Windows の標準環境変数ではない。同梱の Set-UserEmailEnv.ps1 を
     Intune の Platform script（ユーザーコンテキスト）で配布する必要がある。
-->
<policyDefinitions revision="1.0" schemaVersion="1.0">
  <policyNamespaces>
    <target prefix="adminachrome" namespace="Admina.Policies.Chrome" />
  </policyNamespaces>
  <resources minRequiredRevision="1.0" />
  <supportedOn>
    <definitions>
      <definition name="SUPPORTED_Admina" displayName="$(string.SUPPORTED_Admina)" />
    </definitions>
  </supportedOn>
  <categories>
    <category name="AdminaCat" displayName="$(string.AdminaCat)" />
    <category name="AdminaChromeCat" displayName="$(string.AdminaChromeCat)">
      <parentCategory ref="AdminaCat" />
    </category>
  </categories>
  <policies>
    <policy name="AdminaChromeManagedPolicy"
            class="User"
            displayName="$(string.AdminaChromeManagedPolicy)"
            explainText="$(string.AdminaChromeManagedPolicy_Explain)"
            presentation="$(presentation.AdminaChromeManagedPolicy)"
            key="Software\Policies\Google\Chrome\3rdparty\extensions\bdeanmdeckegmfjpbnngomallcedjold\policy">
      <parentCategory ref="AdminaChromeCat" />
      <supportedOn ref="SUPPORTED_Admina" />
      <enabledList>
        <item key="Software\Policies\Google\Chrome\ExtensionSettings\bdeanmdeckegmfjpbnngomallcedjold" valueName="installation_mode">
          <value><string>force_installed</string></value>
        </item>
        <item key="Software\Policies\Google\Chrome\ExtensionSettings\bdeanmdeckegmfjpbnngomallcedjold" valueName="update_url">
          <value><string>https://clients2.google.com/service/update2/crx</string></value>
        </item>
      </enabledList>
      <elements>
        <text id="ApiKey" valueName="ApiKey" required="true" />
        <text id="CreatedDate" valueName="CreatedDate" required="true" />
        <text id="OrganizationID" valueName="OrganizationID" required="true" />
        <text id="UserEmail" valueName="UserEmail" required="true" expandable="true" />
        <text id="UserPC" valueName="UserPC" required="true" expandable="true" />
      </elements>
    </policy>
  </policies>
</policyDefinitions>
