{"content":"<div></div>","rawMetadata":{"metadata":{"_op_canonicalUrlPrefix":"https://learn.microsoft.com/ja-jp/powershell/","_op_gitContributorInformation":{"author":{"display_name":"Banreet Kaur","id":"92906285","name":"Banreet","profile_url":"https://github.com/Banreet"},"contributors":[{"display_name":"Aaron Czechowski","id":"26784733","name":"aczechowski","profile_url":"https://github.com/aczechowski"}],"update_at":"2026/06/25","updated_at_date_time":"2026-06-25T23:34:36.5366339Z"},"_path":"module/configurationmanager/new-cmtsrule.json","_rel":"../../","_tocRel":"../sccm-ps/toc.json","apiPlatform":"powershell","author":"Banreet","breadcrumb_path":"/powershell/sccm/bread/toc.json","canonical_url":"https://learn.microsoft.com/ja-jp/powershell/module/configurationmanager/new-cmtsrule?view=sccm-ps","content_git_url":"https://github.com/MicrosoftDocs/sccm-docs-powershell-ref/blob/main/sccm-ps/ConfigurationManager/New-CMTSRule.md","default_moniker":"sccm-ps","depot_name":"MSDN.sccm-powershell","document_id":"8dc3993b-0ea5-815f-4825-c8540197642f","document_version_independent_id":"92603e7a-e3d5-5623-69f5-bdb2be242fe0","external help file":"AdminUI.PS.dll-Help.xml","feedback_product_url":"https://feedbackportal.microsoft.com/feedback/forum/4669adfc-ee1b-ec11-b6e7-0022481f8472","feedback_system":"Standard","git_commit_id":"48cf632fb4b9ad92060012681a500478254de750","gitcommit":"https://github.com/MicrosoftDocs/sccm-docs-powershell/blob/48cf632fb4b9ad92060012681a500478254de750/sccm-ps/ConfigurationManager/New-CMTSRule.md","github_contributors":["aczechowski"],"locale":"ja-jp","manager":"laurawi","Module Name":"ConfigurationManager","monikers":["sccm-ps"],"ms.author":"dannygu","ms.date":"09/01/2021","ms.service":"configuration-manager","ms.subservice":"other","ms.topic":"reference","online version":"","open_to_public_contributors":true,"original_content_git_url":"https://github.com/MicrosoftDocs/sccm-docs-powershell/blob/live/sccm-ps/ConfigurationManager/New-CMTSRule.md","original_content_git_url_template":"{repo}/blob/{branch}/sccm-ps/ConfigurationManager/New-CMTSRule.md","PlatyPS schema version":"2.0.0","products":["https://authoring-docs-microsoft.poolparty.biz/devrel/f1499c3b-793f-48c3-a9ce-20285bcc6541"],"site_name":"Docs","titleSuffix":"Configuration Manager","uhfHeaderId":"MSDocsHeader-Powershell","updated_at":"2026-06-25 11:34 PM","xrefs":[{"href":"https://learn.microsoft.com/powershell/module/configurationmanager/new-cmtsrule","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"New-CMTSRule","schemaType":"PowershellCmdlet","summary":"<p>\n              <strong>[動的変数の設定]</strong> タスク シーケンス ステップに追加するルールを作成します。</p>\n","uid":"ConfigurationManager.New-CMTSRule"}],"ocv-translation-feedback":true},"_xrefmap":{"ConfigurationManager":{"href":"./","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"ConfigurationManager","schemaType":"PowershellModule","uid":"ConfigurationManager"},"ConfigurationManager.New-CMTSRule":{"href":"new-cmtsrule","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"New-CMTSRule","schemaType":"PowershellCmdlet","summary":"<p>\n              <strong>[動的変数の設定]</strong> タスク シーケンス ステップに追加するルールを作成します。</p>\n","uid":"ConfigurationManager.New-CMTSRule"}},"description":"<p>このコマンドレットを使用して、 <strong>動的変数の設定</strong> タスク シーケンス ステップに追加するルール オブジェクトを作成します。 ルールを追加するには、 <a href=\"new-cmtsstepsetdynamicvariable\">New-CMTSStepSetDynamicVariable</a> コマンドレットまたは <a href=\"set-cmtsstepsetdynamicvariable\">Set-CMTSStepSetDynamicVariable</a> コマンドレットを使用します。 タスク シーケンスでは、この手順を実行すると、動的ルールと変数が順番に評価されます。 特定のデバイス上のルールを評価するときに、それらのルールに基づいてタスク シーケンス変数を設定できます。</p>\n<p>ルールには次の 4 種類があります。</p>\n<ul>\n<li>\n              <strong>コンピューター</strong>: ハードウェア資産タグ、UUID、シリアル番号、または MAC アドレスの値を評価します。</li>\n<li>\n              <strong>場所</strong>: 既定のネットワーク ゲートウェイの値を評価します。</li>\n<li>\n              <strong>Make と Model</strong>: コンピューターの make と model の値を評価します。</li>\n<li>\n              <strong>タスク シーケンス変数</strong>: 評価するタスク シーケンス変数、条件、値を追加します。</li>\n</ul>\n<p>詳細については、「 <a href=\"/mem/configmgr/osd/understand/task-sequence-steps#dynamic-rules-and-variables\">動的ルールと変数</a>」を参照してください。</p>\n<div class=\"NOTE\">\n<p>注:</p>\n<p>\n              <code>PS XYZ:\\&gt;</code>など、Configuration Manager サイト ドライブから Configuration Manager コマンドレットを実行します。 詳細については、「作業の <a href=\"/powershell/sccm/overview\">開始</a>」を参照してください。</p>\n</div>\n","examples":[{"code":"$tsrule = New-CMTSRule -Variable @{'OSDDownloadDestinationLocationType' = 'TSCache'} -ReferencedVariableName \"_SMSTSInWinPE\" -ReferencedVariableOperator equals -ReferencedVariableValue TRUE\n\n$tsname = \"Default IPU\"\n$tsstep = \"Set Dynamic Variables\"\n\nSet-CMTSStepSetDynamicVariable -TaskSequenceName $tsname -StepName $tsstep -AddRule $tsrule","description":"","summary":"<p>この例では、次の規則を作成します。</p>\n<p><code>IF _SMSTSInWinPE equals &quot;TRUE&quot; THEN SET OSDDownloadDestinationLocationType = &quot;TSCache&quot;</code></p>\n<p>次に、このルールをタスク シーケンス内のこのステップの既存のインスタンスに追加します。</p>\n","title":"例 1: Windows PE でダウンロード先を設定する"}],"inputs":[{"description":"","name":"<span class=\"no-loc xref\">None</span>\n"}],"links":[{"href":"set-cmtsstepsetdynamicvariable","text":"Set-CMTSStepSetDynamicVariable"},{"href":"new-cmtsstepsetdynamicvariable","text":"New-CMTSStepSetDynamicVariable"},{"href":"/mem/configmgr/osd/understand/task-sequence-steps#BKMK_SetDynamicVariables","text":"タスク シーケンスの手順について - 動的変数を設定する"},{"href":"/mem/configmgr/osd/understand/using-task-sequence-variables","text":"Configuration Manager でタスク シーケンス変数を使用する方法"}],"module":"ConfigurationManager","name":"New-CMTSRule","notes":"","outputs":[{"description":"","name":"<span class=\"no-loc xref\">IResultObject</span>\n"}],"parameters":[{"aliases":"","defaultValue":"None","description":"<p>\n              <strong>[コンピューター</strong>] ルールの種類に <strong>Asset タグ</strong>を指定します。 最大値は 255 文字です。</p>\n<p>たとえば、この値を <code>123456</code> に設定すると、次の規則が追加されます。 <code>IF Asset tag equals &quot;123456&quot; THEN</code></p>\n","name":"AssetTag","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"cf","defaultValue":"None","description":"<p>コマンドレットを実行する前に確認メッセージを表示します。</p>\n","name":"Confirm","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>\n              <strong>[場所</strong>] 規則の種類に<strong>既定のゲートウェイ</strong>を指定します。</p>\n<p>たとえば、この値を <code>192.168.10.1</code> に設定すると、次の規則が追加されます。 <code>IF Default gateway equals &quot;192.168.10.1&quot; THEN</code></p>\n","name":"DefaultGateway","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>このパラメーターは、ワイルドカード文字をリテラル文字の値として扱います。 \n              <strong>ForceWildcardHandling</strong> と組み合わせることはできません。</p>\n","name":"DisableWildcardHandling","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>このパラメーターはワイルドカード文字を処理し、予期しない動作が発生する可能性があります (推奨されません)。 \n              <strong>DisableWildcardHandling</strong> と組み合わせることはできません。</p>\n","name":"ForceWildcardHandling","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>\n              <strong>[コンピューター</strong>] 規則の種類の <strong>MAC アドレス</strong>を指定します。</p>\n<p>たとえば、この値を <code>00:11:22:33:44:55</code> に設定すると、次の規則が追加されます。 <code>IF MAC address equals &quot;00:11:22:33:44:55&quot; THEN</code></p>\n","name":"MacAddress","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>\n              <strong>[作成</strong>] ルールと [モデル] ルールの種類に <strong>[Make]\\(作成\\</strong>) と [モデル] ルールの種類を指定します。 他の値を設定するには、 <strong>Model</strong> パラメーターを使用します。 両方の値が true の場合、ルールは true と評価されます。</p>\n<p>ワイルドカード文字を使用できます。</p>\n<ul>\n<li>\n              <code>*</code>: 複数の文字</li>\n<li>\n              <code>?</code>: 1 文字</li>\n</ul>\n<p>たとえば、この値を <code>Surface</code> に設定し、[ <strong>モデル</strong> ] を <code>*</code>すると、次の規則が追加されます。 <code>IF Make equals &quot;Surface&quot; AND Model equals &quot;*&quot; THEN</code></p>\n","name":"Make","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>\n              <strong>[作成] ルールと</strong><strong>[モデル</strong>] ルールの種類に [モデル] を指定します。 他の値を設定するには、 <strong>Make</strong> パラメーターを使用します。 両方の値が true の場合、ルールは true と評価されます。</p>\n<p>ワイルドカード文字を使用できます。</p>\n<ul>\n<li>\n              <code>*</code>: 複数の文字</li>\n<li>\n              <code>?</code>: 1 文字</li>\n</ul>\n<p>たとえば、この値を [ <code>*</code> ] に設定し、[ <strong>作成] を</strong> [ <code>Surface</code>] に設定すると、次の規則が追加されます。 <code>IF Make equals &quot;Surface&quot; AND Model equals &quot;*&quot; THEN</code></p>\n","name":"Model","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>[タスク シーケンス <strong>変数]</strong> ルールの種類に <strong>[変数] を</strong> 指定します。 \n              <strong>ReferencedVariableOperator</strong> パラメーターと <strong>ReferencedVariableValue</strong> パラメーターも設定する必要があります。</p>\n<p>この変数名には、組み込みのタスク シーケンス変数または作成したカスタム変数を指定できます。 詳細については、「 <a href=\"/mem/configmgr/osd/understand/using-task-sequence-variables\">Configuration Manager でタスク シーケンス変数を使用する方法</a>」を参照してください。</p>\n<p>たとえば、次の値を設定するとします。</p>\n<ul>\n<li>\n              <strong>ReferencedVariableName</strong>: <code>OSDRegisteredOrgName</code></li>\n<li>\n              <strong>ReferencedVariableOperator</strong>: <code>Equals</code></li>\n<li>\n              <strong>ReferencedVariableValue</strong>: <code>Contoso</code></li>\n</ul>\n<p>次に、次の規則を追加します。 <code>IF OSDRegisteredOrgName equals &quot;Contoso&quot; THEN</code></p>\n","name":"ReferencedVariableName","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>\n              <strong>[タスク シーケンス変数</strong>] ルールの種類に <strong>[条件]</strong> を指定します。 \n              <strong>ReferencedVariableName</strong> パラメーターと <strong>ReferencedVariableValue</strong> パラメーターも設定する必要があります。 使用可能な演算子については、このパラメーターで受け入れられる値の一覧を参照してください。</p>\n<p>たとえば、次の値を設定するとします。</p>\n<ul>\n<li>\n              <strong>ReferencedVariableName</strong>: <code>OSDRegisteredOrgName</code></li>\n<li>\n              <strong>ReferencedVariableOperator</strong>: <code>Equals</code></li>\n<li>\n              <strong>ReferencedVariableValue</strong>: <code>Contoso</code></li>\n</ul>\n<p>次に、次の規則を追加します。 <code>IF OSDRegisteredOrgName equals &quot;Contoso&quot; THEN</code></p>\n","name":"ReferencedVariableOperator","parameterValueGroup":"Exists, NotExists, Equals, NotEquals, Greater, GreaterEqual, Less, LessEqual, Like, NotLike","position":"Named","type":"<span class=\"no-loc xref\">VariableOperatorType</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>\n              <strong>[タスク シーケンス変数</strong>] ルールの種類に <strong>[値]</strong> を指定します。 \n              <strong>ReferencedVariableName</strong> パラメーターと <strong>ReferencedVariableOperator</strong> パラメーターも設定する必要があります。</p>\n<p>たとえば、次の値を設定するとします。</p>\n<ul>\n<li>\n              <strong>ReferencedVariableName</strong>: <code>OSDRegisteredOrgName</code></li>\n<li>\n              <strong>ReferencedVariableOperator</strong>: <code>Equals</code></li>\n<li>\n              <strong>ReferencedVariableValue</strong>: <code>Contoso</code></li>\n</ul>\n<p>次に、次の規則を追加します。 <code>IF OSDRegisteredOrgName equals &quot;Contoso&quot; THEN</code></p>\n","name":"ReferencedVariableValue","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>\n              <strong>[コンピューター</strong>] ルールの種類に<strong>シリアル番号</strong>を指定します。</p>\n<p>たとえば、この値を <code>123456</code> に設定すると、次の規則が追加されます。 <code>IF Asset tag equals &quot;123456&quot; THEN</code></p>\n","name":"SerialNumber","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>\n              <strong>[コンピューター</strong>] ルールの種類に <strong>UUID を</strong>指定します。</p>\n<p>たとえば、この値を <code>de5ba380-f692-45e0-bbd3-0e40543b549e</code> に設定すると、次の規則が追加されます。 <code>IF UUID equals &quot;de5ba380-f692-45e0-bbd3-0e40543b549e&quot; THEN</code></p>\n","name":"Uuid","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"Variables","defaultValue":"None","description":"<p>ルールが true と評価されたときにステップで設定する必要がある既存のタスク シーケンス変数またはカスタム タスク シーケンス変数と関連する値を指定します。</p>\n<p>たとえば、この値を <code>@{'OSDDownloadDestinationLocationType' = 'TSCache'}</code> に設定すると、ルールの <code>THEN</code> の後に次の変数が追加されます。 <code>SET OSDDownloadDestinationLocationType = &quot;TSCache&quot;</code></p>\n<p>同じハッシュテーブルに複数の変数を指定するには、セミコロン (<code>;</code>) 区切り記号を使用します。 例: <code>@{'OSDRegisteredUserName' = 'Contoso';'OSDRegisteredOrgName' = 'Contoso'}</code></p>\n","isRequired":true,"name":"Variable","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">Hashtable</span>\n"},{"aliases":"wi","defaultValue":"None","description":"<p>コマンドレットが実行されるとどうなるかを示します。 コマンドレットは実行されません。</p>\n","name":"WhatIf","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"}],"schema":"PowershellCmdlet","summary":"<p>\n              <strong>[動的変数の設定]</strong> タスク シーケンス ステップに追加するルールを作成します。</p>\n","syntaxes":["New-CMTSRule -Variable <Hashtable> [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]\n [<CommonParameters>]","New-CMTSRule [-AssetTag <String>] [-MacAddress <String>] [-SerialNumber <String>] [-Uuid <String>]\n -Variable <Hashtable> [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]\n [<CommonParameters>]","New-CMTSRule [-DefaultGateway <String>] -Variable <Hashtable> [-DisableWildcardHandling]\n [-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]","New-CMTSRule [-Make <String>] [-Model <String>] -Variable <Hashtable> [-DisableWildcardHandling]\n [-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]","New-CMTSRule [-ReferencedVariableName <String>] [-ReferencedVariableOperator <VariableOperatorType>]\n [-ReferencedVariableValue <String>] -Variable <Hashtable> [-DisableWildcardHandling] [-ForceWildcardHandling]\n [-WhatIf] [-Confirm] [<CommonParameters>]"],"uid":"ConfigurationManager.New-CMTSRule","hideEdit":true,"ms.translationtype":"MT","ms.contentlocale":"ja-jp","loc_version":"2024-08-21T21:18:36.7205003Z","loc_source_id":"Github-72476255#live","loc_file_id":"Github-72476255.live.MSDN.sccm-powershell.sccm-ps/ConfigurationManager/New-CMTSRule.md","xrefs":[{"href":"https://learn.microsoft.com/powershell/module/configurationmanager/new-cmtsrule","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"New-CMTSRule","schemaType":"PowershellCmdlet","summary":"<p>\n              <strong>[動的変数の設定]</strong> タスク シーケンス ステップに追加するルールを作成します。</p>\n","uid":"ConfigurationManager.New-CMTSRule"}],"canonical_url":"https://learn.microsoft.com/ja-jp/powershell/module/configurationmanager/new-cmtsrule?view=sccm-ps","_op_canonicalUrl":"https://learn.microsoft.com/ja-jp/powershell/module/configurationmanager/new-cmtsrule?view=sccm-ps"},"pageMetadata":"<meta name=\"description\" content=\"<p>このコマンドレットを使用して、 <strong>動的変数の設定</strong> タスク シーケンス ステップに追加するルール オブジェクトを作成します。 ルールを追加するには、 <a href=&quot;new-cmtsstepsetdynamicvariable&quot;>New-CMTSStepSetDynamicVariable</a> コマンドレットまたは <a href=&quot;set-cmtsstepsetdynamicvariable&quot;>Set-CMTSStepSetDynamicVariable</a> コマンドレットを使用します。 タスク シーケンスでは、この手順を実行すると、動的ルールと変数が順番に評価されます。 特定のデバイス上のルールを評価するときに、それらのルールに基づいてタスク シーケンス変数を設定できます。</p>\n<p>ルールには次の 4 種類があります。</p>\n<ul>\n<li>\n              <strong>コンピューター</strong>: ハードウェア資産タグ、UUID、シリアル番号、または MAC アドレスの値を評価します。</li>\n<li>\n              <strong>場所</strong>: 既定のネットワーク ゲートウェイの値を評価します。</li>\n<li>\n              <strong>Make と Model</strong>: コンピューターの make と model の値を評価します。</li>\n<li>\n              <strong>タスク シーケンス変数</strong>: 評価するタスク シーケンス変数、条件、値を追加します。</li>\n</ul>\n<p>詳細については、「 <a href=&quot;/mem/configmgr/osd/understand/task-sequence-steps#dynamic-rules-and-variables&quot;>動的ルールと変数</a>」を参照してください。</p>\n<div class=&quot;NOTE&quot;>\n<p>注:</p>\n<p>\n              <code>PS XYZ:\\&amp;gt;</code>など、Configuration Manager サイト ドライブから Configuration Manager コマンドレットを実行します。 詳細については、「作業の <a href=&quot;/powershell/sccm/overview&quot;>開始</a>」を参照してください。</p>\n</div>\n\" />\r\n<meta name=\"hideEdit\" content=\"true\" />\r\n<meta name=\"loc_file_id\" content=\"Github-72476255.live.MSDN.sccm-powershell.sccm-ps/ConfigurationManager/New-CMTSRule.md\" />\r\n<meta name=\"loc_source_id\" content=\"Github-72476255#live\" />\r\n<meta name=\"loc_version\" content=\"2024-08-21T21:18:36.7205003Z\" />\r\n<meta name=\"module\" content=\"ConfigurationManager\" />\r\n<meta name=\"ms.contentlocale\" content=\"ja-jp\" />\r\n<meta name=\"ms.translationtype\" content=\"MT\" />\r\n<meta name=\"name\" content=\"New-CMTSRule\" />\r\n<meta name=\"notes\" content=\"\" />\r\n<meta name=\"schema\" content=\"PowershellCmdlet\" />\r\n<meta name=\"summary\" content=\"<p>\n              <strong>[動的変数の設定]</strong> タスク シーケンス ステップに追加するルールを作成します。</p>\n\" />\r\n<meta name=\"syntaxes\" content=\"New-CMTSRule -Variable <Hashtable> [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]\n [<CommonParameters>]\" />\r\n<meta name=\"syntaxes\" content=\"New-CMTSRule [-AssetTag <String>] [-MacAddress <String>] [-SerialNumber <String>] [-Uuid <String>]\n -Variable <Hashtable> [-DisableWildcardHandling] [-ForceWildcardHandling] [-WhatIf] [-Confirm]\n [<CommonParameters>]\" />\r\n<meta name=\"syntaxes\" content=\"New-CMTSRule [-DefaultGateway <String>] -Variable <Hashtable> [-DisableWildcardHandling]\n [-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]\" />\r\n<meta name=\"syntaxes\" content=\"New-CMTSRule [-Make <String>] [-Model <String>] -Variable <Hashtable> [-DisableWildcardHandling]\n [-ForceWildcardHandling] [-WhatIf] [-Confirm] [<CommonParameters>]\" />\r\n<meta name=\"syntaxes\" content=\"New-CMTSRule [-ReferencedVariableName <String>] [-ReferencedVariableOperator <VariableOperatorType>]\n [-ReferencedVariableValue <String>] -Variable <Hashtable> [-DisableWildcardHandling] [-ForceWildcardHandling]\n [-WhatIf] [-Confirm] [<CommonParameters>]\" />\r\n<meta name=\"uid\" content=\"ConfigurationManager.New-CMTSRule\" />\r\n","themesRelativePathToOutputRoot":"_themes/"}