{"id":298,"date":"2025-04-01T14:03:00","date_gmt":"2025-04-01T13:03:00","guid":{"rendered":"https:\/\/vtom.uk\/?page_id=298"},"modified":"2025-04-01T14:03:00","modified_gmt":"2025-04-01T13:03:00","slug":"okta-force-sync","status":"publish","type":"page","link":"https:\/\/vtom.uk\/index.php\/okta-force-sync\/","title":{"rendered":"Okta &#8211; Force Sync"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This PowerShell script can be setup to run as a Windows Scheduled task to automatically sync attributes to an Okta App. This automates the process of logging into the Okta Admin dashboard, and selecting the &#8220;Force Sync&#8221; button located under &#8220;Provisioning&#8221; for an app:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"169\" height=\"70\" src=\"https:\/\/vtom.uk\/wp-content\/uploads\/2025\/04\/image-15.png\" alt=\"\" class=\"wp-image-299\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Values for &#8220;$TARGETIDENTIFIER&#8221; and &#8220;$SOURCEIDENTIFIER&#8221; can be found using a suitable trace application (e.g. SAML Tracer for Firefox):<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"989\" height=\"109\" src=\"https:\/\/vtom.uk\/wp-content\/uploads\/2025\/04\/image-17.png\" alt=\"\" class=\"wp-image-301\" srcset=\"https:\/\/vtom.uk\/wp-content\/uploads\/2025\/04\/image-17.png 989w, https:\/\/vtom.uk\/wp-content\/uploads\/2025\/04\/image-17-300x33.png 300w, https:\/\/vtom.uk\/wp-content\/uploads\/2025\/04\/image-17-768x85.png 768w\" sizes=\"auto, (max-width: 989px) 100vw, 989px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Requirements:<\/strong><br>Okta PSModule (<a href=\"https:\/\/github.com\/mbegan\/Okta-PSModule\">https:\/\/github.com\/mbegan\/Okta-PSModule<\/a>)<br>API Token created (Security > API > Token > Create Token):<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"605\" height=\"451\" src=\"https:\/\/vtom.uk\/wp-content\/uploads\/2025\/04\/image-18.png\" alt=\"\" class=\"wp-image-302\" style=\"width:385px;height:auto\" srcset=\"https:\/\/vtom.uk\/wp-content\/uploads\/2025\/04\/image-18.png 605w, https:\/\/vtom.uk\/wp-content\/uploads\/2025\/04\/image-18-300x224.png 300w\" sizes=\"auto, (max-width: 605px) 100vw, 605px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>Script<\/strong>\n&lt;#\n    .SYNOPSIS\n    Script to invoke the \"Force Sync\" function in Okta\n\n    .DESCRIPTION\n    The Force Sync function is used to resynchronise\/re-apply profile attributes to an Okta App\n\t\n    .INPUTS\n    No inputs required.\n\n    .OUTPUTS\n    Logs output of script in .\\Logs subdirectory\n\n    .NOTES\n    Written by Tom Edwards\n#>\n\n$logfile = \".\\logs\\$(get-date -f yyyyddMM).txt\"\n$SOURCEIDENTIFIER = \"\"\n$TARGETIDENTIFIER = \"\"\n\n$ErrorActionPreference = \"Continue\"\nStart-Transcript -Path $logfile -Append\n\nWrite-host \"Invoking...\"\nConnect-Okta \"APIKEYHERE\" \"https:\/\/YOUROKTATENANT.okta-emea.com\"\ninvoke-method -method PUT \"\/api\/internal\/v1\/mappings\/reapply?source=$SOURCEIDENTIFIER&amp;target=$TARGETIDENTIFIER\"\nWrite-host \"End of script.\"\n\nStop-Transcript\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This PowerShell script can be setup to run as a Windows Scheduled task to automatically sync attributes to an Okta App. This automates the process of logging into the Okta Admin dashboard, and selecting the &#8220;Force Sync&#8221; button located under &#8220;Provisioning&#8221; for an app: Values for &#8220;$TARGETIDENTIFIER&#8221; and &#8220;$SOURCEIDENTIFIER&#8221; can be found using a suitable &hellip; <a href=\"https:\/\/vtom.uk\/index.php\/okta-force-sync\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Okta &#8211; Force Sync<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-298","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/vtom.uk\/index.php\/wp-json\/wp\/v2\/pages\/298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vtom.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/vtom.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/vtom.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vtom.uk\/index.php\/wp-json\/wp\/v2\/comments?post=298"}],"version-history":[{"count":1,"href":"https:\/\/vtom.uk\/index.php\/wp-json\/wp\/v2\/pages\/298\/revisions"}],"predecessor-version":[{"id":304,"href":"https:\/\/vtom.uk\/index.php\/wp-json\/wp\/v2\/pages\/298\/revisions\/304"}],"wp:attachment":[{"href":"https:\/\/vtom.uk\/index.php\/wp-json\/wp\/v2\/media?parent=298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}