Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
ClientInspectorV2 — Azureベースのクライアントインベントリとドリフト検出ツールで、Windows構成データ(アンチウイルス、パッチ適用、Bitlocker)をLogAnalyticsに収集し、KQL駆動のダッシュボードやSentinelアラートに利用します。 | Kitploit
ツール/GitHubGitHub/knudsenmorten/clientinspectorv2
防御ツール構成監査クラウドセキュリティインシデントレスポンスログ分析
GitHubknudsenmorten/clientinspectorv2

ClientInspectorV2

Azureベースのクライアントインベントリとドリフト検出ツールで、Windows構成データ(アンチウイルス、パッチ適用、Bitlocker)をLogAnalyticsに収集し、KQL駆動のダッシュボードやSentinelアラートに利用します。

リポジトリを見る
2753年前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

Introduction to ClientInspector (v2)

ClientInspector

あなたはコントロールできていますか? - それとも、パッチ適用、アンチウイルス、BitLocker有効化などのコアインフラストラクチャプロセスが逸脱していませんか?または、LenovoやDellの保証に対して保証状態を確認できる高度なインベントリを実行したいですか?それなら、読み続けてください。

ClientInspector をチェックしてください。これにより、完全なクライアント環境に関する素晴らしい洞察を得ることができます。

ClientInspector はコミュニティに無料で提供されています。Azure Log Ingestion Pipeline、Azure Data Collection Rules、Azure LogAnalytics を使用してクライアントからデータを取得し、Azure Monitor と Azure Dashboards で表示し、Microsoft Sentinel を使用して「逸脱アラート」を受け取る方法を示すクールなショーケースとして構築されています。

Video 3m 01s - Dashboards

ClientInspector のアーキテクチャとフロー

ClientInspector (v2) は、収集したデータを Log ingestion API、Azure Data Collection Rules (DCR)、Azure Data Collection Endpoints (DCE) を使用して、Azure LogAnalytics ワークスペース の カスタムログ にアップロードします。

Archicture

サンプルダッシュボード

KPIs

アンチウイルス

ブルースクリーン

免責事項

重要なのは、私はMicrosoftのセキュリティおよび管理スタックと競合するような独立した管理ツールを構築しようとしているわけではないということです。

Microsoft Azure/M365 の管理およびセキュリティスタックに勝るものはありません。それらはロックスターソリューションです。

しかし、私はログ機能と、クライアント、サーバー、クラウド、サードパーティシステムからデータを取得し、そのデータからクールで価値のある情報を得る力に非常に情熱を持っています。

サーバー向けの同様のソリューションとしてServerInspectorがあります。残念ながら、公開されていません。

Microsoft製品チームの素晴らしい皆さんに大感謝 - あなたたちはロックスターです 😄

楽しい探索を 😄


クイックリンク

どのようなデータが収集されますか?
望ましい状態のダッシュボード - データから環境の洞察を得るには?
データをクエリするには? - Kusto (KQL) が答えです
アーキテクチャ、スキーマ、ネットワーキング
実装
依存関係
ClientInspector.ps1 の実行 - 3つのモード
ClientInspector のサンプル出力
セキュリティ
ClientInspector データセットのレイアウト
Verbose モードと詳細ヘルプ
コスト - これらのデータを保存するのにどれくらいかかりますか? バグ発見時はお知らせください
連絡先

ソリューションのビデオ

ビデオ 3m 19s - コマンドラインを使用した ClientInspector の実行 (通常モード)
ビデオ 1m 40s - 2つのテーブルとDCRの自動作成 (Verbose モード)
ビデオ 1m 37s - 2つのテーブルとDCRの自動作成 (通常モード)
ビデオ 1m 34s - DCRとテーブルのスキーマを確認
ビデオ 2m 19s - データ操作
ビデオ 1m 58s - データに対する Kusto クエリ
ビデオ 3m 01s - ダッシュボード
ビデオ 0m 48s - データの使用例 - Lenovo 保証データベースの検索
ビデオ 7m 25s - ClientInspector DeploymentKit を使用したデプロイ


どのようなデータが収集されますか?

ClientInspector は、Windows クライアントから多くの素晴らしい情報を収集し、そのデータを Azure LogAnalytics カスタムテーブル に送信するために使用できます。

このスクリプトは以下の情報を収集します(設定、情報、構成、状態):

  1. クライアントにログオンしているユーザー
  2. コンピューター情報 - BIOS、プロセッサー、ハードウェア情報、Windows OS 情報、OS 情報、最後の再起動
  3. インストール済みアプリケーション(WMI とレジストリの両方を使用)
  4. Windows のアンチウイルスセキュリティセンター - デフォルトのアンチウイルス、状態、構成
  5. Microsoft Defender アンチウイルス - ASR、除外、リアルタイム保護などを含むすべての設定
  6. Office - バージョン、更新チャネル構成、SKU
  7. VPN クライアント - バージョン、製品
  8. LAPS - バージョン
  9. Admin By Request(サードパーティ)- バージョン
  10. Windows Update - 最後の結果(いつ)、Windows Update ソース情報(どこで)、保留中の更新、最後のインストール(何を)
  11. BitLocker - 構成
  12. イベントログ - ログオンイベント、ブルースクリーンなどの特定のイベントを検索
  13. ネットワークアダプター - 構成、インストールされているアダプター
  14. すべてのアダプターの IP 情報
  15. ローカル管理者グループのメンバーシップ
  16. Windows ファイアウォール - 3つのモードすべての設定
  17. グループポリシー - 最後の更新
  18. TPM 情報 - TPM を搭載している/いないマシンを検出するために関連

お客様のニーズに合わせて、さらにクールなデータコレクションを自由に追加してください。コミュニティに参加したい場合は、コミュニティ全体の利益になると考えるコレクションがあれば、メールでお送りください。


ソースデータ - どのようなデータを使用できますか?

PowerShell で取得できる任意のソースデータ(WMI、CIM、外部データ、REST API、XML 形式、JSON 形式、CSV 形式など)を使用できます。

データを送信する前に、それらが有効であり、無関係なデータが削除されていることを確認するために、通常、データを操作する必要があることを理解することが非常に重要です。

ClientInspector は、PowerShell モジュール AzLogDcIngestPS 内の 24 の関数すべてを使用して、ソースデータの操作を処理し、データ内の「ノイズ」を除去、テーブル/DCR 内の禁止された列の名前を変更、さらに UserLoggedOn、CollectionTime、Computer などの追加の洞察による透明性のニーズをサポートします。

