「無効なユーザー名/パスワード」401エラーの修正 |Intune スポークIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } この記事は、Microsoft Intune スポークの「管理対象デバイスの取得」アクションから受け取る可能性がある 401 エラーのトラブルシューティングを支援することを目的としています。 Microsoft Intune スポークでは、 Azure でアクセス許可を適切に設定する必要があります。Azure で定義された構成が正しくないか不完全な場合でも、インスタンスは Azure トークンプロバイダーエンドポイントからアクセストークンを取得できますが、フロー/アクションの実行時に失敗します。 [管理対象デバイスを取得] アクションで観察できるエラーの例: メソッドが失敗しました:(/v1.0/deviceManagement/managedDevices/{managedDeviceId}) コード:401:無効なユーザー名/パスワードコンボMethod failed: (/v1.0/deviceManagement/managedDevices/{managedDeviceId}) with code: 401 - Invalid username/password combo 対応する REST 応答には、次のエラーを含むメッセージが表示されます。 エラーが発生しました: 操作 ID (カスタマーサポート用)An error has occurred - Operation ID (for customer support) Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Quebec Cause<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } これは、アクセストークン が生成される Azure AD アカウントにロールがないことを示します。実際、 Microsoft のドキュメント Intune アクセス許可スコープ には次のように記載されています。 「現時点では、すべての Intune アクセス許可スコープには管理者アクセスが必要です。つまり、Intune API リソースにアクセスするアプリまたはスクリプトを実行するときは、対応する資格情報が必要です。」 Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } トークンを要求する Azure AD アカウントには次のロールが必要です。 読み取り専用オペレーター: ルックアップまたは取得アクションに付与できる最小限のロールです。マネージド デバイスの更新 とマネージド デバイスの削除 を使用する場合は、グローバル管理者または Intune 管理者(および readwrite.all アクセス許可)が必要です。 インスタンスでは、 OAuth プロバイダーとしての Microsoft Intune レコードを権限許可タイプ 認証コード で構成する必要があります。 各 Intune スポークアクションに必要なすべての権限の詳細については、「 KB0995339: Intune スポークアクション権限テーブル」を参照してください。権限は、ユースケースに応じて、タイプを 委任 または アプリケーション にすることができます。 上記のアクセス許可に加えて、基本的な Microsoft Graph アクセス許可も必要です。 email :ユーザーのメールアドレスを表示します。offline_access :アクセス権を付与したデータへのアクセスを維持します。openid :ユーザーをサインインさせます。profile :ユーザーの基本プロファイルを表示します。User.Read :サインインしてユーザープロファイルを読み取ります。 Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Microsoft Intune スポークの設定 ServiceNow 製品ドキュメントKB0995339:Intune スポークアクション権限テーブルIntune 権限スコープ Microsoft ドキュメント