{"id":1479,"date":"2025-05-14T17:46:24","date_gmt":"2025-05-14T15:46:24","guid":{"rendered":"https:\/\/www.servernet.dk\/?p=1479"},"modified":"2025-05-14T17:46:24","modified_gmt":"2025-05-14T15:46:24","slug":"turn-off-directory-synchronization-for-microsoft-365","status":"publish","type":"post","link":"https:\/\/www.servernet.dk\/?p=1479","title":{"rendered":"Turn off directory synchronization for Microsoft 365"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Install v1.0 and beta Microsoft Graph PowerShell modules<\/h1>\n\n\n\n<p>Install-Module Microsoft.Graph -Force<br>Install-Module Microsoft.Graph.Beta -AllowClobber -Force<\/p>\n\n\n\n<p># Connect With Hybrid Identity Administrator Account<br>Connect-MgGraph -scopes &#8220;Organization.ReadWrite.All,Directory.ReadWrite.All&#8221;<\/p>\n\n\n\n<p># Verify the current status of the DirSync Type<br>Get-MgOrganization | Select OnPremisesSyncEnabled<\/p>\n\n\n\n<p># Store the Tenant ID in a variable named organizationId<br>$organizationId = (Get-MgOrganization).Id<\/p>\n\n\n\n<p># Store the False value for the DirSyncEnabled Attribute<br>$params = @{<br>onPremisesSyncEnabled = $false<br>}<\/p>\n\n\n\n<p># Perform the update<br>Update-MgOrganization -OrganizationId $organizationId -BodyParameter $params<\/p>\n\n\n\n<p># Check that the command worked<br>Get-MgOrganization | Select OnPremisesSyncEnabled<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Install v1.0 and beta Microsoft Graph PowerShell modules Install-Module Microsoft.Graph -ForceInstall-Module Microsoft.Graph.Beta -AllowClobber -Force # Connect With Hybrid Identity Administrator AccountConnect-MgGraph -scopes &#8220;Organization.ReadWrite.All,Directory.ReadWrite.All&#8221; # Verify the current status of the DirSync TypeGet-MgOrganization | Select OnPremisesSyncEnabled # Store the Tenant ID in a variable named organizationId$organizationId = (Get-MgOrganization).Id # Store the False value for the DirSyncEnabled [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[348],"tags":[373,374,375],"class_list":["post-1479","post","type-post","status-publish","format-standard","hentry","category-office-365","tag-directory-synchronization","tag-graph-powershell-module","tag-onpremisessyncenabled"],"_links":{"self":[{"href":"https:\/\/www.servernet.dk\/index.php?rest_route=\/wp\/v2\/posts\/1479","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servernet.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.servernet.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.servernet.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servernet.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1479"}],"version-history":[{"count":1,"href":"https:\/\/www.servernet.dk\/index.php?rest_route=\/wp\/v2\/posts\/1479\/revisions"}],"predecessor-version":[{"id":1480,"href":"https:\/\/www.servernet.dk\/index.php?rest_route=\/wp\/v2\/posts\/1479\/revisions\/1480"}],"wp:attachment":[{"href":"https:\/\/www.servernet.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.servernet.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.servernet.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}