関数 Convert-CimArrayToObjectFixStructure、Add-CollectionTimeToAllEntriesInArray、Add-ColumnDataToAllEntriesInArray、ValidateFix-AzLogAnalyticsTableSchemaColumnNames、Build-DataArrayToAlignWithSchema、Filter-ObjectExcludeProperty の使用方法の例```js #------------------------------------------------------------------------------------------- # Collecting data (in) #-------------------------------------------------------------------------------------------

Write-Output "" Write-Output "Collecting Bios information ... Please Wait !"

$DataVariable = Get-CimInstance -ClassName Win32_BIOS

#-------------------------------------------------------------------------------------------

Preparing data structure

#-------------------------------------------------------------------------------------------

convert CIM array to PSCustomObject and remove CIM class information

$DataVariable = Convert-CimArrayToObjectFixStructure -data $DataVariable -Verbose:$Verbose

add CollectionTime to existing array

$DataVariable = Add-CollectionTimeToAllEntriesInArray -Data $DataVariable -Verbose:$Verbose

add Computer & UserLoggedOn info to existing array

$DataVariable = Add-ColumnDataToAllEntriesInArray -Data $DataVariable -Column1Name Computer -Column1Data $Env:ComputerName -Column2Name UserLoggedOn -Column2Data $UserLoggedOn -Verbose:$Verbose

Remove unnecessary columns in schema

$DataVariable = Filter-ObjectExcludeProperty -Data $DataVariable -ExcludeProperty __*,SystemProperties,Scope,Qualifiers,Properties,ClassPath,Class,Derivation,Dynasty,Genus,Namespace,Path,Property_Count,RelPath,Server,Superclass -Verbose:$Verbose

AzLogDcrIngestPSで利用可能な関数の詳細とその使用方法については、こちらをご覧ください


望ましい状態のダッシュボード - データから環境の洞察を得る方法は?

初期デプロイメントの一環として、ClientInSpectorV2-DeploymentKitを使用すると、多くのAzureダッシュボードとAzure Workbooksにアクセスできます。

動画 3分01秒 - ダッシュボード

ダッシュボードの考え方は、インフラストラクチャが「望ましい状態」から逸脱している場所を示すことです。それらを、インフラストラクチャが制御下にないKPIと考えてください。

パッチ適用やアンチウイルス管理のタスクを持つ代わりに、コンピュータがパッチ適用されていない場所、アンチウイルスのリアルタイム保護が実行されていない場所、または過去24時間以内にブルースクリーンが発生したマシンを示すKPIを持つことを検討できます。

これはMicrosoft Secure Scoreと同じ概念です。

アンチウイルス

ブルースクリーン

ソリューションに含まれるその他のサンプルビュー

アンチウイルス

アンチウイルス

アンチウイルス

アプリケーション

ビットロッカー

ビットロッカー

ブルースクリーン

コンピュータ情報

コンピュータ情報

コンピュータ情報

コンピュータ情報

Defender

Office

提供されるAzure Workbooksの完全なリストを見るためのリンク

サンプルのAzureダッシュボードはすべて、Azure Workbooksからピン留めされた部分に基づいて作成されています。そのため、ドリルダウンしたい場合は、リンクをクリックすると詳細情報にアクセスできます。

ダッシュボード

提供されるAzureダッシュボードを見るためのリンク

自分でワークブックやダッシュボードを作成できますか? - はい、できます 😄

ダッシュボードやワークブックを追加したい場合は、通常、KQLクエリを使用してカスタムログテーブルの収集データを調査することから始めます。目的のクエリが見つかったら、ワークブックに新しいビューを作成し、お気に入りをダッシュボードにピン留めできます。


データをクエリするには? - Kusto (KQL) が答えです

Kusto言語を知らない場合は、実際に触ってみることをお勧めします。非常に強力な言語です。

動画 1分58秒 - データに対するKustoクエリ
動画 3分01秒 - ダッシュボード

Kusto Query Languageを使って最初のクエリを書く

KQLを使用してクエリ結果を分析する

以下は、ClientInspectorのデータに基づいた、始めるための4つのサンプルクエリです。

サンプルクエリ1: Kusto (KQL) クエリを使用した高度なハンティング

高度なハンティングを行いたい場合は、テーブル内で従来のKusto (KQL) クエリを使用できます。

サンプルクエリ ```js InvClientDefenderAvV2_CL | where TimeGenerated > ago(31d) | summarize CollectionTime = arg_max(CollectionTime, *) by Computer | where ((AMRunningMode == "Not running") or (parse_version(AMProductVersion) < parse_version("4.18.2203")) or (MPComputerStatusFound == false) or (MPPreferenceFound == false) or (RealTimeProtectionEnabled == false) or (AntivirusSignatureAge > 7) or (AntispywareSignatureAge > 7) or (NISSignatureAge > 7) or (AMRunningMode == "EDR Block Mode") or (AMRunningMode == "Passive Mode") or (AntispywareEnabled == false) or ((TamperProtectionSource != "ATP") and (TamperProtectionSource != "Intune")) or (IsTamperProtected == false) ) | project Computer, UserLoggedOn, CollectionTime, MPComputerStatusFound, MPPreferenceFound, AMEngineVersion, AMProductVersion, AMRunningMode, AMServiceEnabled, AMServiceVersion, AntispywareEnabled, AntispywareSignatureAge, AntispywareSignatureLastUpdated, AntispywareSignatureVersion, AntivirusEnabled, AntivirusSignatureAge, AntivirusSignatureLastUpdated, AntivirusSignatureVersion, BehaviorMonitorEnabled, DefenderSignaturesOutOfDate, DisableAutoExclusions, DisableBehaviorMonitoring, DisableRealtimeMonitoring, DisableScanningMappedNetworkDrivesForFullScan, DisableScanningNetworkFiles, DisableScriptScanning, EnableControlledFolderAccess, EnableNetworkProtection, FullScanAge, IoavProtectionEnabled, IsTamperProtected, IsVirtualMachine, MAPSReporting, NISEnabled, NISEngineVersion, NISSignatureAge, NISSignatureLastUpdated, NISSignatureVersion, OnAccessProtectionEnabled, ProductStatus, PUAProtection, QuickScanAge, RealTimeProtectionEnabled, RealTimeScanDirection, RebootRequired, ScanAvgCPULoadFactor, SignatureUpdateCatchupInterval, SignatureUpdateInterval, SubmitSamplesConsent, TamperProtectionSource ```

サンプルクエリ2: Kustoクエリで3つのテーブルからデータをマージする

サンプルクエリ ```js InvClientComputerInfoBiosV2_CL | summarize TimeGenerated = arg_max(TimeGenerated,*) by Computer | join (InvClientComputerInfoSystemV2_CL | summarize TimeGenerated = arg_max(TimeGenerated,*) by Computer) on $left.Computer == $right.Computer | join (InvClientComputerOSInfoV2_CL | summarize TimeGenerated = arg_max(TimeGenerated,*) by Computer) on $left.Computer == $right.Computer | project Computer, UserLoggedOn, SerialNumber, Manufacturer, PCSystemType, SystemFamily, Model, Windows=Caption2, WindowsVersion=Version1, TimeGenerated ```

サンプルクエリ3: PowershellからLogAnalyticsデータをクエリする

サンプルクエリ ```js Connect-AzAccount

#----------------------------------------------------------------------------------------------------------------------

Variables

#----------------------------------------------------------------------------------------------------------------------

$LogAnalyticsWorkspaceId = "e74ca75a-c0e6-4933-a4f7-e5ae943fe4ac"

#----------------------------------------------------------------------------------------------------------------------

Collecting Computer data from Azure LogAnalytics

#---------------------------------------------------------------------------------------------------------------------- $Query = @' InvClientComputerInfoBiosV2_CL | summarize TimeGenerated = arg_max(TimeGenerated,) by Computer | join (InvClientComputerInfoSystemV2_CL | summarize TimeGenerated = arg_max(TimeGenerated,) by Computer) on $left.Computer == $right.Computer | join (InvClientComputerOSInfoV2_CL | summarize TimeGenerated = arg_max(TimeGenerated,*) by Computer) on $left.Computer == $right.Computer | project Computer, UserLoggedOn, SerialNumber, Manufacturer, PCSystemType, SystemFamily, Model, Windows=Caption2, WindowsVersion=Version1, TimeGenerated '@

write-output "Collecting computer information from LogAnalytics" $Query = Invoke-AzOperationalInsightsQuery -WorkspaceId $LogAnalyticsWorkspaceId -Query $Query $ComputerInfoArray = $Query.Results $ComputerInfoArray

