IntegrationHub Microsoft AD スポーク「ActionAddUserToADGroup.ps1」が「ActionAddUserToADGroup.ps1 の実行中にユーザー で認証に失敗しました」というエラーで失敗する。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: block; max-width: ; width: auto; height: auto; } } 統合ハブ AD スポーク「ActionAddUserToADgroup」を使用すると、認証は次のエラーで失敗します。 Authentication failure with the user <username>Failed while executing ActionAddUserToADGroup.ps1 (Access denied) 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: block; max-width: ; width: auto; height: auto; } } Madrid 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: block; max-width: ; width: auto; height: auto; } } 要求がフローデザイナーから送信されると、PowerShell コマンドの実行に含まれる $isDiscovery が true であり、これが問題の原因となっているため、認証情報が WMI に対して認証されます (失敗)。 フローデザイナーから実行されるコマンドは次のようになります。 Executing command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy unrestricted -noninteractive -nologo -noprofile -command "& {& 'scripts\PowerShell\PSScript.ps1' -computer '10.10.10.10' -script 'C:\RP-EW2A-MID01\agent\scripts\PowerShell\ADSpoke\ActionAddUserToADGroup.ps1' -useCred $true -ismid $false -isDiscovery $true -debug $true -logInfo $false -skipTest $false; exit $LASTEXITCODE}" ただし、オーケストレーションワークフローを使用して同じ要求を送信すると、$isDiscoveryが false に設定され、WMI に対する認証がスキップされるため、認証が成功し、残りのスクリプトは引き続き実行できます。 ワークフローから実行されるコマンドは次のようになります。 Executing command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy unrestricted -noninteractive -nologo -noprofile -command "& {& 'scripts\PowerShell\PSScript.ps1' -computer '10.10.10.10' -script 'C:\RP-EW2A-MID01\agent\scripts\PowerShell\AD\AddUserToADGroup.ps1' 'use_mid_service_account' $false -useCred $true -ismid $false -isDiscovery $false -debug $true -logInfo $false -skipTest $false; exit $LASTEXITCODE}" 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: block; max-width: ; width: auto; height: auto; } } MID サーバーのデバッグをオンにします (MID サーバー設定パラメーターに移動し、mid.log.level を追加し、値を debug にする必要があります)フローデザイナーで問題を再現すると、MID ログで以下のログを確認できます。 05/21/19 14:22:02 (051) Worker-Expedited:IPaaSActionProbe-1aab2321db617b00ce01f9c41d961971 DEBUG: Executing command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy unrestricted -noninteractive -nologo -noprofile -command "& {& 'scripts\PowerShell\PSScript.ps1' -computer '10.0.10.10' -script 'C:\RP-EW2A-MID01\agent\scripts\PowerShell\ADSpoke\ActionAddUserToADGroup.ps1' -useCred $true -ismid $false -isDiscovery $true -debug $true -logInfo $false -skipTest $false; exit $LASTEXITCODE}" 05/21/19 14:22:02 (051) Worker-Expedited:IPaaSActionProbe-1aab2321db617b00ce01f9c41d961971 DEBUG: With credential: <userName> 05/21/19 14:22:02 (074) Worker-Expedited:IPaaSActionProbe-1aab2321db617b00ce01f9c41d961971 DEBUG: Thread name is Powershell is executing... 05/21/19 14:22:03 (334) Worker-Expedited:IPaaSActionProbe-1aab2321db617b00ce01f9c41d961971 DEBUG: The exit value from waitFor() is 1 05/21/19 14:22:04 (975) ECCQueueMonitor.5 DEBUG: Event: CheckSenderReadyEvent 05/21/19 14:22:04 (975) ECCQueueMonitor.5 DEBUG: Monitor query: state=ready^queue=output^agent=mid.server.MIDSERVER_DEV^sys_created_on>=2019-04-20 12:02:33^ORDERBYpriority^ORDERBYsys_created_on 05/21/19 14:22:05 (357) ECCQueueMonitor.5 DEBUG: Event: RGRPerfMetricEvent 05/21/19 14:22:05 (357) ECCQueueMonitor.5 DEBUG: Number of messages added to threadpool queue in current polling cycle: 0 05/21/19 14:22:05 (357) ECCQueueMonitor.5 DEBUG: Changing polling frequency of ECCQueueMonitor to 40 seconds 05/21/19 14:22:05 (465) ECCQueueMonitor.40 DEBUG: Event: CheckSenderReadyEvent 05/21/19 14:22:05 (466) ECCQueueMonitor.40 DEBUG: Monitor query: state=ready^queue=output^agent=mid.server.MIDSERVER_DEV^sys_created_on>=2019-04-20 12:02:33^ORDERBYpriority^ORDERBYsys_created_on 05/21/19 14:22:05 (507) Worker-Expedited:IPaaSActionProbe-1aab2321db617b00ce01f9c41d961971 DEBUG: Execution status: failed 05/21/19 14:22:05 (508) Worker-Expedited:IPaaSActionProbe-1aab2321db617b00ce01f9c41d961971 SEVERE *** ERROR *** Authentication failure with the user <UserName> 05/21/19 14:22:05 (508) Worker-Expedited:IPaaSActionProbe-1aab2321db617b00ce01f9c41d961971 SEVERE *** ERROR *** Failed while executing ActionAddUserToADGroup.ps1 (Access denied) 05/21/19 14:22:05 (510) ECCQueueMonitor.40 DEBUG: Event: RGRPerfMetricEvent 05/21/19 14:22:05 (510) ECCQueueMonitor.40 DEBUG: Number of messages added to threadpool queue in current polling cycle: 0 05/21/19 14:22:05 (512) Worker-Expedited:IPaaSActionProbe-1aab2321db617b00ce01f9c41d961971 SEVERE *** ERROR *** Authentication failure with the user <UserName> 05/21/19 14:22:05 (519) Worker-Expedited:IPaaSActionProbe-1aab2321db617b00ce01f9c41d961971 2019-05-21 14:22:02 Tried Credential: name=Reference AD Service Account, affinity: yes, status=failed, sysid=430eb90bdbf8bf00ce01f9c41d961975, username=Corp.Reference.Build\svcMidserverUser2, type=Windows, order=100 上記のログとエラーが表示される場合、ほとんどの場合、フローデザイナーにアクションが欠落していることが原因です。この時点で、[グループにユーザーを追加] の実行アクションに移動します。実行アクションで変数 credType を追加し、問題を解決する値 AD を渡します。以下のスクリーンショットを見てください。 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: block; max-width: ; width: auto; height: auto; } } 同じAdduserToADGroupは、ワークフローから問題なく正常に動作します。