ms-365-admin-mcp-server

Graph API の アプリケーション権限(クライアント資格情報)を使用して Microsoft 365 を管理するための、Model Context Protocol(MCP)サーバーです。
Softeria/ms-365-mcp-server が先駆けたアーキテクチャとエンドポイント主導の設計に基づいて構築され、相互補完するものです。Softeria のサーバーはエンドユーザーの生産性向上シナリオ向けに委任アクセス許可を使用する一方、こちらはセキュリティ監視、ID 監査、インシデント対応、サービス正常性などの管理操作向けにアプリケーション権限を使用します。詳しくは以下の謝辞をご覧ください。
機能
- セキュリティ、監査、ID、アプリの資格情報、ゲストユーザー、Exchange、Intune(デバイス、アプリ、MAM、レポート、設定カタログとエンドポイントセキュリティ(BitLocker、ウイルス対策、ファイアウォール、ASR)、暗号化レポート、Windows Update プロファイル、BitLocker と LAPS のローテーション、macOS プラットフォームスクリプト、macOS カスタム属性スクリプト、割り当てフィルター、修復、Windows PowerShell スクリプト、カスタムコンプライアンススクリプト)、ガバナンス(PIM、アクセスレビュー、エンタイトルメント、ライフサイクル)、コンプライアンス、脅威インテリジェンス、高度なハンティング、Defender for Identity(センサー、候補、移行、ID アカウント、監査ポリシー)、Microsoft 365 Copilot 管理(使用状況レポート、インタラクション履歴監査、AI ユーザー、会議のインサイト、エージェント登録、ポリシー設定)、カスタムセキュリティ属性、LAPS、ポリシー、レポート、インシデント対応、eDiscovery v3(ケース、カストディアン、非カストディアルデータソース、レビューセット、クエリ、エクスポート、操作)、Purview DSPM(保護スコープ)、イベントベースの保持トリガー、Teams オンライン会議の出席レポート(Application Access Policy を使用したアプリ専用アクセス)、削除済みチャットの復元(管理者向け復旧フロー)、Teams チャット調査の読み取り(トリアージには Chat.Read.All、裁判で証拠として採用できるデータの取得には eDiscovery v3)、Cloud PC、通話レコード、Universal Print、情報保護、SharePoint 管理、レコード管理を網羅する674 個のツール
- アプリケーション権限(クライアント資格情報)を使用し、ユーザー操作は不要です
- デフォルトでは読み取り専用です。書き込み操作には明示的な
--allow-writes が必要です
- 書き込みツールのリスク分類(低/中/高/重大)
- ドメイン別(セキュリティ、監査、ID など)にツールを絞り込むプリセット
- 2 種類のトランスポート:stdio(デフォルト)と HTTP(StreamableHTTP)
- マルチクラウド:Microsoft グローバルおよび中国(21Vianet)
- シークレット管理のための Key Vault サポート
ドキュメント
前提条件
- Node.js >= 18
- アプリケーションのアクセス許可(委任ではない)を持つ Azure AD アプリの登録
- 特定のテナント ID(「common」ではない)
インストール
npm(推奨)
npm install -g @okapi-ca/ms-365-admin-mcp-server
ms-365-admin-mcp-server --help
Docker
docker pull ghcr.io/okapi-ca/ms-365-admin-mcp-server:latest
docker run --rm -i \
-e MS365_ADMIN_MCP_CLIENT_ID=... \
-e MS365_ADMIN_MCP_CLIENT_SECRET=... \
-e MS365_ADMIN_MCP_TENANT_ID=... \
ghcr.io/okapi-ca/ms-365-admin-mcp-server:latest
ソースから
git clone https://github.com/okapi-ca/ms-365-admin-mcp-server.git
cd ms-365-admin-mcp-server
npm install
npm run generate
npm run build
設定
環境変数
| 変数 | 必須 | 説明 |
|---|
MS365_ADMIN_MCP_CLIENT_ID | はい | アプリ登録のクライアント ID |
MS365_ADMIN_MCP_CLIENT_SECRET | はい | アプリ登録のクライアントシークレット |
MS365_ADMIN_MCP_TENANT_ID | はい | Azure AD テナント ID(特定の値である必要があります) |
MS365_ADMIN_MCP_CLOUD_TYPE | いいえ | global(デフォルト)または china |
MS365_ADMIN_MCP_KEYVAULT_URL | いいえ | Azure Key Vault URL(環境変数より優先) |
MS365_ADMIN_MCP_MAX_TOP | いいえ | $top クエリパラメーターの上限を設定し、結果サイズを制限 |
READ_ONLY | いいえ | 読み取り専用を強制するには true/1(デフォルトの動作) |
ENABLED_TOOLS | いいえ | 利用可能なツールを絞り込む正規表現 |
MCP クライアントの設定(Claude Desktop など)
{
"mcpServers": {
"ms365-admin": {
"command": "node",
"args": ["/path/to/ms-365-admin-mcp-server/dist/index.js"],
"env": {
"MS365_ADMIN_MCP_CLIENT_ID": "your-client-id",
"MS365_ADMIN_MCP_CLIENT_SECRET": "your-client-secret",
"MS365_ADMIN_MCP_TENANT_ID": "your-tenant-id"
}
}
}
}
VS Code(1.102+)
VS Code は同じ MCP プロトコルを使用しますが、設定の構成は異なります。mcpServers の代わりに servers を使い、type フィールドを明示し、シークレット入力のプロンプトには inputs を使います。すぐにコピーできるサンプルは .vscode/mcp.json.example にあります。これを .vscode/mcp.json にコピーすると、初回起動時に VS Code がテナント/クライアント/シークレットを尋ね、その後、シークレットストアに保存します(実際の mcp.json は gitignore の対象なので、解決済みのシークレットがリポジトリに含まれることはありません)。
最小限の stdio 設定:
{
"inputs": [
{ "type": "promptString", "id": "ms365-tenant-id", "description": "Tenant ID" },
{ "type": "promptString", "id": "ms365-client-id", "description": "Client ID" },
{
"type": "promptString",
"id": "ms365-client-secret",
"description": "Client secret",
"password": true,
},
],
"servers": {
"ms365-admin": {
"type": "stdio",
"command": "ms-365-admin-mcp-server",
"args": ["--preset", "security,audit,identity,health"],
"env": {
"MS365_ADMIN_MCP_TENANT_ID": "${input:ms365-tenant-id}",
"MS365_ADMIN_MCP_CLIENT_ID": "${input:ms365-client-id}",
"MS365_ADMIN_MCP_CLIENT_SECRET": "${input:ms365-client-secret}",
},
},
},
}
リモート HTTP でデプロイする場合は、"type": "http" と url フィールドを使います(VS Code 1.103+ は OAuth 2.0 Dynamic Client Registration をネイティブで処理します)。ネイティブのブラウザーフローを利用できない場合は、mcp-remote ブリッジを使います。どちらの形式もサンプルファイルを参照してください。
ツールは エージェントモード(GitHub Copilot Chat)に表示されます。VS Code ではツールごとに承認を求められます。上記の --preset フラグを使うと、カタログを管理しやすいサイズに保てます。ログを確認するには、Cmd/Ctrl+Shift+P → MCP: List Servers → Show Output を使います。
Claude.ai の画面におけるカタログサイズの上限
Claude.ai、Claude Desktop、クラウドセッションでは、各コネクターのツールに 1 MiB の入力スキーマ(コンパクトな JSON。ツール名と説明は含まれません)という固定の上限が適用されます。ツールはアルファベット順に登録され、上限に収まらないツールは通知なしに除外されます。Claude Code CLI には影響しません。この上限は公開されているドキュメントには記載されていません。
Mac とリンクされたクラウドセッションでは、claude-device ブリッジがすべてのローカル MCP サーバーを 1 つのコネクター(lcl-<server>-<tool>)経由で中継します。そのため、すべてのローカルサーバーがこの上限を共有し、このサーバーのツールはほとんどのローカルサーバーより後に並びます。
そのため、リクエストボディは浅いスキーマで公開されます(src/advertised-schema.ts)。エンティティ自身のフィールドとその説明を含め、ネストされたオブジェクトは自由形式のオブジェクトとして扱い、Read-only. フィールドは含めません。Graph がボディを検証し、サーバーは受信した内容をそのまま転送します。書き込みを有効にした場合、カタログが公開する入力スキーマは約 595 KB であり、768 KiB を超えると test/advertised-schema.test.ts がビルドに失敗します。
クラウドセッションで引き続きツールが表示されない場合は、このサーバーが公開する情報を減らす(読み取り専用モード、--preset、--enabled-tools)、使用していないローカルサーバーを無効にする、またはこのサーバーを独立したコネクターとして登録して専用の上限を割り当ててください。
リモート HTTP サーバー:device_code 認証(RFC 8628)
サーバーがリモートホスト(例:Azure Container Apps)で HTTP/OAuth モードで動作し、クライアントが mcp-remote 経由で接続する場合、標準のフローではブラウザーから localhost:14543/oauth/callback にアクセスする必要があります。それができない場合(macOS Platform SSO が WebKit フローを横取りする、Claude Code がヘッドレス Docker コンテナーで動作する、ユーザーがリモートの SSH 開発環境を使用しているなど)は、ms-365-admin-mcp-auth ブートストラップを使って、mcp-remote のトークンキャッシュにあらかじめトークンを登録してください。
npx -p @okapi-ca/ms-365-admin-mcp-server@latest ms-365-admin-mcp-auth \
--server https://your-mcp-host.azurecontainerapps.io/mcp
このヘルパーは URL とユーザーコードを表示します。信頼できる 任意のデバイス(スマートフォン、別のノート PC など)でサインインすると、トークンが ~/.mcp-auth/mcp-remote-<version>/ に書き込まれます。その後、Claude Desktop/Claude Code は通常どおり mcp-remote を起動し、ブラウザーを開くことなくキャッシュ済みのトークンを見つけます。
Docker/リモート開発のパターンと終了コードのリファレンスについては、docs/TROUBLESHOOTING.md を参照してください。
使用方法
CLI オプション
--read-only Read-only mode (default)
--allow-writes Enable write operations
--enabled-tools <regex> Filter tools by regex pattern
--preset <names> Use preset categories (comma-separated)
--partition <name> Tool partition served on /mcp/<group> in HTTP mode (default: domains)
--list-presets List available presets and exit
--list-tools List available tools and exit
--list-permissions List required Graph API permissions and exit
--verify-login Test credentials against Graph API and exit
--cloud <type> Cloud environment: global (default) or china
--transport <type> Transport: stdio (default) or http
--port <number> HTTP port (default: 8080)
--host <address> HTTP bind address (default: 127.0.0.1)
--allowed-clients <ids> Comma-separated Entra app IDs (required for HTTP)
-v Verbose logging
プリセット
# Security alerts and incidents only
node dist/index.js --preset security
# Identity management tools
node dist/index.js --preset identity
# Multiple presets
node dist/index.js --preset security,audit,identity
| プリセット | 説明 |
|---|
security | セキュリティアラート、インシデント、攻撃シミュレーション、脅威インテリジェンス |
audit | ディレクトリ監査、サインイン、プロビジョニングログ、削除済みアイテム |
health | サービスの正常性とメッセージセンター |
reports | 使用状況レポート(Teams、Email、SharePoint、OneDrive、Mailbox、M365 Apps) |
identity | ユーザー、グループ、ロール、デバイス、PIM、ゲストユーザー、外部 ID |
exchange | Exchange の管理(メッセージ追跡、メールボックス) |
intune | 管理対象デバイス、コンプライアンス、構成、Autopilot、アプリ、RBAC |
governance | アクセスレビュー、エンタイトルメント管理、ライフサイクルワークフロー、利用規約 |
compliance | ライセンス、Secure Score、Identity Protection、リスク検出、ポリシー |
response | インシデント対応の書き込み操作(無効化、取り消し、確認、却下) |
ediscovery | eDiscovery ケース(Microsoft Purview) |
cloudpc | Cloud PC / Windows 365(プロビジョニング、イメージ、接続、設定、監査) |
callrecords | Teams 通話記録 |
print | Universal Print(プリンター、共有、コネクタ、サービス、操作、タスク) |
infoprotection | 情報保護(BitLocker 回復キー、脅威評価) |
sharepointadmin | SharePoint テナントの管理設定 |
retention | レコード管理(保持ラベル、ファイル計画メタデータ) |
all | 利用可能なすべてのツール |
資格情報を確認する
node dist/index.js --verify-login
利用可能なツール(674)
セキュリティ(11)
| ツール | メソッド | リスク |
|---|
list-security-alerts | GET | |
get-security-alert | GET | |
update-security-alert | PATCH | 中 |
list-security-incidents | GET | |
get-security-incident | GET | |
update-security-incident | PATCH | 中 |
list-attack-simulations | GET | |
get-attack-simulation | GET | |
create-attack-simulation | POST | 高 |
update-attack-simulation | PATCH | 中 |
delete-attack-simulation | DELETE | 中 |
監査ログと削除済みアイテム(5)
| ツール | メソッド |
|---|
list-directory-audits | GET |
list-sign-ins | GET |
list-provisioning-logs | GET |
list-deleted-users | GET |
list-deleted-groups | GET |
サービスの正常性(3)
| ツール | メソッド |
|---|
list-service-health | GET |
list-service-issues | GET |
list-service-messages | GET |
使用状況レポート(8)
| ツール | メソッド |
|---|
get-teams-activity-report | GET |
get-email-activity-report | GET |
get-active-users-report | GET |
get-sharepoint-usage-report | GET |
get-onedrive-usage-report | GET |
get-active-user-counts-report | GET |
get-mailbox-usage-report | GET |
get-m365-apps-usage-report | GET |
ユーザー(9)
| ツール | メソッド | リスク |
|---|
list-users | GET | |
get-user | GET | |
list-user-memberships | GET | |
list-user-auth-methods | GET | |
list-user-devices | GET | |
create-user | POST | 高 |
delete-user | DELETE | 重大 |
assign-user-license | POST | 中 |
reprocess-user-license | POST | 低 |
汎用の update-user はありません。このサーバーが /users/{id} に対して公開している唯一の PATCH は disable-user-account(インシデント対応を参照)で、意図的に機能を限定しています。設定するのは accountEnabled のみで、それ以外は変更しません。
デバイス(2)
| ツール | メソッド |
|---|
list-devices | GET |
get-device | GET |
グループ(11)
| ツール | メソッド | リスク |
|---|
list-groups | GET | |
get-group | GET | |
list-group-members | GET | |
list-group-owners | GET | |
create-group | POST | 中 |
update-group | PATCH | 中 |
delete-group | DELETE | 重大 |
add-group-member | POST | 中 |
remove-group-member | DELETE | 中 |
add-group-owner | POST | 高 |
remove-group-owner | DELETE | 高 |
remove-group-member、add-group-owner、remove-group-owner は事前チェックのガードレールを実行します。オンプレミスと同期されたグループでの操作、動的グループからのメンバー削除、およびグループの唯一の所有者の削除を拒否します。docs/ARCHITECTURE.mdを参照してください。
ディレクトリロールと PIM(9)
| ツール | メソッド | リスク |
|---|
list-directory-roles | GET | |
list-role-members | GET | |
list-role-assignments | GET | |
list-role-definitions | GET | |
list-pim-eligible-assignments | GET | |
list-pim-active-assignments | GET | |
add-directory-role-member | POST | 重大 |
delete-role-assignment | DELETE | 重大 |
remove-directory-role-member | DELETE | 重大 |
使用するのは delete-role-assignment です。list-role-assignments に $filter=principalId eq '{user-id}' を指定すれば、必要な割り当て ID が返されます。remove-directory-role-member は、従来の方法でアクティブ化されたロールに対応します。どちらのツールも、テナントで最後に残ったアクティブなグローバル管理者に対する操作は例外なく拒否します。これは、どのパラメーターでも上書きできないロックアウト防止のガードレールです。
管理単位(8)
| ツール | メソッド | リスク |
|---|
list-administrative-units | GET | |
get-administrative-unit | GET | |
list-administrative-unit-members | GET | |
create-administrative-unit | POST | 中 |
update-administrative-unit | PATCH | 中 |
delete-administrative-unit | DELETE | 高 |
add-administrative-unit-member | POST | 中 |
remove-administrative-unit-member | DELETE | 高 |
条件付きアクセス(3)
| ツール | メソッド |
|---|
list-conditional-access-policies | GET |
get-conditional-access-policy | GET |
list-named-locations | GET |
アプリケーションとアプリのロール(11)
| ツール | メソッド | リスク |
|---|
list-applications | GET | |
list-service-principals | GET | |
list-oauth2-grants | GET | |
list-user-app-role-assignments | GET | |
list-sp-app-role-assignments | GET | |
update-application | PATCH | 高 |
delete-application | DELETE | 重大 |
update-service-principal | PATCH | 高 |
delete-oauth2-grant | DELETE | 高 |
delete-sp-app-role-assignment | DELETE | 高 |
delete-user-app-role-assignment | DELETE | 高 |
不正な同意付与への対処には、delete-oauth2-grant を使用します。list-oauth2-grants で該当する付与を特定し、これを取り消します。consentType: AllPrincipals の付与を取り消すと、アプリの委任アクセスがすべてのユーザーについて一度に無効になります。影響範囲を事前に確認し、既存のセッションは同意を取り消しても終了しないため、revoke-user-sessions も併用してください。
アプリの資格情報と所有者(7)
| ツール | メソッド |
|---|
get-application | GET |
list-application-owners | GET |
list-app-federated-credentials | GET |
get-app-federated-credential | GET |
get-service-principal | GET |
list-service-principal-owners | GET |
list-sp-delegated-permissions | GET |
アプリ管理ポリシー(2)
| ツール | メソッド |
|---|
list-app-management-policies | GET |
get-app-management-policy | GET |
組織とドメイン(4)
| ツール | メソッド | リスク |
|---|
get-organization | GET | |
list-domains | GET | |
create-domain | POST | 高 |
verify-domain | POST | 中 |
ライセンス(2)
| ツール | メソッド |
|---|
list-subscribed-skus | GET |
get-subscribed-sku | GET |
セキュアスコア(4)
| ツール | メソッド |
|---|
list-secure-scores | GET |
get-secure-score | GET |
list-secure-score-controls | GET |
get-secure-score-control | GET |
ID 保護とリスク検出(7)
| ツール | メソッド |
|---|
list-risky-users | GET |
get-risky-user | GET |
list-risky-user-history | GET |
list-risky-service-principals | GET |
get-risky-service-principal | GET |
list-risk-detections | GET |
get-risk-detection | GET |
セキュリティとアクセスのポリシー(13)
| ツール | メソッド | リスク |
|---|
get-auth-methods-policy | GET | |
list-auth-method-configs | GET | |
get-auth-method-config | GET | |
get-security-defaults | GET | |
get-admin-consent-policy | GET | |
list-auth-strength-policies | GET | |
get-auth-strength-policy | GET | |
create-auth-strength-policy | POST | 高 |
update-auth-strength-policy | PATCH | 高 |
delete-auth-strength-policy | DELETE | 高 |
get-cross-tenant-access-policy | GET | |
list-cross-tenant-partners | GET | |
change-user-password | POST | 高 |
Guest user invitations (2)
| Tool | Method | Risk |
|---|
list-invitations | GET | |
create-invitation | POST | medium |
External identity providers (2)
| Tool | Method |
|---|
list-identity-providers | GET |
get-identity-provider | GET |
Self-service sign-up (4)
| Tool | Method |
|---|
list-b2x-user-flows | GET |
get-b2x-user-flow | GET |
list-api-connectors | GET |
get-api-connector | GET |
Custom authentication extensions (2)
| Tool | Method |
|---|
list-custom-auth-extensions | GET |
get-custom-auth-extension | GET |
Exchange message traces (2)
| Tool | Method |
|---|
list-message-traces | GET |
get-message-trace | GET |
Exchange mailboxes (7)
| Tool | Method | Risk |
|---|
list-exchange-mailboxes | GET | |
get-exchange-mailbox | GET | |
list-exchange-mailbox-folders | GET | |
get-exchange-mailbox-folder | GET | |
export-exchange-mailbox-items | POST | medium |
update-exchange-mailbox | PATCH | medium |
delete-exchange-mailbox | DELETE | critical |
Threat intelligence - hosts (4)
| Tool | Method |
|---|
list-threat-intel-hosts | GET |
get-threat-intel-host | GET |
get-threat-intel-host-whois | GET |
list-threat-intel-host-pairs | GET |
Threat intelligence - articles & profiles (6)
| Tool | Method |
|---|
list-threat-intel-articles | GET |
get-threat-intel-article | GET |
list-threat-intel-article-indicators | GET |
list-threat-intel-profiles | GET |
get-threat-intel-profile | GET |
list-threat-intel-profile-indicators | GET |
Threat intelligence - vulnerabilities & WHOIS (4)
| Tool | Method |
|---|
list-threat-intel-vulnerabilities | GET |
get-threat-intel-vulnerability | GET |
list-threat-intel-whois-records | GET |
get-threat-intel-whois-record | GET |
Threat intelligence - infrastructure (2)
| Tool | Method |
|---|
list-threat-intel-host-components | GET |
list-threat-intel-ssl-certs | GET |
Managed devices (8)
| Tool | Method | Risk |
|---|
list-managed-devices | GET | |
get-managed-devices-by-names | GET | |
get-managed-device | GET | |
get-windows-protection-state | GET | |
list-device-compliance-states | GET | |
list-device-configuration-states | GET | |
get-managed-device-overview | GET | |
delete-managed-device | DELETE | critical |
Compliance policies (5)
| Tool | Method |
|---|
list-compliance-policies | GET |
get-compliance-policy | GET |
list-compliance-policy-device-statuses | GET |
get-compliance-policy-status-overview | GET |
get-compliance-state-summary | GET |
デバイス構成 (4)
| ツール | メソッド |
|---|
list-device-configurations | GET |
get-device-configuration | GET |
get-device-configuration-status-overview | GET |
list-device-configuration-device-statuses | GET |
設定カタログとエンドポイント セキュリティ (6)
すべての最新のエンドポイント セキュリティ ポリシー(ディスク暗号化/BitLocker、ウイルス対策、ファイアウォール、攻撃対象領域の縮小、EDR、アカウント保護)を含む、設定カタログのポリシーです。Graph beta を対象とします — configurationPolicies に v1.0 相当のものはありません。2 つのレポートアクションは読み取りのみを行う POST です。他の Intune レポートと同様に、--allow-writes が必要です。
| ツール | メソッド | リスク |
|---|
list-configuration-policies | GET | |
get-configuration-policy | GET | |
list-configuration-policy-settings | GET | |
list-configuration-policy-templates | GET | |
get-configuration-policy-device-status | POST | 低 |
get-configuration-policy-device-summary | POST | 低 |
エンドポイント セキュリティのインテント(レガシーテンプレート) (4)
設定カタログへの移行前に作成された、テンプレートベースのエンドポイント セキュリティ ポリシーです。Graph beta を対象とします。 エンドポイント セキュリティの監査では、これらと設定カタログの両方を対象にする必要があります。
| ツール | メソッド |
|---|
list-intents | GET |
get-intent | GET |
list-intent-device-states | GET |
list-intent-templates | GET |
デバイスの暗号化 (1)
Intune の暗号化レポートです。準備状況、状態、TPM バージョン、および各デバイスに適用された BitLocker/FileVault ポリシーを確認できます。Graph beta を対象とします。
| ツール | メソッド |
|---|
list-managed-device-encryption-states | GET |
Windows Update プロファイル (3)
機能更新プログラムと品質更新プログラムのプロファイルです。デバイスの Windows Update for Business リング(リング自体はデバイス構成です)の延期設定を上書きします。Graph beta を対象とします。
| ツール | メソッド |
|---|
list-windows-feature-update-profiles | GET |
list-windows-quality-update-profiles | GET |
list-windows-quality-update-policies | GET |
macOS プラットフォーム スクリプト (6)
管理対象の macOS デバイスに展開される Intune シェルスクリプトです。Graph beta を対象とします(/beta/deviceManagement/deviceShellScripts)— Microsoft はこのエンドポイントを v1.0 に昇格したことがありません。DeviceManagementScripts.ReadWrite.All が必要です。
| ツール | メソッド | リスク |
|---|
list-device-shell-scripts | GET | |
get-device-shell-script | GET | |
create-device-shell-script | POST | 中 |
update-device-shell-script | PATCH | 中 |
delete-device-shell-script | DELETE | 高 |
assign-device-shell-script | POST | 中 |
注:
scriptContent は、LF 改行のスクリプトを厳密な base64(URL セーフではありません)でエンコードしたものです。CRLF にすると、Mac での実行に失敗します。
- ユーザーセッションとやり取りするスクリプト(例:System Events にアクセスする
osascript)には、runAsAccount=user が必要です。
assign-device-shell-script は既存の割り当てをすべて置き換えます。追加ではありません。他の割り当てを削除せずにグループを追加するには、まず現在の割り当てを GET し、新しいターゲットを追加してから、結合したリスト全体を POST してください。
- デフォルトでは、
get-device-shell-script は scriptContent を返しません。base64 の本文を取得するには、$select=id,displayName,scriptContent,... を渡してください。
Intune Remediations / Proactive Remediations(8)
Windows 10/11 の Azure AD 参加デバイス向けの、検出用 PowerShell スクリプトと修復用 PowerShell スクリプトのペアです。Graph beta を対象とします(/beta/deviceManagement/deviceHealthScripts)。DeviceManagementScripts.ReadWrite.All が必要です。
| ツール | メソッド | リスク |
|---|
list-device-health-scripts | GET | |
get-device-health-script | GET | |
list-device-health-script-run-states | GET | |
get-device-health-script-run-summary | GET | |
create-device-health-script | POST | medium |
update-device-health-script | PATCH | medium |
delete-device-health-script | DELETE | high |
assign-device-health-script | POST | medium |
注意事項:
detectionScriptContent と remediationScriptContent はどちらも base64 エンコードされた PowerShell です。スクリプトを UTF-8 でエンコードしてから base64 にしてください。
- 検出スクリプトは、準拠している場合は終了コード 0、修復が必要な場合は 1 を返します。修復スクリプトは、検出スクリプトが 1 を返した場合にのみ実行されます。
assign-device-health-script は既存の割り当てをすべて 置き換えます。スケジュールには、毎日、毎時、1 回限りを指定できます。検出のみの展開では、runRemediationScript: false を設定してください。
- デフォルトでは、
get-device-health-script はスクリプト本体を返しません。$select=id,displayName,detectionScriptContent,remediationScriptContent,... を渡してください。
- Windows の「検証+修正」ユースケース(CIS のハードニング、エージェントのインストール検証、サービスの状態など)では、
deviceShellScripts の最新の代替手段です。
Assignment filters(5)
Entra グループのサブセットにポリシー/アプリの割り当てを適用する動的メンバーシップフィルターです。Graph beta を対象とします(/beta/deviceManagement/assignmentFilters)。DeviceManagementConfiguration.ReadWrite.All が必要です。
| ツール | メソッド | リスク |
|---|
list-assignment-filters | GET | |
get-assignment-filter | GET | |
create-assignment-filter | POST | medium |
update-assignment-filter | PATCH | medium |
delete-assignment-filter | DELETE | high |
注意事項:
- ルール構文はデバイスのプロパティに対する KQL に似ています。例:macOS Sonoma のみの場合は
(device.osVersion -startsWith "14")、企業所有デバイスの場合は (device.deviceOwnership -eq "Corporate") です。
- 演算子:
-eq、-ne、-startsWith、-contains、-in、-matches。-and/-or で結合します。
- フィルターは
deviceConfigurations/mobileApps/deviceCompliancePolicies の割り当てで参照します(ユーザーには割り当てません。まずグループに割り当て、次にフィルターを追加して対象を絞り込みます)。
assignmentFilterManagementType:デバイスを対象とする割り当てでは devices、アプリを対象とする割り当てでは apps を指定します(プロパティの一部は異なります)。
- 使用中のフィルターを削除すると、依存する割り当ては通知なく「グループのすべてのメンバー」に戻ります。削除前に割り当てを監査してください。
macOS カスタム属性シェルスクリプト(6)
Intune のシェルスクリプトで、標準出力が各デバイスの名前付きカスタム属性として保存されます。インベントリデータ(FileVault、Gatekeeper、暗号化フラグ、カスタムマーカー)の表示や、動的グループフィルターの設定に便利です。Graph beta を対象とします(/beta/deviceManagement/deviceCustomAttributeShellScripts)。DeviceManagementScripts.ReadWrite.All が必要です。
| ツール | メソッド | リスク |
|---|
list-device-custom-attribute-shell-scripts | GET | |
get-device-custom-attribute-shell-script | GET | |
create-device-custom-attribute-shell-script | POST | 中 |
update-device-custom-attribute-shell-script | PATCH | 中 |
delete-device-custom-attribute-shell-script | DELETE | 高 |
assign-device-custom-attribute-shell-script | POST | 中 |
注意事項:
- スクリプトの標準出力は、各デバイスの
customAttributeName に保存される値になります。
customAttributeType は、Intune が標準出力を解析する方法を制御します。integer、string、または dateTime(ISO 8601)を指定します。
scriptContent は、LF 改行を使用したスクリプトの厳密な base64 エンコードです。CRLF にすると Mac での実行に失敗します。
- デプロイ後に
customAttributeName または customAttributeType を変更すると、以前のキーを参照する後続の動的グループや割り当てフィルターが機能しなくなります。先に参照先を監査してください。
- スクリプトを削除しても、デバイスレコードに以前収集された属性値は消去されません。
Windows PowerShell スクリプト(deviceManagementScripts)(6)
管理対象の Windows 10/11 デバイスにデプロイする、1 回限りの PowerShell スクリプトです。割り当てごとにデバイスあたり 1 回実行され、失敗すると再試行されます。検出と修正のパターンには、代わりに deviceHealthScripts(Remediations)を使用してください。Graph beta を対象とします(/beta/deviceManagement/deviceManagementScripts)。DeviceManagementScripts.ReadWrite.All が必要です。
| ツール | メソッド | リスク |
|---|
list-device-management-scripts | GET | |
get-device-management-script | GET | |
create-device-management-script | POST | 中 |
update-device-management-script | PATCH | 中 |
delete-device-management-script | DELETE | 高 |
assign-device-management-script | POST | 中 |
注意事項:
scriptContent は、UTF-8 の PowerShell を base64 エンコードしたものです。
- 割り当て後、次回の Intune Management Extension の同期時にデバイスごとに 1 回だけ実行されます。正常に実行された後は再実行されません(繰り返し実行するパターンには
deviceHealthScripts を使用してください)。
scriptContent を更新しても、すでに実行に成功したデバイスでは再実行されません。再実行させるには、削除してから再作成してください。
enforceSignatureCheck=true を指定すると、コード署名済みスクリプトが必要になります(本番環境では推奨)。
runAs32Bit=true を指定すると、64 ビット版 Windows で 32 ビット版 PowerShell を強制的に実行します(必要となることはまれです)。
Windows のカスタムコンプライアンススクリプト(deviceComplianceScripts)(6)
STDOUT に JSON オブジェクトを出力し、関連付けられた windows10CustomComplianceConfiguration ポリシーで宣言されたルールに照らして評価される PowerShell スクリプトです。組織固有のコンプライアンスシグナルに使用します。組み込みの BitLocker/Defender/ファイアウォールのチェックでは対応できない場合に利用できます。Graph beta を対象とします(/beta/deviceManagement/deviceComplianceScripts)。DeviceManagementScripts.ReadWrite.All が必要です。
| ツール | メソッド | リスク |
|---|
list-device-compliance-scripts | GET | |
get-device-compliance-script | GET | |
create-device-compliance-script | POST | medium |
update-device-compliance-script | PATCH | medium |
delete-device-compliance-script | DELETE | high |
assign-device-compliance-script | POST | medium |
メモ:
detectionScriptContent は STDOUT に JSON オブジェクトを出力する必要があります(例:ConvertTo-Json -Compress @{BitLockerEnabled=$true;TpmReady=$true})。
- スクリプトだけではコンプライアンスに影響しません。一致するルールを含む
windows10CustomComplianceConfiguration ポリシーも作成する必要があります。
- JSON キーを変更し、リンクされたポリシーのルールを更新しないと、コンプライアンス評価がひそかに機能しなくなります。
- 使用中のスクリプトを削除すると、次回のデバイスチェックイン時に、参照しているコンプライアンスポリシーの評価が失敗します。
- 割り当ての形式は
deviceHealthScriptAssignment を再利用します(コンプライアンススクリプトには修復スクリプトとのペアがないため、runRemediationScript: false を設定してください)。
登録と Autopilot(10)
| ツール | メソッド | リスク |
|---|
list-enrollment-configurations | GET | |
get-enrollment-configuration | GET | |
list-autopilot-devices | GET | |
get-autopilot-device | GET | |
create-enrollment-configuration | POST | medium |
update-enrollment-configuration | PATCH | medium |
delete-enrollment-configuration | DELETE | high |
update-autopilot-device | PATCH | medium |
delete-autopilot-device | DELETE | high |
import-autopilot-device | POST | medium |
検出されたアプリ(3)
| ツール | メソッド |
|---|
list-detected-apps | GET |
get-detected-app | GET |
list-detected-app-devices | GET |
Intune の RBAC と構成(7)
| ツール | メソッド |
|---|
list-intune-audit-events | GET |
get-software-update-summary | GET |
get-apple-push-certificate | GET |
list-intune-role-definitions | GET |
list-intune-role-assignments | GET |
list-intune-terms-and-conditions | GET |
list-intune-terms-acceptances | GET |
Intune のコネクターと更新プログラム(3)
| ツール | メソッド |
|---|
get-intune-conditional-access-settings | GET |
list-mtd-connectors | GET |
list-ios-update-statuses | GET |
デバイスカテゴリ(1)
| ツール | メソッド |
|---|
list-device-categories | GET |
アクセスレビュー(5)
| ツール | メソッド |
|---|
list-access-review-definitions | GET |
get-access-review-definition | GET |
list-access-review-instances | GET |
get-access-review-instance | GET |
list-access-review-decisions | GET |
エンタイトルメント管理(7)
| ツール | メソッド |
|---|
list-access-packages | GET |
get-access-package | GET |
list-access-package-assignments | GET |
list-access-package-requests | GET |
list-access-package-catalogs | GET |
list-connected-organizations | GET |
get-entitlement-management-settings | GET |
ライフサイクルワークフロー(3)
| ツール | メソッド |
|---|
list-lifecycle-workflows | GET |
get-lifecycle-workflow | GET |
list-lifecycle-task-definitions | GET |
グループ向け PIM(2)
| ツール | メソッド |
|---|
list-pim-group-assignment-schedules | GET |
list-pim-group-eligibility-schedules | GET |
利用規約(3)
| ツール | メソッド |
|---|
list-terms-of-use-agreements | GET |
get-terms-of-use-agreement | GET |
list-terms-of-use-acceptances | GET |
アプリの同意要求(3)
| ツール | メソッド |
|---|
list-app-consent-requests | GET |
get-app-consent-request | GET |
list-user-consent-requests | GET |
インシデント対応(17)-- --allow-writes が必要です
| ツール | メソッド | リスク |
|---|
disable-user-account | PATCH | critical |
revoke-user-sessions | POST | high |
add-security-alert-comment | POST | low |
update-device | PATCH | high |
confirm-compromised-users | POST | high |
dismiss-risky-users | POST | high |
delete-user-phone-auth-method | DELETE | high |
delete-user-fido2-auth-method | DELETE | high |
delete-user-authenticator-auth-method | DELETE | high |
delete-user-software-oath-auth-method | DELETE | high |
delete-user-windows-hello-auth-method | DELETE | high |
delete-user-email-auth-method | DELETE | high |
delete-user-temporary-access-pass-auth-method | DELETE | high |
confirm-compromised-service-principals | POST | high |
dismiss-risky-service-principals | POST | high |
confirm-safe-users | POST | high |
run-hunting-query | POST | low |
認証方法コレクションごとに削除ツールが1つあります。IDはコレクションごとに固有で、相互に置き換えることはできないためです。最初に list-user-auth-methods を実行し、@odata.type に基づいて適切なツールとIDを選んでください。MFAが必須で、その認証方法がユーザーに残された唯一のMFA要素である場合、Graphは削除を拒否します。
Intune デバイスのリモート操作(18) -- --allow-writes が必要です
| ツール | メソッド | リスク |
|---|
wipe-managed-device | POST | critical |
retire-managed-device | POST | high |
sync-managed-device | POST | low |
reboot-managed-device | POST | high |
remote-lock-device | POST | medium |
reset-device-passcode | POST | high |
shutdown-managed-device | POST | high |
disable-lost-mode | POST | low |
locate-managed-device | POST | low |
bypass-activation-lock | POST | high |
trigger-defender-scan | POST | low |
update-defender-signatures | POST | low |
rotate-bitlocker-keys | POST | medium |
rotate-local-admin-password | POST | medium |
clean-windows-device | POST | critical |
logout-shared-apple-user | POST | medium |
delete-shared-apple-user | POST | high |
update-windows-device-account | POST | medium |
条件付きアクセスの CRUD(7) -- --allow-writes が必要です
| ツール | メソッド | リスク |
|---|
list-conditional-access-templates | GET | |
create-conditional-access-policy | POST | high |
update-conditional-access-policy | PATCH | high |
delete-conditional-access-policy | DELETE | critical |
create-named-location | POST | medium |
update-named-location | PATCH | medium |
delete-named-location | DELETE | high |
Intune ポリシーの CRUD(8) -- --allow-writes が必要です
| ツール | メソッド | リスク |
|---|
create-compliance-policy | POST | medium |
update-compliance-policy | PATCH | medium |
assign-compliance-policy | POST | high |
delete-compliance-policy | DELETE | high |
create-device-configuration | POST | medium |
update-device-configuration | PATCH | medium |
assign-device-configuration | POST | high |
delete-device-configuration | DELETE | high |
設定カタログとエンドポイントセキュリティの CRUD(4) -- --allow-writes が必要です
Graph beta を対象とします。 DeviceManagementConfiguration.ReadWrite.All が必要です。assign-configuration-policy は割り当てリスト全体を置き換えます。
| ツール | メソッド | リスク |
|---|
create-configuration-policy | POST | medium |
update-configuration-policy | PATCH | medium |
delete-configuration-policy | DELETE | high |
assign-configuration-policy | POST | high |
エンドポイントセキュリティインテントの CRUD(4) -- --allow-writes が必要です
Graph beta を対象とします。 DeviceManagementConfiguration.ReadWrite.All が必要です。assign-intent は割り当てリスト全体を置き換えます。
| ツール | メソッド | リスク |
|---|
update-intent | PATCH | medium |
update-intent-settings | POST | medium |
delete-intent | DELETE | high |
assign-intent | POST | high |
OneDrive / ユーザードライブ(DSAR 列挙)(4)
データ主体アクセス要求に対応するため、ユーザーの個人用ドライブを読み取り専用でたどります。コンテンツのバイトデータは公開されず、メタデータとダウンロード URL が返されます。
| ツール | メソッド | リスク |
|---|
get-user-drive | GET | |
get-drive-root | GET | |
list-drive-children | GET | |
get-drive-item | GET | |
Purview DSPM(保護スコープ)(2)
| ツール | メソッド | リスク |
|---|
get-data-security-governance-root | GET | |
compute-protection-scopes | POST | low |
compute-protection-scopes は POST ですが、変更ではなく計算を行うため、リスク階層は low です。それでも --allow-writes が必要です。
Teams オンライン会議の出席状況(4)
特定ユーザーの会議に関する出席状況レポートです。アプリ専用アクセスには、テナントで Application Access Policy を設定し、Set-CsApplicationAccessPolicy を使用してサービスプリンシパルごとに付与する必要があります。設定しない場合、Graph のアクセス許可にかかわらず、Graph は 403 を返します。
| ツール | メソッド | リスク |
|---|
get-user-online-meeting | GET | |
list-user-meeting-attendance-reports | GET | |
get-user-meeting-attendance-report | GET | |
list-user-meeting-attendance-records | GET | |
Teams の削除済みチャット(3)
| ツール | メソッド | リスク |
|---|
list-deleted-chats | GET | |
get-deleted-chat | GET | |
undo-delete-chat | POST | medium |
ユーザーが削除したチャットを管理者が復元するためのフローです。保持期間は Microsoft によって決められており、ここでは設定できません。
Teams チャットの調査用読み取り(5)
Chat.Read.All を使用して、ユーザーのチャットをトリアージするための読み取りです。法廷で証拠として採用できる本番用途には、代わりに eDiscovery ツールを使用してください。これらの読み取りには証拠保全の連鎖がありません。
| ツール | メソッド | リスク |
|---|
list-user-chats | GET | |
get-chat | GET | |
list-chat-members | GET | |
list-chat-messages | GET | |
get-chat-message | GET | |
Teams 通話レコード(11)
| ツール | メソッド |
|---|
list-call-records | GET |
get-call-record | GET |
list-call-record-sessions | GET |
get-call-record-session | GET |
list-call-session-segments | GET |
get-call-session-segment | GET |
list-call-record-participants | GET |
get-call-record-participant | GET |
get-call-record-organizer | GET |
get-pstn-calls | GET |
get-direct-routing-calls | GET |
Cloud PC/Windows 365(10)
| ツール | メソッド | リスク |
|---|
list-cloud-pcs | GET | |
list-cloud-pc-provisioning-policies | GET | |
list-cloud-pc-device-images | GET | |
list-cloud-pc-gallery-images | GET | |
list-cloud-pc-on-premises-connections | GET | |
list-cloud-pc-user-settings | GET | |
list-cloud-pc-audit-events | GET | |
create-cloud-pc-provisioning-policy | POST | medium |
update-cloud-pc-provisioning-policy | PATCH | medium |
delete-cloud-pc-provisioning-policy | DELETE | high |
Universal Print(6)
| ツール | メソッド | リスク |
|---|
list-printers | GET | |
list-print-shares | GET | |
list-print-connectors | GET | |
list-print-services | GET | |
list-print-operations | GET | |
list-print-task-definitions | GET | |
情報保護と秘密度ラベル(7)
| ツール | メソッド |
|---|
list-bitlocker-recovery-keys | GET |
list-threat-assessment-requests | GET |
list-sensitivity-labels | GET |
get-sensitivity-label | GET |
list-sensitivity-sublabels | GET |
get-sensitivity-label-rights | GET |
get-protection-scopes | GET |
SharePoint 管理(25)
| ツール | メソッド | リスク |
|---|
get-sharepoint-settings | GET | |
list-sharepoint-sites | GET | |
get-sharepoint-site | GET | |
update-sharepoint-site | PATCH | 中 |
list-site-drives | GET | |
get-site-default-drive | GET | |
list-site-lists | GET | |
get-site-list | GET | |
create-site-list | POST | 低 |
update-site-list | PATCH | 低 |
delete-site-list | DELETE | 高 |
list-site-list-items | GET | |
create-site-list-item | POST | 低 |
update-site-list-item | PATCH | 低 |
delete-site-list-item | DELETE | 中 |
list-site-list-columns | GET | |
list-site-columns | GET | |
list-site-content-types | GET | |
list-site-permissions | GET | |
get-site-permission | GET | |
create-site-permission | POST | 中 |
update-site-permission | PATCH | 中 |
delete-site-permission | DELETE | 高 |
get-site-analytics | GET | |
list-site-subsites | GET | |
レコード管理(9)
| ツール | メソッド | リスク |
|---|
list-file-plan-authorities | GET | |
list-file-plan-categories | GET | |
list-file-plan-citations | GET | |
list-file-plan-departments | GET | |
list-file-plan-references | GET | |
get-retention-event | GET | |
create-retention-event | POST | 中 |
get-retention-event-type | GET | |
create-retention-event-type | POST | 中 |
retentionLabels 自体の一覧表示や読み取りは公開されていません。Microsoft Graph はアプリケーション権限での操作をサポートしていないためです。その場合は、委任アクセスまたは Security & Compliance PowerShell を使用してください。list-retention-events はセキュリティの高度な機能にあります。
Teams administration (33)
| Tool | Method | Risk |
|---|
list-teams | GET | |
create-team | POST | medium |
get-team | GET | |
update-team | PATCH | medium |
delete-team | DELETE | critical |
list-team-admin-channels | GET | |
create-team-admin-channel | POST | low |
get-team-admin-channel | GET | |
delete-team-admin-channel | DELETE | high |
list-team-admin-members | GET | |
add-team-admin-members | POST | medium |
remove-team-admin-members | POST | medium |
get-team-admin-member | GET | |
list-team-installed-apps | GET | |
archive-team | POST | medium |
unarchive-team | POST | low |
clone-team | POST | medium |
list-team-operations | GET | |
list-team-permission-grants | GET | |
get-teams-app-settings | GET | |
update-teams-app-settings | PATCH | high |
list-deleted-teams | GET | |
list-teams-catalog-apps | GET | |
get-teams-catalog-app | GET | |
list-teams-app-definitions | GET | |
get-teams-admin-settings | GET | |
list-teams-user-configurations | GET | |
get-teams-admin-policy | GET | |
list-teams-policy-assignments | GET | |
list-teams-phone-assignments | GET | |
assign-teams-phone-number | POST | medium |
unassign-teams-phone-number | POST | high |
get-teams-phone-number-operation | GET | |
Intune reports (18) -- requires --allow-writes (POST endpoints)
| Tool | Method | Risk |
|---|
intune-device-noncompliance-report | POST | low |
intune-compliance-policy-noncompliance-report | POST | low |
intune-compliance-policy-noncompliance-summary | POST | low |
intune-compliance-setting-noncompliance-report | POST | low |
intune-config-policy-noncompliance-report | POST | low |
intune-config-policy-noncompliance-summary | POST | low |
intune-config-setting-noncompliance-report | POST | low |
intune-devices-without-compliance-report | POST | low |
intune-noncompliant-devices-settings-report | POST | low |
intune-policy-noncompliance-report | POST | low |
intune-policy-noncompliance-summary | POST | low |
intune-policy-noncompliance-metadata | POST | low |
intune-setting-noncompliance-report | POST | low |
intune-report-filters | POST | low |
intune-historical-report | POST | low |
intune-cached-report | POST | low |
list-intune-report-export-jobs | GET | |
intune-device-app-install-status-report | POST | low |
Intune partners & infrastructure (10)
| Tool | Method | Risk |
|---|
list-compliance-management-partners | GET | |
list-device-management-partners | GET | |
list-exchange-connectors | GET | |
list-remote-assistance-partners | GET | |
list-notification-message-templates | GET | |
list-intune-resource-operations | GET | |
list-imported-autopilot-devices | GET | |
list-windows-malware-info | GET | |
list-intune-mobile-apps | GET | |
list-intune-app-categories | GET | |
Intune app management (11)
| Tool | Method | Risk |
|---|
list-intune-app-configurations | GET | |
list-managed-app-policies | GET | |
list-managed-app-registrations | GET | |
list-managed-app-statuses | GET | |
list-android-app-protections | GET | |
list-ios-app-protections | GET | |
list-default-app-protections | GET | |
list-targeted-app-configurations | GET | |
list-mdm-wip-policies | GET | |
list-mam-wip-policies | GET | |
list-vpp-tokens | GET | |
Advanced policies (15)
| Tool | Method | Risk |
|---|
list-activity-timeout-policies | GET | |
get-authorization-policy | GET | |
get-auth-flows-policy | GET | |
list-claims-mapping-policies | GET | |
list-conditional-access-policies-v2 | GET | |
get-default-app-management-policy | GET | |
get-device-registration-policy | GET | |
list-feature-rollout-policies | GET | |
list-home-realm-discovery-policies | GET | |
list-permission-grant-policies | GET | |
list-role-management-policies | GET | |
list-role-management-policy-assignments | GET | |
list-token-issuance-policies | GET | |
list-token-lifetime-policies | GET | |
get-cross-tenant-default-policy | GET | |
Identity Governance+ (11)
| Tool | Method | Risk |
|---|
list-entitlement-assignment-policies | GET | |
list-entitlement-resources | GET | |
list-entitlement-resource-environments | GET | |
list-lifecycle-workflow-templates | GET | |
get-lifecycle-workflow-settings | GET | |
list-lifecycle-custom-task-extensions | GET | |
list-deleted-lifecycle-workflows | GET | |
list-pim-group-assignment-requests | GET | |
list-pim-group-assignment-instances | GET | |
list-pim-group-eligibility-requests | GET | |
list-pim-group-eligibility-instances | GET | |
PIM role management (6)
| Tool | Method | Risk |
|---|
list-access-review-history | GET | |
list-pim-role-assignment-requests | GET | |
list-pim-role-assignment-schedules | GET | |
list-pim-role-eligibility-requests | GET | |
list-pim-role-eligibility-schedules | GET | |
list-role-resource-namespaces | GET | |
Identity Protection+ (1)
| Tool | Method | Risk |
|---|
list-service-principal-risk-detections | GET | |
Security advanced (9)
| Tool | Method | Risk |
|---|
list-retention-events | GET | |
list-retention-event-types | GET | |
list-subject-rights-requests | GET | |
list-simulation-automations | GET | |
list-simulation-trainings | GET | |
list-simulation-payloads | GET | |
list-simulation-end-user-notifications | GET | |
list-simulation-landing-pages | GET | |
list-simulation-login-pages | GET | |
Defender for Identity(24)
Graph を介した Microsoft Defender for Identity(DfI)管理の全機能をカバーします。センサー、センサー候補(自動検出)、センサーの統合 Defender XDR アーキテクチャへの移行、ID アカウント(AD オンプレミス/Okta 向けの緊急時用 invokeAction を含む)、監査ポリシーの適用、正常性アラートが含まれます。ほとんどのエンドポイントは Graph v1.0 です。sensorMigration のみベータ版です。
| ツール | メソッド | リスク |
|---|
list-identity-health-issues | GET | |
get-identity-health-issue | GET | |
list-sensor-health-issues | GET | |
get-sensor-health-issue | GET | |
list-identity-sensors | GET | |
get-identity-sensor | GET | |
update-identity-sensor | PATCH | 中 |
get-sensor-deployment-access-key | GET | |
get-sensor-deployment-package-uri | GET | |
regenerate-sensor-deployment-access-key | POST | 高 |
list-sensor-candidates | GET | |
get-sensor-candidate | GET | |
get-sensor-candidate-activation-config | GET | |
update-sensor-candidate-activation-config | PATCH | 中 |
activate-sensor-candidates | POST | 中 |
list-sensor-migrations | GET | |
get-sensor-migration | GET | |
migrate-sensors | POST | 高 |
get-identity-security-settings | GET | |
get-auto-auditing-config | GET | |
update-auto-auditing-config | PATCH | 中 |
list-identity-accounts | GET | |
get-identity-account | GET | |
invoke-identity-account-action | POST | 重大 |
注:
invoke-identity-account-action は最も影響の大きい書き込み操作です。アカウントのソースシステム(AD オンプレミス、Okta)で、ID 対応アクション(disable、enable、forcePasswordReset、revokeAllSessions、requireUserToSignInAgain、markUserAsCompromised)を実行します。アクションとプロバイダーの互換性:AD と Okta では disable/enable、AD のみでは forcePasswordReset、Okta のみでは revokeAllSessions を使用できます。
regenerate-sensor-deployment-access-key は以前のキーを直ちに無効にします。実行前に、新しいセンサーを展開する担当者と調整してください。
migrate-sensors は、統合 Defender XDR への移行中に対象 DC のセンサーサービスを再起動します。一時的に(数分程度)キャプチャーが途切れます。本番 DC ではメンテナンス時間帯を設定してください。ベータ版のみです。
activate-sensor-candidates は、デプロイアクセスキーのフローを使用して、検出されたホストへのセンサーのインストールを開始します。先に get-sensor-candidate で確認してください。誤った serverId を指定すると、別のホストにインストールされます。
update-auto-auditing-config で enabled=true を設定すると、DfI は各センサーホストに推奨される Windows の詳細監査ポリシーを適用します(次回のハートビート時にローカル管理者による上書きを元に戻します)。本番環境での使用を推奨します。
v0.10.0/0.11.1 以降に必要となった新しい Graph 権限(アプリ登録で同意が必要です):
SecurityIdentitiesSensors.Read.All + SecurityIdentitiesSensors.ReadWrite.All(センサー管理)
SecurityIdentitiesAutoConfig.Read.All + SecurityIdentitiesAutoConfig.ReadWrite.All(autoAuditingConfiguration)
SecurityIdentitiesAccount.Read.All(identityAccounts の list/get)
SecurityIdentitiesActions.ReadWrite.All(identityAccounts の invokeAction — 緊急時用)
SecurityIdentitiesMigration.Read.All + SecurityIdentitiesMigration.ReadWrite.All(sensorMigration、ベータ版)
脅威インテリジェンス+(6)
| ツール | メソッド | リスク |
|---|
list-passive-dns-records | GET | |
list-ssl-certificates | GET | |
list-threat-intel-subdomains | GET | |
list-threat-intel-host-ports | GET | |
list-threat-intel-host-trackers | GET | |
list-threat-intel-host-cookies | GET | |
レポート+(5)
| ツール | メソッド | リスク |
|---|
list-user-registration-details | GET | |
list-daily-print-usage-by-printer | GET | |
list-daily-print-usage-by-user | GET | |
list-monthly-print-usage-by-printer | GET | |
list-monthly-print-usage-by-user | GET | |
Copilot 管理(15)
設定とポリシー:
| ツール | メソッド | リスク |
|---|
get-copilot-admin-settings | GET | |
get-copilot-limited-mode | GET | |
list-copilot-policy-settings | GET | |
get-copilot-policy-setting | GET | |
使用状況レポート:
| ツール | メソッド | リスク |
|---|
get-copilot-usage-user-detail | GET | |
get-copilot-user-count-summary | GET | |
get-copilot-user-count-trend | GET | |
インタラクション履歴の監査、AI ユーザー、会議のインサイト:
| ツール | メソッド | リスク |
|---|
get-all-copilot-interactions | GET | |
get-user-copilot-interactions | GET | |
list-ai-users | GET | |
get-ai-user | GET | |
list-ai-user-online-meetings | GET | |
list-ai-meeting-insights | GET | |
get-ai-meeting-insight | GET | |
エージェント登録:
| ツール | メソッド | リスク |
|---|
get-copilot-agent-registration | GET | |
get-all-copilot-interactions は、テナント内のすべてのエンタープライズ Copilot のインタラクション(プロンプトと応答)を返します。出力は規制対象の個人データとして取り扱ってください。
ディレクトリ+(5)
| ツール | メソッド | リスク |
|---|
list-attribute-sets | GET | |
list-custom-security-attributes | GET | |
list-device-local-credentials | GET | |
list-federation-configurations | GET | |
list-on-premises-sync | GET | |
アプリケーションの資格情報と所有者の CRUD(11)-- --allow-writes が必要
| ツール | メソッド | リスク |
|---|
create-application | POST | 高 |
add-application-password | POST | 高 |
remove-application-password | POST | 高 |
add-application-key | POST | 高 |
remove-application-key | POST | 高 |
add-application-owner | POST | 高 |
remove-application-owner | DELETE | 高 |
create-app-federated-credential | POST | 高 |
update-app-federated-credential | PATCH | 高 |
delete-app-federated-credential | DELETE | 高 |
set-application-verified-publisher | POST | 中 |
Service Principals CRUD & credentials (10) -- requires --allow-writes
| Tool | Method | Risk |
|---|
create-service-principal | POST | high |
delete-service-principal | DELETE | critical |
add-sp-password | POST | high |
remove-sp-password | POST | high |
add-sp-key | POST | high |
remove-sp-key | POST | high |
add-sp-token-signing-certificate | POST | high |
add-sp-owner | POST | high |
remove-sp-owner | DELETE | high |
create-sp-app-role-assignment | POST | high |
PIM activation & requests (10) -- requires --allow-writes
| Tool | Method | Risk |
|---|
create-pim-role-assignment-request | POST | critical |
cancel-pim-role-assignment-request | POST | high |
create-pim-role-eligibility-request | POST | critical |
cancel-pim-role-eligibility-request | POST | high |
create-pim-group-assignment-request | POST | high |
cancel-pim-group-assignment-request | POST | medium |
create-pim-group-eligibility-request | POST | high |
cancel-pim-group-eligibility-request | POST | medium |
create-role-management-policy-assignment | POST | high |
update-role-management-policy | PATCH | high |
Entitlement Management CRUD (12) -- requires --allow-writes
| Tool | Method | Risk |
|---|
create-access-package | POST | medium |
update-access-package | PATCH | medium |
delete-access-package | DELETE | high |
create-access-package-catalog | POST | medium |
update-access-package-catalog | PATCH | medium |
delete-access-package-catalog | DELETE | high |
create-access-package-assignment-policy | POST | medium |
update-access-package-assignment-policy | PUT | medium |
delete-access-package-assignment-policy | DELETE | high |
create-access-package-assignment-request | POST | medium |
reprocess-access-package-assignment-request | POST | low |
cancel-access-package-assignment-request | POST | medium |
Lifecycle Workflows CRUD & execution (8) -- requires --allow-writes
| Tool | Method | Risk |
|---|
create-lifecycle-workflow | POST | medium |
update-lifecycle-workflow | PATCH | medium |
delete-lifecycle-workflow | DELETE | high |
activate-lifecycle-workflow | POST | high |
restore-lifecycle-workflow | POST | medium |
create-lifecycle-custom-task-extension | POST | medium |
update-lifecycle-custom-task-extension | PATCH | medium |
delete-lifecycle-custom-task-extension | DELETE | high |
アクセスレビューの CRUD とアクション(8) -- --allow-writes が必要です
| ツール | メソッド | リスク |
|---|
create-access-review-definition | POST | medium |
update-access-review-definition | PUT | medium |
delete-access-review-definition | DELETE | high |
stop-access-review-instance | POST | high |
send-reminder-access-review | POST | low |
reset-access-review-decisions | POST | high |
apply-access-review-decisions | POST | high |
accept-access-review-recommendations | POST | medium |
eDiscovery(Purview)(33) -- 書き込みには --allow-writes が必要です
ケースと検索:
| ツール | メソッド | リスク |
|---|
list-ediscovery-cases | GET | |
get-ediscovery-case | GET | |
create-ediscovery-case | POST | medium |
update-ediscovery-case | PATCH | medium |
delete-ediscovery-case | DELETE | critical |
close-ediscovery-case | POST | medium |
reopen-ediscovery-case | POST | medium |
list-ediscovery-searches | GET | |
create-ediscovery-search | POST | medium |
estimate-ediscovery-search-statistics | POST | medium |
カストディアン:
| ツール | メソッド | リスク |
|---|
list-ediscovery-custodians | GET | |
get-ediscovery-custodian | GET | |
create-ediscovery-custodian | POST | medium |
apply-hold-ediscovery-custodian | POST | high |
remove-hold-ediscovery-custodian | POST | high |
release-ediscovery-custodian | POST | medium |
update-ediscovery-custodian-index | POST | low |
カストディアン以外のデータソース:
| ツール | メソッド | リスク |
|---|
list-ediscovery-noncustodial-data-sources | GET | |
get-ediscovery-noncustodial-data-source | GET | |
create-ediscovery-noncustodial-data-source | POST | medium |
apply-hold-ediscovery-noncustodial-data-source | POST | medium |
remove-hold-ediscovery-noncustodial-data-source | POST | high |
レビューセット、クエリ、エクスポート:
| ツール | メソッド | リスク |
|---|
list-review-sets | GET | |
get-review-set | GET | |
create-review-set | POST | low |
add-to-review-set | POST | medium |
export-review-set | POST | high |
list-review-set-queries | GET | |
get-review-set-query | GET | |
create-review-set-query | POST | low |
apply-tags-review-set-query | POST | medium |
操作:
| ツール | メソッド | リスク |
|---|
list-case-operations | GET | |
get-case-operation | GET | |
export-review-set は、裁判で証拠として認められる形式でデータを出力するためのパスです。exportOptions / exportStructure フィールドは Graph のフラグ付き列挙型であり、オブジェクトではなく、カンマ区切りの文字列として送信する必要があります。
Azure AD のアクセス許可
読み取り専用(デフォルト)
AccessReview.Read.All
AdministrativeUnit.Read.All
AgentRegistration.Read.All
Agreement.Read.All
AiEnterpriseInteraction.Read.All
APIConnectors.Read.All
AppCatalog.Read.All
Application.Read.All
AppRoleAssignment.Read.All
AttackSimulation.Read.All
AuditLog.Read.All
BitlockerKey.Read.All
CallRecords.Read.All
Chat.ManageDeletion.All
Channel.ReadBasic.All
Chat.Read.All
ChatMember.Read.All
ChatMessage.Read.All
CloudPC.Read.All
ConsentRequest.Read.All
CopilotPolicySettings.Read
CopilotSettings-Internal.ReadWrite.All
CustomAuthenticationExtension.Read.All
CustomSecAttributeDefinition.Read.All
Device.Read.All
DeviceLocalCredential.Read.All
DeviceManagementApps.Read.All
DeviceManagementConfiguration.Read.All
DeviceManagementManagedDevices.Read.All
DeviceManagementRBAC.Read.All
DeviceManagementServiceConfig.Read.All
Directory.Read.All
Domain.Read.All
eDiscovery.Read.All
EntitlementManagement.Read.All
Exchange.ManageAsApp
Group.Read.All
GroupMember.Read.All
IdentityProvider.Read.All
IdentityRiskEvent.Read.All
IdentityRiskyServicePrincipal.Read.All
IdentityRiskyUser.Read.All
IdentityUserFlow.Read.All
InformationProtectionPolicy.Read.All
LifecycleWorkflows.Read.All
MailboxSettings.Read
OnlineMeetingArtifact.Read.All
OnlineMeetings.Read.All
OnPremDirectorySynchronization.Read.All
Organization.Read.All
Policy.Read.All
Printer.Read.All
ProtectionScopes.Compute.All
PrintConnector.Read.All
PrintJob.Read.All
PrivilegedAccess.Read.AzureADGroup
RecordsManagement.Read.All
Reports.Read.All
RoleAssignmentSchedule.Read.Directory
RoleEligibilitySchedule.Read.Directory
RoleManagement.Read.Directory
RoleManagementPolicy.Read.Directory
SecurityAlert.Read.All
SecurityEvents.Read.All
SecurityIdentitiesAccount.Read.All
SecurityIdentitiesAutoConfig.Read.All
SecurityIdentitiesHealth.Read.All
SecurityIdentitiesMigration.Read.All
SecurityIdentitiesSensors.Read.All
SecurityIncident.Read.All
ServiceHealth.Read.All
ServiceMessage.Read.All
SharePointTenantSettings.Read.All
Sites.Read.All
Sites.FullControl.All
SubjectRightsRequest.Read.All
Team.ReadBasic.All
TeamMember.Read.All
TeamsAppInstallation.ReadForTeam.All
TeamsTelephoneNumber.Read.All
TeamsUserConfiguration.Read.All
TeamworkAppSettings.Read.All
TeamworkDevice.Read.All
ThreatAssessment.Read.All
ThreatHunting.Read.All
ThreatIntelligence.Read.All
User.Invite.All
User.Read.All
UserAuthenticationMethod.Read.All
書き込み(インシデント対応、デバイス操作、CA ポリシー、Teams、SharePoint、ID 管理)
AccessReview.ReadWrite.All
AdministrativeUnit.ReadWrite.All
Application.ReadWrite.All
Application.ReadWrite.OwnedBy
AppRoleAssignment.ReadWrite.All
AttackSimulation.ReadWrite.All
Channel.Create
Channel.Delete.All
CloudPC.ReadWrite.All
Device.ReadWrite.All
DeviceManagementConfiguration.ReadWrite.All
DeviceManagementManagedDevices.PrivilegedOperations.All
DeviceManagementManagedDevices.ReadWrite.All
DeviceManagementServiceConfig.ReadWrite.All
Directory.AccessAsUser.All
Domain.ReadWrite.All
eDiscovery.ReadWrite.All
EntitlementManagement.ReadWrite.All
Group.ReadWrite.All
GroupMember.ReadWrite.All
IdentityRiskyServicePrincipal.ReadWrite.All
IdentityRiskyUser.ReadWrite.All
LifecycleWorkflows.ReadWrite.All
Policy.ReadWrite.AuthenticationMethod
Policy.ReadWrite.ConditionalAccess
PrivilegedAccess.ReadWrite.AzureADGroup
RecordsManagement.ReadWrite.All
RoleAssignmentSchedule.ReadWrite.Directory
RoleEligibilitySchedule.ReadWrite.Directory
RoleManagement.ReadWrite.Directory
RoleManagementPolicy.ReadWrite.Directory
SecurityAlert.ReadWrite.All
SecurityIdentitiesActions.ReadWrite.All
SecurityIdentitiesAutoConfig.ReadWrite.All
SecurityIdentitiesMigration.ReadWrite.All
SecurityIdentitiesSensors.ReadWrite.All
SecurityIncident.ReadWrite.All
Sites.ReadWrite.All
Team.Create
Team.ReadWrite.All
TeamMember.ReadWrite.All
TeamsTelephoneNumber.ReadWrite.All
TeamworkAppSettings.ReadWrite.All
User.ReadWrite.All
UserAuthenticationMethod.ReadWrite.All
リモート HTTP デプロイ
ローカル HTTP モード
node dist/index.js \
--transport http \
--port 8080 \
--allowed-clients "app-id-1,app-id-2"
HTTP モードでは、--allowed-clients フラグが必須です。Microsoft の JWKS エンドポイントに照らして受信したベアラートークンを検証します(署名検証、audience、テナント、クライアント ID のチェック)。
Docker
docker build -t ms365-admin-mcp .
docker run -p 8080:8080 \
-e MS365_ADMIN_MCP_CLIENT_ID=... \
-e MS365_ADMIN_MCP_CLIENT_SECRET=... \
-e MS365_ADMIN_MCP_TENANT_ID=... \
ms365-admin-mcp --allowed-clients "your-app-id"
Azure Container Apps
infra/main.bicep に Bicep テンプレートが用意されています。次のリソースをデプロイします。
- ユーザー割り当てマネージド ID(UAMI)
- Key Vault(RBAC、消去保護、90 日間のソフト削除)
- Log Analytics ワークスペース + Application Insights
- Container App Environment
- UAMI を使用し、
MS365_ADMIN_MCP_KEYVAULT_URL が Key Vault に設定された Container App
MY_OID=$(az ad signed-in-user show --query id -o tsv)
az deployment group create \
--resource-group rg-mcp-admin \
--template-file infra/main.bicep \
--parameters baseName=ms365mcpprod \
containerImage=your-acr.azurecr.io/ms365-admin-mcp:latest \
kvAdminObjectIds="['$MY_OID']"
デプロイ後、Key Vault に ms365-admin-mcp-{client-id,tenant-id,client-secret} を登録してください。docs/HTTP_DEPLOYMENT.md を参照してください。
開発
npm run dev # Run with tsx (hot reload)
npm run generate # Download OpenAPI spec + generate client
npm run build # Build with tsup
npm run test # Run vitest
npm run lint # ESLint
npm run format # Prettier
npm run verify # Full pipeline (generate + lint + format + build + test)
npm run inspector # MCP Inspector for interactive testing
新しいツールの追加
src/endpoints.json にエンドポイントの項目を追加し、section(README の一覧で項目を追加するセクション)と、書き込みの場合は riskLevel を指定します。そのセクションが新しい場合は、src/tool-partitions.ts のすべてのテーブルに追加します
npm run generate を実行してクライアントを再生成します
registerGraphTools() によって、ツールは起動時に自動登録されます
npm run verify を実行して検証します
セキュリティ
- デフォルトで読み取り専用 -- 変更操作には
--allow-writes が必要です
- 書き込みツールにリスクレベル(critical/high/medium/low)を設定し、LLM に表示される警告を付けます
- HTTP モードで Microsoft JWKS(RS256)を介して JWT 署名を検証します
- HTTP モードでは認証が必須です(
--allowed-clients が必要)
- MCP エンドポイントでレート制限(100 req/min)を実施します
- セキュリティヘッダー(nosniff、DENY、no-store、CSP)
- Docker の非 root ユーザー
- ログから機密データをマスキングします
謝辞
このプロジェクトは、Softeria/ms-365-mcp-server がなければ実現しませんでした。同プロジェクトの取り組みは、このサーバーの基盤となり、着想の源にもなりました。特に次の点が挙げられます。
- エンドポイント駆動型アーキテクチャ(
endpoints.json + graph-tools.ts による自動登録)
- OpenAPI ベースのコード生成パイプライン(
npm run generate → Graph 仕様の縮小 + Zodios クライアント)
- CLI の使いやすさ(プリセット、
--list-tools、--list-permissions、--verify-login、MCP Inspector との統合)
- デフォルトで読み取り専用 +
--allow-writes の安全モデル
このサーバーは、委任されたアクセス許可ではなくアプリケーションのアクセス許可(MSAL の ConfidentialClientApplication を介したクライアント資格情報)を対象としている点に加え、書き込みツールのリスク分類、HTTP モード用の Microsoft JWKS を介した JWT 検証、Azure Key Vault との統合、インシデント対応ツールなど、管理者向けの機能を追加している点で Softeria のプロジェクトとは異なります。
オープンライセンスで成果を公開し、Microsoft 365 エコシステムにおける MCP サーバー設計の高い水準を示してくださった Softeria チームと貢献者の皆様に、心より感謝します。
ライセンス
MIT — LICENSE を参照してください。