root@kitploit:~
</details>

## サンプルクエリ 4: データを他のソースと統合する(Lenovo保証データベースに対する保証確認)

データをAzure LogAnalyticsに取り込んだら、DellやLenovoの保証データなどの他のソースと、REST APIルックアップを介して統合を開始できます。

[動画 0分48秒 - データの使用例 - Lenovo保証データベースに対するルックアップ](https://youtu.be/3ZDyTwiLU0w)  

以下は、PowerShellスクリプトによって自動生成された出力の例です。コンピューターとシリアル番号のリストを抽出し、Lenovo保証データベースをルックアップして、コンピューターの購入日と保証状態に関する情報を取得しています。

[サンプル保証出力(Excel)、ClientInspectorが収集したデータに基づく](https://github.com/KnudsenMorten/ClientInspectorV2/raw/main/img/WarrantyInfo.xlsx)

<br>
   
# アーキテクチャ、スキーマ、ネットワーキング
ClientInspector(v2)は、収集したデータを **Log Ingestion API**、**Azure Data Collection Rules (DCR)**、**Azure Data Collection Endpoints (DCE)** を使用して、**Azure LogAnalytics ワークスペース**内の **カスタムログ** にアップロードします。

![アーキテクチャ](https://assets.kitploit.com/production/public/readmes/6097/a1f4330c4e3747c2ebe092927df32352c2c158028f239afb7617e608aa882966.png)

## スキーマ
DCRとLogAnalyticsテーブルの両方にスキーマがあり、ソースオブジェクトのスキーマと一致する必要があります。これは、AzLogDcrIngestPSモジュールの関数を使用して処理されます。

[動画 1分40秒 - 2つのテーブルとDCRの自動作成(詳細モード)](https://youtu.be/rIUNs3yT-eI)  
[動画 1分37秒 - 2つのテーブルとDCRの自動作成(通常モード)](https://youtu.be/khQMDcON6r8)  
[動画 1分34秒 - DCRとテーブルのスキーマを確認](https://youtu.be/NDSNhvpa4Gs)  

AzLogDcrIngestPSはスキーマ管理のために2つのモードをサポートしています:**Merge** と **Overwrite**

### SchemaMode = Merge(デフォルト)
SchemaMode = Merge に設定すると、ソースオブジェクトの新しいプロパティがログ分析の現在のスキーマに追加(マージ)されます。DCRはログ分析テーブルからスキーマをインポートして、それらが同一であることを保証します。

デフォルトモードはMergeです。関数で変数SchemaModeを定義しない場合:
CheckCreateUpdate-TableDr-Structure
CreateUpdate-AzLogAnalyticsCustomLogTableDcr
CreateUpdate-AzDataCollectionRuleLogIngestCustomLog

### SchemaMode = Overwrite
SchemaMode = Overwrite に設定すると、DCRとテーブルのスキーマが、ソースオブジェクトのスキーマに基づいて上書き(更新)されます。

## ネットワーキング
データアップロードのためにAzureに接続する方法は3つあります:

|アップロード方法|接続の詳細|OS準拠|
|:------------|:-------------------|:------------|
|パブリックアクセス|RESTエンドポイントがDCEのパブリックIP経由でDCEに送信|エンドポイントはTLS 1.2をサポート|
|プライベートアクセス|RESTエンドポイントがDCEのプライベートリンク経由でDCEに送信|エンドポイントはTLS 1.2をサポート|
|ログハブ|RESTエンドポイントが[log-hub](https://github.com/KnudsenMorten/AzLogDcrIngestPSLogHub) を介してデータを送信 - 私が構築したコンセプト|エンドポイントはTLS 1.2をサポートしていない。<br> Azureはこれらのデバイスからの直接接続を受け入れない|

### インターネット接続エンドポイント - OSレベルの準拠
![インターネット接続エンドポイント - OSレベルの準拠](https://assets.kitploit.com/production/public/readmes/6097/3cc67f07297302ff59d08c95a790ec8ad417f8dbd07f566a24b154eecfecb8bb.png)

ファイアウォールで以下のエンドポイントを許可する必要があります:
|エンドポイント|目的|ポート|方向|HTTPSインスペクションをバイパス|
|:-------|:------|:----|:-------|:----------------------|
|global.handler.control.monitor.azure.com|アクセス制御サービス|ポート443|送信|はい|
|dce logs ingestion uri<br><br>サンプル<br>https://dce-log-platform-management-client-demo-p-iur0.westeurope-1.ingest.monitor.azure.com|ログデータの取り込み|ポート443|送信|はい|

<br>

### インターネットアクセスがない、またはOSレベルの非準拠(例:TLS 1.0/1.1実行時)
[こちらのリンクからログハブのコンセプトを確認してください](https://github.com/KnudsenMorten/AzLogDcrIngestPSLogHub)

![インターネットアクセスがない、またはOSレベルの非準拠(例:TLS 1.0/1.1実行時)](https://assets.kitploit.com/production/public/readmes/6097/42435b25d7c2cc8d405e62d577420fa980aef5f9267f461c56ce9a08f7f81917.png)

<br>

# 実装
すべてを立ち上げて実行するのは非常に簡単であると感じていただけることを願っています。以下の3つの手順が概要です。

始める前に、以下のイントロでコンポーネントについて詳しく読むことをお勧めします。

<details>
  <summary>ClientInspectorの一部として使用されるAzureコンポーネントの紹介</summary>

<br>

以下のコンポーネントが必要です:

| Azureリソース                | 目的                                           | 詳細情報 |
| :-------------                | :-----                                            | :-----           |
| 任意のRESTエンドポイント             | データを送信するソース                   |                  |
| Log Ingestion API             | 古いHTTP Data Collector APIを置き換える新しいAPI | https://learn.microsoft.com/ja-jp/azure/azure-monitor/logs/logs-ingestion-api-overview |
| Data Collection Endpoint (DCE)| エンドポイントからの通信のエントリポイント。データは **Azure Data Collection Endpoint Ingestion Uri** に送信されます。単一のDCEで複数のDCRをサポートできるため、異なるソースとターゲットテーブルに異なるDCRを指定できます。 | https://learn.microsoft.com/ja-jp/azure/azure-monitor/essentials/data-collection-endpoint-overview?tabs=portal |
| Data Collection Rules (DCR)   | データ収集ルールは、収集するデータ(スキーマ)を定義し、そのデータをどこに送信または保存するかを指定します。DCRは入力データの構造とターゲットテーブルの構造を理解する必要があります。両者が一致しない場合、変換を使用してソースデータをターゲットテーブルに適合させることができます。変換を使用してソースデータをフィルタリングしたり、その他の計算や変換を実行したりすることもできます。 | https://learn.microsoft.com/ja-jp/azure/azure-monitor/essentials/data-collection-rule-overview | 
| Azure LogAnaltyics ワークスペース  | データはAzure LogAnalyticsのカスタムログに送信されます  | https://learn.microsoft.com/ja-jp/azure/azure-monitor/logs/log-analytics-overview |
| Azure Workbooks               | デプロイの一環として、サンプルワークブックがデプロイされます  | https://learn.microsoft.com/ja-jp/azure/azure-monitor/visualize/workbooks-overview |
| Azure Dashboards              | デプロイの一環として、サンプルワークブックがデプロイされます  | https://learn.microsoft.com/ja-jp/azure/azure-monitor/visualize/tutorial-logs-dashboards |
| Kusto (KQL)                   | Kusto (KQL) クエリを使用してデータを分析できます | https://learn.microsoft.com/ja-jp/azure/azure-monitor/logs/get-started-queries |

</details>

環境にClientInspectorをセットアップする手順は次のとおりです:
1. [ClientInSpectorV2-DeploymentKitを使用して環境をセットアップする](https://github.com/KnudsenMorten/ClientInspectorV2-DeploymentKit)

2. ClientInspectorを初めて実行する(初期セットアップ) - 詳細は以下を参照
<details>
  <summary>Azure LogAnalyticsテーブルとData Collection Rulesの初期セットアップを構成する方法(初回)</summary>

<br>
テーブル/DCR管理用の参照コンピュータを用意することをお勧めします。これにより、変更が必要な場合(たとえば、ソースオブジェクトスキーマが変更された場合など)、管理されたプロセスになります。

<br>
<br>
構成:

1. DeploymentKitを実行すると、ClientInspectorファイルが自動的に準備されるため、変数を挿入するだけで済みます。```js
$TenantId                                   = "xxxx" 
$LogIngestAppId                             = "xxxx" 
$LogIngestAppSecret                         = "xxxx" 

$DceName                                    = "xxxx" 
$LogAnalyticsWorkspaceResourceId            = "xxxx"

$AzDcrPrefixClient                          = "xxx" 
$AzDcrSetLogIngestApiAppPermissionsDcrLevel = $false
$AzDcrLogIngestServicePrincipalObjectId     = "xxx" 
$AzDcrDceTableCreateFromReferenceMachine    = @()
$AzDcrDceTableCreateFromAnyMachine          = $true
  1. デプロイジョブを設定して、ClientInspectorを毎日実行し、インベントリを収集します。お好みの展開ツールを使ってClientInspectorスクリプトを実行できます。Microsoft IntuneおよびConfigMgr用のスクリプトが用意されています。
Microsoft Intuneを使用して展開するには?
Microsoft Intuneの「プロアクティブ修復」を使用して、インベントリスクリプトを実行します。
  1. 検出スクリプト ClientInspector_Detection.ps1 をダウンロード します(右クリックして「リンク先を保存」を選択)。

  2. お好みのエディタでファイルを開きます。インベントリを実行する頻度を調整します。```js ##################################

VARIABLES

##################################

root@kitploit:~
$RunEveryHours    = 8
$LastRun_RegPath  = "HKLM:\SOFTWARE\ClientInspector"
$LastRun_RegKey   = "ClientInSpector_System"
root@kitploit:~
3. 次に、修復ジョブを作成する必要があります。Microsoft Intune ポータル -> Reports -> Endpoint Analysis --> Proactive remediations に移動し、以下のようにスクリプトパッケージを作成します。

注: 修復スクリプトには、**ClientInspector.ps1** ファイルを使用します。

![Flow](https://assets.kitploit.com/production/public/readmes/6097/c5d24f8afca4130a3a58414028120540526722b92ed5c9ae6cb029c605baf657.png)

![Flow](https://assets.kitploit.com/production/public/readmes/6097/ea200a01c92a84d801e03439891428130160b4dd8bbb11e6ecac4b2f68de18d1.png)


### Intune の制限

注: Intune には、修復スクリプトのサイズが 200 Kb に制限されています。**  

![Intune-error](https://assets.kitploit.com/production/public/readmes/6097/7488505e7c4a5e3fa31e1007bf435b89aeb5ebf4fb1c1dbf133835082cce33e6.png)


この制限に達した場合は、スクリプトを 2 つに分割することを提案します。

![Intune-split](https://assets.kitploit.com/production/public/readmes/6097/3ddc7edb1bdf2a492928a0dad8487996a9166878fba20a0403d347a895fe69a3.png)

![Intune-split](https://assets.kitploit.com/production/public/readmes/6097/36f29366fa4fbf0f878a569489c59100601f5a27f8d015373497b9fd387309ec.png)

2 つ目のファイルのヘッダーとして、UserLoggedOn セクションを含むヘッダーセクションを忘れずに含めてください。UserLoggedOn は、ログオンしているユーザーを表示するために使用されます。

サンプルスクリプトセットアップを用意しました。[sample script-setup](https://github.com/KnudsenMorten/ClientInspectorV2/tree/main/Sample%20intune%20setup%20if%20file%20size%20is%20more%20than%20200%20Kb)。これで分割方法を確認できます。注: これらのスクリプトのコードは更新されていないため、マスターの ClientInspector ファイルからセクションを取るようにしてください。

基本的な構造は次のとおりです。

ファイル 1 には、ヘッダー + UserLoggedOn (セクション 1) + セクション 2-9 が含まれ、HKLM\Software\ClientInspector\ClientInspector_System_1 にチェックフラグを書き込みます。

ファイル 2 には、ヘッダー + UserLoggedOn (セクション 1) + セクション 10-18 が含まれ、HKLM\Software\ClientInspector\ClientInspector_System_2 にチェックフラグを書き込みます。


![Flow](https://assets.kitploit.com/production/public/readmes/6097/37639a721b2d45fae907e177c6cb90ea32151f1ab8bdb1262e8e2bed0f8ec354.png)

![Flow](https://assets.kitploit.com/production/public/readmes/6097/96d02fdeaf59594c29e9755b0033557a3594e33b6bf61b92fa38edebd4c5b84d.png)

![Flow](https://assets.kitploit.com/production/public/readmes/6097/070c7a1431ad3899d496cc333224c8ff58b35d523ba7c77e11ba151501039d73.png)


</details>


<details>
  <summary>ConfigMgr (または CMD ファイルを実行するその他のツール) を使用してデプロイする方法は?</summary>
  
<br>
従来のパッケージとデプロイメントを使用してインベントリスクリプトを実行します。
    
1. [CMD ファイル ClientInspector.cmd をダウンロード](https://github.com/KnudsenMorten/ClientInspectorV2/raw/main/ConfigMgr/ClientInspector.cmd) (右クリックして 'リンク先を保存' を選択)

2. ConfigMgr パッケージソースディレクトリに (例: ClientInspector という名前で) ソース構造を作成します。

3. 必要な 2 つのファイル **ClientInspector.cmd** と **ClientInspector.ps1** をディレクトリにコピーします。

4. パッケージを作成し、パッケージが **ClientInspector.cmd** を実行するように指定します。

5. デプロイメントを作成します。

</details>

<br>

# 依存関係

## Powershell モジュール AzLogDcringestPS - 私 (Morten Knudsen) が作成

ClientInspector には Powershell モジュール **AzLogDcrIngestPS** が必要です。

Powershell モジュール **AzLogDcrIngestPS** の主な機能は次のとおりです。
* ソースオブジェクトのスキーマに基づいて DCR とテーブルを自動的に作成/更新
* スキーマの命名規則に関する問題を検証します。問題が見つかった場合は、それを軽減します。
* ソースオブジェクトの構造が変更された場合、DCR とテーブルのスキーマを更新
* DCR またはテーブルに問題が発生した場合の自動修正
* 送信したくないデータ列がある場合、ソースオブジェクトからデータを削除可能
* CIM または PS オブジェクトに基づくソースオブジェクトを PSCustomObjects/配列に変換可能
* UserLoggedOn、Computer、CollectionTime などの関連情報を各レコードに追加可能

以下のリンクを使用して、モジュールの詳細情報を確認できます。

[AzLogDcrIngestPS (Github)](https://github.com/KnudsenMorten/AzLogDcrIngestPS)

[AzLogDcrIngestPS (Powershell Gallery)](https://www.powershellgallery.com/packages/AzLogDcrIngestPS)

[AzLogDcrIngestPSLogHub (Github)](https://github.com/KnudsenMorten/AzLogDcrIngestPSLogHub)

<br>

## サードパーティの Powershell モジュール
Windows Update 情報の取得には、よく知られた Powershell モジュール PSWindowsUpdate を使用することを好みます。

|モジュール名|目的|詳細情報|クレジット|
|:---------|:------|:--------|:-----|
|NuGet|多くの Powershell モジュール (AzLogDcrIngestPS を含む) をデプロイするために使用される共通パッケージプロバイダー<br><br>スクリプト実行時にパッケージプロバイダーが自動的にコンピューターにインストールされます|[Link](https://www.nuget.org/packages)|
|PSWindowsUpdate|Windows Update 情報の収集 (保留中の更新、インストール済み更新など)<br><br>スクリプト実行時にモジュールが自動的にコンピューターにインストールされます|[Link](https://www.powershellgallery.com/packages/PSWindowsUpdate)|Michal Gajda

<br>

# Running ClientInspector.ps1 - 3 つのモード
ClientInspector は、必要な Powershell モジュールをインストール/更新/インポートする 3 つの方法をサポートしています: **Download**、**PsGallery**、**LocalPath**

デフォルトでは、PsGallery から最新バージョンをダウンロードし、CurrentUser スコープにインストールします。

[Video 3m 19s - Running ClientInspector using commandline (normal mode)](https://youtu.be/4kA4BE0zJ9g)  

## .\ClientInspector.ps1 -function:LocalPath
ClientInspector は、スクリプトが実行されるディレクトリで **AzLogDcrIngest.psm1** ファイルを探します。AzLogDcrIngest.psm1 が見つからない場合はスクリプトが終了します。それ以外の場合は、Import-Module を実行します。

例```
.\ClientInspector.ps1 -verbose:$false -function:localpath

ClientInspector | Inventory of Operational & Security-related information
Developed by Morten Knudsen, Microsoft MVP - for free community use

Using AzLogDcrIngestPS module from local path D:\scripts\ClientInspectorV2
ツールをダウンロード

Validating/fixing schema data structure of source data

$DataVariable = ValidateFix-AzLogAnalyticsTableSchemaColumnNames -Data $DataVariable -Verbose:$Verbose

Aligning data structure with schema (requirement for DCR)

$DataVariable = Build-DataArrayToAlignWithSchema -Data $DataVariable -Verbose:$Verbose

root@kitploit:~
このコマンドを実行して、ソースオブジェクトを確認できます。````
# Get insight about the schema structure of an object BEFORE changes. Command is only needed to verify columns in schema
Get-ObjectSchemaAsArray -Data $DataVariable -Verbose:$Verbose

Office

Office

Office

Windows Update

Windows Update

Windows Update

Windows ファイアウォール

  1. Start Powershellをローカル管理者として起動する

  2. このコマンドを使用してスクリプトを起動する```js C:\ClientInspector\ClientInspector.ps1 -verbose:$true

root@kitploit:~
4. ClientInspectorは10〜20分間実行され、環境内の実際の構造に基づいて、必要なテーブルとデータ収集ルールを作成します。画面上の結果を確認し、エラー(赤色)がないか確認してください。

5. すべてが問題なさそうであれば、スクリプトを再実行すると、はるかに速く処理が進みます。Kustoクエリを使用して、各テーブルにデータが取り込まれていることを確認してください。注:バックエンドでパイプラインを作成する必要があるため、最初のデータアップロードには約10〜15分かかる場合があります。

6. 最後の変更として、パラメータ内の2つのパラメータを変更して、リファレンスマシンから実行する場合にのみClientInspectorがスキーマ変更を行うように指示する必要があります。```js
$AzLogDcrTableCreateFromReferenceMachine    = @("<<MyReferenceMachineComputerName>>")   # sample @("ComputerName")
$AzLogDcrTableCreateFromAnyMachine          = $false    # important so changes can only happen on reference machine
  1. これでテストグループへの展開準備が整いました。

.\ClientInspector.ps1 -function:Download

ClientInspector は、Github リポジトリから最新バージョンをダウンロードし、実行のたびにローカルパスに保存します(約 300 KB)

例``` .\ClientInspector.ps1 -verbose:$false -function:download

ClientInspector | Inventory of Operational & Security-related information Developed by Morten Knudsen, Microsoft MVP - for free community use

Downloading latest version of module AzLogDcrIngestPS from https://github.com/KnudsenMorten/CientInspectorV2 into local path D:\scripts\ClientInspectorV2

root@kitploit:~
## .\ClientInspector.ps1 -function:PsGallery -scope [AllUsers|CurrentUser]
このパラメータには別のパラメータが必要です: -scope [AllUsers | CurrentUser]

ClientInspectorは、選択されたスコープにモジュールがインストールされているか確認します。
インストールされていない場合、Powershell Galleryから最新バージョンを自動的にダウンロードし、import-moduleを実行します。
クライアントが最新バージョンを実行している場合は、そのまま続行します。

例```
.\ClientInspector.ps1 -verbose:$false -function:PSGallery -scope:CurrentUser

ClientInspector | Inventory of Operational & Security-related information
Developed by Morten Knudsen, Microsoft MVP - for free community use

Powershell module was not found !
Installing in scope currentuser .... Please Wait !

チャンク固有のルール:

  1. 自然言語のテキストのみを翻訳してください。コードブロック、シェルコマンド、ファイルパス、URL、パッケージ名、技術的識別子、CVE ID、環境変数名は絶対に翻訳しないでください。
  2. すべてのMarkdown構文をそのまま完全に保持してください。
  3. "## Chunk N", "## Part N", "## Continued from...", "## Translation of chunk..." などの見出しを追加しないでください。"End of chunk N" や "Content continues..." のマーカーを追加しないでください。
  4. 省略を示す "..." の省略記号を追加しないでください。提供されたテキストのみを、構造を一文字一文字保って翻訳してください。
  5. チャンクの境界は意図的です。チャンクが視覚的なアーティファクトなくシームレスに連結できるように構造を保持してください。
  6. 翻訳されたテキストのみを返してください。前置き、コメント、コードブロックでのラップ、JSON/YAML/XML、配列、オブジェクト、スキーマ、キー/バリューラッパーは一切含めないでください。
  7. チャンクが段落の途中から始まる場合は、その時点から翻訳を続けてください。ソースに存在しない限り、先頭に改行やインデントを追加しないでください。``` .\ClientInspector.ps1 -verbose:$false -function:PsGallery -scope:currentuser

ClientInspector | Inventory of Operational & Security-related information Developed by Morten Knudsen, Microsoft MVP - for free community use

Checking latest version at PsGallery for AzLogDcrIngestPS module OK - Running latest version

root@kitploit:~
</details>

<br>

## ClientInspectorのサンプル出力
[ビデオ 3分19秒 - コマンドラインを使用したClientInspectorの実行(通常モード)](https://youtu.be/4kA4BE0zJ9g)  


<br>

# セキュリティ
## コード署名
**ClientInspector.ps1ファイル**と**AzLogDcrIngestPSモジュール(AzLogDcrIngest.psm1)** は、私のコード署名証明書(2LINKIT - 自社)で署名されています。これにより、スクリプトに署名が必要な場合でも実行できます。もちろん、独自の内部コード署名証明書を使用して署名することもできます。

![Signed](https://assets.kitploit.com/production/public/readmes/6097/95ae9fae064341feae5467ba04c909e3bab84393eb7070a304d9d9e6fd184499.png)

公開鍵証明書を[ダウンロード](https://github.com/KnudsenMorten/ClientInspectorV2/raw/main/Trusted_Publisher_Certificate/2LINKIT-TrustedPublisher.cer)し、'信頼された発行元'コンテナに配置して発行元(2LINKIT - 自社)を信頼してください。これはIntuneまたはグループポリシーを使用して展開できます。

![Trusted Publisher](https://assets.kitploit.com/production/public/readmes/6097/b02285397783a3495f5d1418ed716fa450b677117dd1754875354779568b0b47.png)  
![Trusted Publisher](https://assets.kitploit.com/production/public/readmes/6097/740ae59eff117b8e59d56a7274440a991b7c5ceddd486894160d0248826084b2.png)  
![Trusted Publisher](https://assets.kitploit.com/production/public/readmes/6097/47d1eb6b7da9ff5a341b8486c7b4bc7532b0b8ef3d05e7b710d495e183929279.png)  


### Intune展開では信頼された発行元は不要
デフォルトでは、Intuneは修復スクリプトを実行する際にBYPASSを行います。

## 構造
**ClientInspector**のセキュリティは4つのレイヤーに分かれています:**データ入力**、**データアップロード**(バックエンドへの送信)、**データ表示**(ダッシュボード)、および**スキーマ管理**です。

| フェーズ | セキュリティ実装 | 委任 / アクセス許可 |
|:------|:------------------------|:------------------------|
|データ入力(収集)|このフェーズは、実際の収集に使用する方法(Intune、ConfigMg、その他のサードパーティ)によって制御されます|スクリプトは、ハードウェアとWindowsからコアデータを収集するために、ローカル管理者(システムコンテキスト)として実行する必要があります|
|データアップロード|Logs Ingestion APIの認証はDCEで行われ、標準のAzure Resource Manager認証を使用します。<br><br>一般的な戦略は、アプリケーションIDとアプリケーションキーを使用することです。これはClientInspectorでも使用されている方法です。<br><br>Azure AppIdとSecretは、簡素化のためにClientInspectorのヘッダーに保存されます。<br><br>AppIdとSecretを保存するためにAzure Keyvaultを使用することも可能です|[詳細はClientInspectV2-DeploymentKitで説明](https://github.com/KnudsenMorten/ClientInspectorV2-DeploymentKit#security-1)|
|データ表示|Azure RCACアクセス許可|Azure LogAnalytics、Azure Workbooks、Azure Dashboardsへのアクセスを許可します|
|スキーマ管理|方法1: Azure RBAC(推奨)<br><br>方法2: シークレットまたは証明書を使用したAzureアプリ|[詳細はClientInSpectorV2-DeploymentKitで説明](https://github.com/KnudsenMorten/ClientInspectorV2-DeploymentKit#azure-rbac-security-adjustment-separation-of-permissions-between-log-ingestion-and-tabledcr-management)|

<br>

# ClientInspectorデータセットのレイアウト
各データセット(bios、applications、bitlockerなど)は、同じ4フェーズ構造で構築されています。

## フェーズ1/4 - 変数(命名 - データの送信先)```
#-------------------------------------------------------------------------------------------
# Variables
#-------------------------------------------------------------------------------------------
	
$TableName  = 'InvClientComputerInfoSystemV2'   # must not contain _CL
$DcrName    = "dcr-" + $AzDcrPrefixClient + "-" + $TableName + "_CL"

Phase 2/4 - データ収集```

#-------------------------------------------------------------------------------------------

Collecting data (in)

#-------------------------------------------------------------------------------------------

Write-Output "" Write-Output "Collecting Computer system information ... Please Wait !"

$DataVariable = Get-CimInstance -ClassName Win32_ComputerSystem

root@kitploit:~
## フェーズ 3/4 - データ操作 (データが正しい形式であることを確認し、"ノイズ"を除去し、関連情報を追加する)```
#-------------------------------------------------------------------------------------------
# Preparing data structure
#-------------------------------------------------------------------------------------------

# convert CIM array to PSCustomObject and remove CIM class information
$DataVariable = Convert-CimArrayToObjectFixStructure -data $DataVariable -Verbose:$Verbose

# add CollectionTime to existing array
$DataVariable = Add-CollectionTimeToAllEntriesInArray -Data $DataVariable -Verbose:$Verbose

# add Computer & UserLoggedOn info to existing array
$DataVariable = Add-ColumnDataToAllEntriesInArray -Data $DataVariable -Column1Name Computer -Column1Data $Env:ComputerName  -Column2Name UserLoggedOn -Column2Data $UserLoggedOn

# Validating/fixing schema data structure of source data
$DataVariable = ValidateFix-AzLogAnalyticsTableSchemaColumnNames -Data $DataVariable -Verbose:$Verbose

# Aligning data structure with schema (requirement for DCR)
$DataVariable = Build-DataArrayToAlignWithSchema -Data $DataVariable -Verbose:$Verbose

フェーズ 4/4 - データ出力 (LogAnalyticsに送信) - 統合関数```

#-------------------------------------------------------------------------------------------

Create/Update Schema for LogAnalytics Table & Data Collection Rule schema

#-------------------------------------------------------------------------------------------

CheckCreateUpdate-TableDcr-Structure -AzLogWorkspaceResourceId $LogAnalyticsWorkspaceResourceId -SchemaMode Merge -AzAppId $LogIngestAppId -AzAppSecret $LogIngestAppSecret -TenantId $TenantId -Verbose:$Verbose -DceName $DceName -DcrName $DcrName -TableName $TableName -Data $DataVariable -LogIngestServicePricipleObjectId $AzDcrLogIngestServicePrincipalObjectId -AzDcrSetLogIngestApiAppPermissionsDcrLevel $AzDcrSetLogIngestApiAppPermissionsDcrLevel -AzLogDcrTableCreateFromAnyMachine $AzLogDcrTableCreateFromAnyMachine -AzLogDcrTableCreateFromReferenceMachine $AzLogDcrTableCreateFromReferenceMachine

#-----------------------------------------------------------------------------------------------

Upload data to LogAnalytics using DCR / DCE / Log Ingestion API

#-----------------------------------------------------------------------------------------------

Post-AzLogAnalyticsLogIngestCustomLogDcrDce-Output -DceName $DceName -DcrName $DcrName -Data $DataVariable -TableName $TableName ` -AzAppId $LogIngestAppId -AzAppSecret $LogIngestAppSecret -TenantId $TenantId -Verbose:$Verbose

root@kitploit:~
<br>

**ヒント: エラー513 - エンティティが大きすぎます**  
デフォルトでは、ClientInspectorはレコードごとの計算された平均サイズに基づいてデータをバッチで送信します。レコードセットのサイズが異なる場合、エラー513が発生する可能性があります。

原因は、各アップロードの1MB制限(Azure Pipelineの制限)に達していることです。Microsoftは共有環境であるため、より小さなデータチャンクを多数受信することを望んでいます。インストールされているすべてのアプリケーションのリストを取得する際にこの問題を確認しました。どうやらアプリケーションは非常に異なるサイズの情報を保存しているようです。

この問題を軽減するには、Postコマンドにパラメータ **-BatchAmount <1バッチあたりに送信するレコード数>** を追加します。確実にするには、1に設定してください。```
Post-AzLogAnalyticsLogIngestCustomLogDcrDce-Output -DceName $DceName `
                                                   -DcrName $DcrName `
                                                   -Data $DataVariable `
                                                   -TableName $TableName `
                                                   -AzAppId $LogIngestAppId `
                                                   -AzAppSecret $LogIngestAppSecret `
                                                   -TenantId $TenantId `
                                                   -BatchAmount 1 `
                                                   -Verbose:$Verbose `
												   

フェーズ4/4 "under the hood" - データ出力(LogAnalyticsに送信)```

#-----------------------------------------------------------------------------------------------

Check if table and DCR exist - or schema must be updated due to source object schema changes

#-----------------------------------------------------------------------------------------------

Get insight about the schema structure

$Schema = Get-ObjectSchemaAsArray -Data $Data $StructureCheck = Get-AzLogAnalyticsTableAzDataCollectionRuleStatus -AzLogWorkspaceResourceId $AzLogWorkspaceResourceId -TableName $TableName -DcrName $DcrName -SchemaSourceObject $Schema -SchemaMode $SchemaMode -AzAppId $AzAppId -AzAppSecret $AzAppSecret -TenantId $TenantId ` -Verbose:$Verbose

#-----------------------------------------------------------------------------------------------

Structure check = $true -> Create/update table & DCR with necessary schema

#-----------------------------------------------------------------------------------------------

build schema to be used for LogAnalytics Table

$Schema = Get-ObjectSchemaAsHash -Data $Data -ReturnType Table -Verbose:$Verbose

CreateUpdate-AzLogAnalyticsCustomLogTableDcr -AzLogWorkspaceResourceId $AzLogWorkspaceResourceId -SchemaSourceObject $Schema -SchemaMode $SchemaMode -TableName $TableName -AzAppId $AzAppId -AzAppSecret $AzAppSecret -TenantId $TenantId -Verbose:$Verbose

build schema to be used for DCR

$Schema = Get-ObjectSchemaAsHash -Data $Data -ReturnType DCR

CreateUpdate-AzDataCollectionRuleLogIngestCustomLog -AzLogWorkspaceResourceId $AzLogWorkspaceResourceId -SchemaSourceObject $Schema -SchemaMode $SchemaMode -DceName $DceName -DcrName $DcrName -TableName $TableName -LogIngestServicePricipleObjectId $LogIngestServicePricipleObjectId -AzDcrSetLogIngestApiAppPermissionsDcrLevel $AzDcrSetLogIngestApiAppPermissionsDcrLevel -AzAppId $AzAppId -AzAppSecret $AzAppSecret -TenantId $TenantId -Verbose:$Verbose

$AzDcrDceDetails = Get-AzDcrDceDetails -DcrName $DcrName -DceName $DceName -AzAppId $AzAppId -AzAppSecret $AzAppSecret -TenantId $TenantId ` -Verbose:$Verbose

Post-AzLogAnalyticsLogIngestCustomLogDcrDce -DceUri $AzDcrDceDetails[2] -DcrImmutableId $AzDcrDceDetails[6] -TableName $TableName -DcrStream $AzDcrDceDetails[7] -Data $Data -BatchAmount $BatchAmount -AzAppId $AzAppId -AzAppSecret $AzAppSecret -TenantId $TenantId ` -Verbose:$Verbose

root@kitploit:~
<br>

# 詳細モード & その他のヘルプ
何が起こっているかについてより詳細な情報を得たい場合は、詳細モード(-verbose:$true)を有効にできます。```
.\ClientInspector.ps1 -verbose:$true -function:localpath

Powershell ISEを使用してテストしたい場合は、変数$Verboseを使用してverboseモードを有効にすることもできます。``` $Verbose = $false # can be $true or $false

root@kitploit:~
AzLogDcrLogIngestPSモジュールの構文や例についてヘルプを表示したい場合は、get-moduleと入力してください。```
PS  get-command -module AzLogDcrIngestPS

CommandType     Name                                               Version    Source                                                                         
-----------     ----                                               -------    ------                                                                         
Function        Add-CollectionTimeToAllEntriesInArray              1.1.17     AzLogDcrIngestPS                                                               
Function        Add-ColumnDataToAllEntriesInArray                  1.1.17     AzLogDcrIngestPS                                                               
Function        Build-DataArrayToAlignWithSchema                   1.1.17     AzLogDcrIngestPS                                                               
Function        CheckCreateUpdate-TableDcr-Structure               1.1.17     AzLogDcrIngestPS                                                               
Function        Convert-CimArrayToObjectFixStructure               1.1.17     AzLogDcrIngestPS                                                               
Function        Convert-PSArrayToObjectFixStructure                1.1.17     AzLogDcrIngestPS                                                               
Function        CreateUpdate-AzDataCollectionRuleLogIngestCusto... 1.1.17     AzLogDcrIngestPS                                                               
Function        CreateUpdate-AzLogAnalyticsCustomLogTableDcr       1.1.17     AzLogDcrIngestPS                                                               
Function        Delete-AzDataCollectionRules                       1.1.17     AzLogDcrIngestPS                                                               
Function        Delete-AzLogAnalyticsCustomLogTables               1.1.17     AzLogDcrIngestPS                                                               
Function        Filter-ObjectExcludeProperty                       1.1.17     AzLogDcrIngestPS                                                               
Function        Get-AzAccessTokenManagement                        1.1.17     AzLogDcrIngestPS                                                               
Function        Get-AzDceListAll                                   1.1.17     AzLogDcrIngestPS                                                               
Function        Get-AzDcrDceDetails                                1.1.17     AzLogDcrIngestPS                                                               
Function        Get-AzDataCollectionRuleTransformKql               1.1.17     AzLogDcrIngestPS                                                               
Function        Get-AzDcrListAll                                   1.1.17     AzLogDcrIngestPS                                                               
Function        Get-AzLogAnalyticsTableAzDataCollectionRuleStatus  1.1.17     AzLogDcrIngestPS                                                               
Function        Get-ObjectSchemaAsArray                            1.1.17     AzLogDcrIngestPS                                                               
Function        Get-ObjectSchemaAsHash                             1.1.17     AzLogDcrIngestPS                                                               
Function        Post-AzLogAnalyticsLogIngestCustomLogDcrDce        1.1.17     AzLogDcrIngestPS                                                               
Function        Post-AzLogAnalyticsLogIngestCustomLogDcrDce-Output 1.1.17     AzLogDcrIngestPS                                                               
Function        Update-AzDataCollectionRuleDceEndpoint             1.1.17     AzLogDcrIngestPS                                                               
Function        Update-AzDataCollectionRuleResetTransformKqlDef... 1.1.17     AzLogDcrIngestPS                                                               
Function        Update-AzDataCollectionRuleTransformKql            1.1.17     AzLogDcrIngestPS                                                               
Function        ValidateFix-AzLogAnalyticsTableSchemaColumnNames   1.1.17     AzLogDcrIngestPS                                                               

特定のコマンドレットのヘルプを取得する - get-help Add-CollectionTimeToAllEntriesInArray -full``` get-help Add-CollectionTimeToAllEntriesInArray -full

NAME Add-CollectionTimeToAllEntriesInArray

SYNOPSIS Add property CollectionTime (based on current time) to all entries on the object

SYNTAX Add-CollectionTimeToAllEntriesInArray [-Data] []

DESCRIPTION Gives capability to do proper searching in queries to find latest set of records with same collection time Time Generated cannot be used when you are sending data in batches, as TimeGenerated will change An example where this is important is a complete list of applications for a computer. We want all applications to show up when queriying for the latest data

PARAMETERS -Data Object to modify

root@kitploit:~
    Required?                    true
    Position?                    1
    Default value                
    Accept pipeline input?       false
    Accept wildcard characters?  false
    
<CommonParameters>
    This cmdlet supports the common parameters: Verbose, Debug,
    ErrorAction, ErrorVariable, WarningAction, WarningVariable,
    OutBuffer, PipelineVariable, and OutVariable. For more information, see 
    about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 

INPUTS None. You cannot pipe objects

OUTPUTS Updated object with CollectionTime

root@kitploit:~
-------------------------- EXAMPLE 1 --------------------------

PS C:\>#-------------------------------------------------------------------------------------------

# Variables
#-------------------------------------------------------------------------------------------
$Verbose                   = $true  # $true or $false

#-------------------------------------------------------------------------------------------
# Collecting data (in)
#-------------------------------------------------------------------------------------------
$DNSName                   = (Get-CimInstance win32_computersystem).DNSHostName +"." + (Get-CimInstance win32_computersystem).Domain
$ComputerName              = (Get-CimInstance win32_computersystem).DNSHostName
[datetime]$CollectionTime  = ( Get-date ([datetime]::Now.ToUniversalTime()) -format "yyyy-MM-ddTHH:mm:ssK" )

$UserLoggedOnRaw           = Get-Process -IncludeUserName -Name explorer | Select-Object UserName -Unique
$UserLoggedOn              = $UserLoggedOnRaw.UserName

$DataVariable = Get-CimInstance -ClassName Win32_Processor | Select-Object -ExcludeProperty "CIM*"

#-------------------------------------------------------------------------------------------
# Preparing data structure
#-------------------------------------------------------------------------------------------
$DataVariable = Convert-CimArrayToObjectFixStructure -data $DataVariable -Verbose:$Verbose
$DataVariable

# add CollectionTime to existing array
$DataVariable = Add-CollectionTimeToAllEntriesInArray -Data $DataVariable -Verbose:$Verbose
$DataVariable

#-------------------------------------------------------------------------------------------
# Output
#-------------------------------------------------------------------------------------------

VERBOSE:   Adding CollectionTime to all entries in array .... please wait !
Caption                                 : Intel64 Family 6 Model 165 Stepping 5
Description                             : Intel64 Family 6 Model 165 Stepping 5
InstallDate                             : 
Name                                    : Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
Status                                  : OK
Availability                            : 3
ConfigManagerErrorCode                  : 
ConfigManagerUserConfig                 : 
CreationClassName                       : Win32_Processor
DeviceID                                : CPU0
ErrorCleared                            : 
ErrorDescription                        : 
LastErrorCode                           : 
PNPDeviceID                             : 
PowerManagementCapabilities             : 
PowerManagementSupported                : False
StatusInfo                              : 3
SystemCreationClassName                 : Win32_ComputerSystem
SystemName                              : STRV-MOK-DT-02
AddressWidth                            : 64
CurrentClockSpeed                       : 2904
DataWidth                               : 64
Family                                  : 198
LoadPercentage                          : 1
MaxClockSpeed                           : 2904
OtherFamilyDescription                  : 
Role                                    : CPU
Stepping                                : 
UniqueId                                : 
UpgradeMethod                           : 1
Architecture                            : 9
AssetTag                                : To Be Filled By O.E.M.
Characteristics                         : 252
CpuStatus                               : 1
CurrentVoltage                          : 8
ExtClock                                : 100
L2CacheSize                             : 2048
L2CacheSpeed                            : 
L3CacheSize                             : 16384
L3CacheSpeed                            : 0
Level                                   : 6
Manufacturer                            : GenuineIntel
NumberOfCores                           : 8
NumberOfEnabledCore                     : 8
NumberOfLogicalProcessors               : 16
PartNumber                              : To Be Filled By O.E.M.
ProcessorId                             : BFEBFBFF000A0655
ProcessorType                           : 3
Revision                                : 
SecondLevelAddressTranslationExtensions : False
SerialNumber                            : To Be Filled By O.E.M.
SocketDesignation                       : U3E1
ThreadCount                             : 16
Version                                 : 
VirtualizationFirmwareEnabled           : False
VMMonitorModeExtensions                 : False
VoltageCaps                             : 
PSComputerName                          : 
CollectionTime                          : 12-03-2023 16:08:33




RELATED LINKS https://github.com/KnudsenMorten/AzLogDcrIngestPS

root@kitploit:~
<br>

# コスト - このデータの保存にはどのくらいの費用がかかりますか?
**500** クライアントが **毎日** ClientInspector インベントリを実行した場合、おおよそ **月額 DKK 200 / USD 27** かかります。

<br>

# バグ・発見事項についてお知らせください
現在、ClientInspectorV1 は何千台ものコンピュータで使用されています(ServerInspectorV1 は何千台ものサーバで使用されています)。

ClientInspectorV2 は V1 からの完全な再構築であり、新しい命名規則などを導入して展開中であるため、バグが見つからないことを保証することはできません。
しかし、**保証できるのは**、私の空き時間が許す限り迅速に修正するということです。発見事項は [email protected] までメールでお送りください。

GitHub サイトのフォークをご検討いただくか、ダッシュボード/ワークブックや ClientInspector スクリプトのアップデートに注目してください。

また、ClientInspector はさまざまな設計やプラットフォームをカバーするように構築されていますが、独自の構成があり、コレクションやダッシュボードでカバーされていない場合もあります。
しかし、オープンなアプローチにより、ダッシュボード、ワークブック、ClientInspector スクリプトを調整して、100% 機能するようにすることができます。これは、Azure のログ記録技術を活用するためのショーケースと考えてください。有料の 24 時間 365 日サポート製品ではありません。誰でも無料で使用できます。

<br>

# 連絡先
ソリューションについてご意見があれば、または単に私とつながりたい場合は、以下のチャネルからご連絡ください。ぜひつながりましょう。

[GitHub](https://github.com/KnudsenMorten)

[Twitter](https://twitter.com/knudsenmortendk)

[ブログ](https://mortenknudsen.net/)

[LinkedIn](https://www.linkedin.com/in/mortenwaltorpknudsen/)

[Microsoft MVP プロフィール](https://mvp.microsoft.com/en-us/PublicProfile/5005156?fullName=Morten%20Knudsen)

[Sessionize](https://sessionize.com/mortenknudsen/)

[メール](mailto:[email protected])

<br>

# Microsoft プロダクトチームの素晴らしい皆様に心から感謝します - あなた方はロックスターです :smile:
最後に、AzLogDcrIngestPS PowerShell モジュールの構築や、日々の Azure ログおよび表示機能に関する作業で一緒に仕事をした数名の方々に多大な謝意を表します。

|名前|役割|
|:---|:---|
|Ivan Varnitski|プログラムマネージャー - Azure Pipeline|
|Evgeny Ternovsky|プログラムマネージャー - Azure Pipeline|
|Nick Kiest|プログラムマネージャー - Azure データ収集ルール|
|Oren Salzberg|プログラムマネージャー - Azure LogAnalytics|
|Guy Wild|テクニカルライター - Azure LogAnalytics|
|John Gardner|プログラムマネージャー - Azure ワークブック|
|Shikha Jain|プログラムマネージャー - Azure ワークブック|
|Shayoni Seth|プログラムマネージャー - Azure Monitor エージェント|
|Jeff Wolford|プログラムマネージャー - Azure Monitor エージェント|
|Xema Pathak|プログラムマネージャー - Azure VMInsight (Azure Monitor エージェントとの統合)|

![MS-friends](https://assets.kitploit.com/production/public/readmes/6097/654c3844cb0324e2b53e04ebfd758652372ae0820636c3c37adc3f18ab178e8e.jpg)