🏴‍☠️
Venture Next
  • Windows
    • Configuring Time Synchronization in Active Directory: NT5DS and NTP
    • Regedit Show File
    • Page 2
    • Windows CA
      • Windows CA Backup DB
      • Windows CA Failed Requests Database Cleanup
  • VMware
    • Remount iSCSI Datastore after network failure
    • Backing Up and Restoring VMware ESXi Configuration Settings
  • Proxmox
    • Page
    • Page 8
  • Networking & Security
    • Nginx
      • Nginx Proxy Manager - Install on Ubuntu
      • Nginx Proxy Manager - Adding a New Proxy Host
      • Nginx Proxy Manager - SSL Certificates with Cloudflare API and Let's Encrypt
  • Linux
    • Page 1
  • DevOps
    • Resetting GitLab EE root password in Docker
  • Miscellaneous
    • FiiO BTA30 Pro USB DAC Driver
  • Page 10
  • Page 9
  • Page 11
  • Microsoft 365
    • Create a Microsoft 365 Group Without Welcome Email
    • Turn off directory synchronization
  • Exchange
    • Exchange Server Log Cleanup
  • Set Regional Settings and Localize Mailbox Folders
  • Email Notification Banners
  • Microsoft Teams
  • MS365 Tenant to Tenant Migration
    • Page 12
      • Page 13
      • Page 14
  • Page 15
    • Page 16
    • Page 17
Powered by GitBook
On this page
  1. Microsoft 365

Turn off directory synchronization

https://learn.microsoft.com/en-us/microsoft-365/enterprise/turn-off-directory-synchronization?view=o365-worldwide

# Install v1.0 and beta Microsoft Graph PowerShell modules 
  Install-Module Microsoft.Graph -Force
  Install-Module Microsoft.Graph.Beta -AllowClobber -Force 
  
  # Connect With Hybrid Identity Administrator Account
  Connect-MgGraph -scopes "Organization.ReadWrite.All,Directory.ReadWrite.All" 
  
  # Verify the current status of the DirSync Type
  Get-MgOrganization | Select OnPremisesSyncEnabled 
  
  # Store the Tenant ID in a variable named organizationId
  $organizationId = (Get-MgOrganization).Id 
  
  # Store the False value for the DirSyncEnabled Attribute
  $params = @{
  	onPremisesSyncEnabled = $false
  }
  
  # Perform the update
  Update-MgOrganization -OrganizationId $organizationId -BodyParameter $params 
  
  # Check that the command worked
  Get-MgOrganization | Select OnPremisesSyncEnabled

If you use this command, you must wait 72 hours before you can turn directory synchronization back on. This process will clear the following on-premises properties:

  • DnsDomainName

  • NetBiosName

  • OnPremisesDistinguishedName

  • OnPremisesSamAccountName

  • OnpremisesUserPrincipalName

PreviousCreate a Microsoft 365 Group Without Welcome EmailNextExchange Server Log Cleanup

Last updated 1 month ago