{"id":2668,"date":"2017-12-08T16:28:51","date_gmt":"2017-12-08T15:28:51","guid":{"rendered":"https:\/\/www.lieben.nu\/liebensraum\/?p=2668"},"modified":"2017-12-08T16:28:51","modified_gmt":"2017-12-08T15:28:51","slug":"setting-up-okta-user-office-365-contact-synchronisation","status":"publish","type":"post","link":"https:\/\/lieben.nu\/liebensraum\/2017\/12\/setting-up-okta-user-office-365-contact-synchronisation\/","title":{"rendered":"Setting up Okta User -> Office 365 contact synchronisation"},"content":{"rendered":"<p>Okta natively does not allow you to sync users to Office 365 contacts; they either exist as <strong>users<\/strong> in Office 365, or they <strong>don&#8217;t exist at all<\/strong>.<\/p>\n<p>In hybrid scenarios where you are doing a staged migration to Office 365, or where you simply manage your contacts in Okta, you may want to populate the Global Address List in Office 365 with your Okta users.<\/p>\n<p>I&#8217;ve written a simple solution for this, you will require:<\/p>\n<ol>\n<li>Okta Admin Access (to obtain a token)<\/li>\n<li>Office 365 credentials (to write \/ modify Contacts)<\/li>\n<li>An Azure Subscription (for automation)<\/li>\n<\/ol>\n<p>The solution will sync your users in Okta to Office 365, take note of the following:<!--more--><\/p>\n<ol>\n<li>It only syncs if the user isn&#8217;t already synced by AADConnect<\/li>\n<li>It only syncs users with both a first and lastname and valid email address<\/li>\n<li>It will update\/sync the following fields:\n<ol>\n<li>Email<\/li>\n<li>Firstname<\/li>\n<li>Lastname<\/li>\n<li>Address<\/li>\n<li>Country<\/li>\n<li>DisplayName<\/li>\n<li>Zip Code<\/li>\n<li>City<\/li>\n<li>Department<\/li>\n<li>Title<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><strong>1. Retrieve an Okta API token<\/strong><\/p>\n<p><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/create_okta_api_token.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2669\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/create_okta_api_token.png\" alt=\"\" width=\"771\" height=\"441\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/create_okta_api_token.png 771w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/create_okta_api_token-300x172.png 300w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/create_okta_api_token-768x439.png 768w\" sizes=\"auto, (max-width: 771px) 100vw, 771px\" \/><\/a><\/p>\n<p><em>Save the value you are provided<\/em>, you will need it later.<\/p>\n<p><strong>2.\u00a0<\/strong>Find your Okta API URL<\/p>\n<p><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/okta_api_url.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2670\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/okta_api_url.png\" alt=\"\" width=\"760\" height=\"61\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/okta_api_url.png 760w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/okta_api_url-300x24.png 300w\" sizes=\"auto, (max-width: 760px) 100vw, 760px\" \/><\/a><\/p>\n<p>The section marked in red contains your company name, use that to create an URL such as this:<\/p>\n<p>https:\/\/lieben.okta.com<\/p>\n<p>here, &#8216;lieben&#8217; is my company name, insert yours there. Save this URL, you&#8217;ll need it later, do not use a trailing \/.<\/p>\n<p><strong>3. Go to portal.azure.com, log in and create an automation account (default) or select your existing automation account<\/strong><\/p>\n<p><strong>4. Import my script as a runbook into your Automation Account<\/strong><\/p>\n<p><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/runbook_gallery_okta_user_to_office_365_contact.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2673\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/runbook_gallery_okta_user_to_office_365_contact.png\" alt=\"\" width=\"1414\" height=\"617\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/runbook_gallery_okta_user_to_office_365_contact.png 1414w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/runbook_gallery_okta_user_to_office_365_contact-300x131.png 300w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/runbook_gallery_okta_user_to_office_365_contact-1024x447.png 1024w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/runbook_gallery_okta_user_to_office_365_contact-768x335.png 768w\" sizes=\"auto, (max-width: 1414px) 100vw, 1414px\" \/><\/a><\/p>\n<p>Alternatively, you can<a href=\"https:\/\/gitlab.com\/Lieben\/oktaToOffice365ContactSync\/blob\/master\/OktaContactSync.ps1\" target=\"_blank\" rel=\"noopener\"> get the source from GitLab<\/a><\/p>\n<p><strong>5. Create a credential asset in your automation account with your Office 365 credentials for the script to use<\/strong><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2676\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/Auzre-add-automation-credential.png\" alt=\"\" width=\"758\" height=\"738\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/Auzre-add-automation-credential.png 758w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/Auzre-add-automation-credential-300x292.png 300w\" sizes=\"auto, (max-width: 758px) 100vw, 758px\" \/><strong><span style=\"color: #000000;\">6. Create another credential asset, this one with your OKTA TOKEN, fill in the OKTA token as password, you can leave the username empty.<\/span><\/strong><\/p>\n<p><strong>7. Under runbooks, navigate to the imported runbook and click on it, then click edit -&gt; publish to allow scheduling of the runbook.<\/strong><\/p>\n<p><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/azure_publish_runbook.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2677\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/azure_publish_runbook.png\" alt=\"\" width=\"815\" height=\"347\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/azure_publish_runbook.png 815w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/azure_publish_runbook-300x128.png 300w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/azure_publish_runbook-768x327.png 768w\" sizes=\"auto, (max-width: 815px) 100vw, 815px\" \/><\/a><strong>8. Now that it is published, you&#8217;ll be able to schedule it with the parameters you&#8217;ve defined in the previous steps:<\/strong><\/p>\n<p><a href=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/schedule_runbook_okta_azure.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2713\" src=\"https:\/\/www.lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/schedule_runbook_okta_azure.png\" alt=\"\" width=\"398\" height=\"511\" srcset=\"https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/schedule_runbook_okta_azure.png 398w, https:\/\/lieben.nu\/liebensraum\/wp-content\/uploads\/2017\/12\/schedule_runbook_okta_azure-234x300.png 234w\" sizes=\"auto, (max-width: 398px) 100vw, 398px\" \/><\/a><\/p>\n<p>I don&#8217;t recommend running it more than once a day. If there are issues, you&#8217;ll be able to find them under the Jobs section of your automation account.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Okta natively does not allow you to sync users to Office 365 contacts; they either exist as users in Office 365, or they don&#8217;t exist at all. In hybrid scenarios where you are doing a staged migration to Office 365, or where you simply manage your contacts in Okta, you may want to populate the &hellip; <a href=\"https:\/\/lieben.nu\/liebensraum\/2017\/12\/setting-up-okta-user-office-365-contact-synchronisation\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Setting up Okta User -> Office 365 contact synchronisation<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[5,18,21,33,39],"tags":[],"class_list":["post-2668","post","type-post","status-publish","format-standard","hentry","category-azure","category-exchange-online","category-identity","category-okta","category-powershell"],"_links":{"self":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/2668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/comments?post=2668"}],"version-history":[{"count":0,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/posts\/2668\/revisions"}],"wp:attachment":[{"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/media?parent=2668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/categories?post=2668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lieben.nu\/liebensraum\/wp-json\/wp\/v2\/tags?post=2668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}