Azure 属性に関する Service Now 同期の問題:部門フィールド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: ; } } ServiceNow のユーザーアカウントと Azure テナントの同期を設定した後、同期プロセスは期待どおりに機能しています。Service Now 側のアカウントのプロビジョニングは正常に同期されていますが、Service Now 側の一部の属性フィールドが更新されていません。ユーザーの Service Now 側のユーザーの [部門] フィールドが、Azure プロビジョニング時の属性マッピングに基づいて更新されません。 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: ; } } NA 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の観点から見た問題の実際の原因: 参照タイプの AAD 属性を作成しようとしました:Azure AD で参照タイプ属性がサポートされていないため、失敗しました。PS C:\windows\system32> New-AzureADApplicationExtensionProperty -ObjectId $MyApp -Name "servicenow-department" -DataType "Reference" -TargetObjects "User"New-AzureADApplicationExtensionProperty : Error occurred while executing NewApplicationExtensionPropertyCode: Request_BadRequestMessage: Invalid value specified for property 'dataType' of resource 'ExtensionProperty'.RequestId: 6773fc59-e189-4410-9afa-322b07730efcDateTimeStamp: Tue, 19 Nov 2019 06:11:36 GMTDetails: PropertyName - dataType, PropertyErrorCode - InvalidValue1.Cref 式関数を使用して文字列を参照に変換しようとしましたが、Azure AD ユーザープロビジョニングで Cref 式関数がサポートされていないために失敗しました[cid:image001.png@01D59EE5.E0B33D00]技術的に言えば、これは実際の問題ではなく、完全にデータ構造の不一致です。ご存知のように、ServiceNow 側では部門属性タイプは参照であり、Azure AD 側では拡張属性は文字列です。Microsoft の観点からは、同じデータ構造を使用して値を渡すことをお勧めします。 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: ; } } ->ServiceNow インスタンスのユーザーテーブル名「u_orgunit」に列 (文字列) を作成します。(列名は任意です) ・>以下のようにAzure側の属性で列をマッピングします。 ->Azure 側から完全同期を実行して、ServiceNow 側でユーザーのテーブルの OrgUnit 列に値が入力されているかどうかを確認します。 ->Azure のデータがユーザーのテーブルに送信され、Azure が ServiceNow に送信された部門データがユーザーのテーブルの orgUnit 列に入力されていることがわかります。 -> ユーザーテーブルで以下のバックグラウンドスクリプトを実行して、orgUnit と Dept 間でデータを同期します (このスクリプトは、DEPT にすでにいくつかのデータがある場合に記述され、orgUnit と Dept 間でデータを同期するために作成されます) var gr1 = new GlideRecord("sys_user");//gr1.addEncodedQuery("orgunitISNOTEMPTY");//gr1.addEncodedQuery("u_orgunitISNOTEMPTY");//gr1.addQuery("name", "value");gr1.query();gs.print("count : "+gr1.getRowCount());while (gr1.next()) {var gr = new GlideRecord('cmn_department'); //u_affiliates refers to table namegr.addQuery('name',gr1.u_orgunit.toString());gr.query();if(gr.next()){gr1.department=gr.sys_id;}else{gr.initialize();gr.name=gr1.u_orgunit.toString();gr1.department=gr.insert();}gs.print(gr1.user_name);gr1.update();} 2) onBefore ビジネスルールを作成してsys_userテーブルでさらに更新しても、今後次のスクリプトを実行できるようにします (列 OrgUnit と DEPT 間の自動同期) ユーザーのテーブルのレコードが更新/挿入されるたびに行われます******(function executeRule(current, previous /*null when async*/) {var gr = new GlideRecord('cmn_department'); //u_affiliates refers to table namegr.addQuery('name',current.u_orgunit.toString());gr.query();if(gr.next()){current.department=gr.sys_id;}else{gr.initialize();gr.name=current.u_orgunit.toString();current.department=gr.insert();}})(current, previous); 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: ; } } NA