Microsoft-Entra-Connect is installed on an on-prem server, typically a domain controller, and used to link and sync the on-prem accounts with the Entra ID accounts and mailboxes.
This allows you to use one password for local AD and cloud-hosted accounts.
Prerequisites
Install
This typically only needs to be installed on one server in an environment. Microsoft has a series of very in-depth articles on how to install it available that can be found at the below link
# Microsoft Entra Connect and Microsoft Entra Connect Health installation roadmap
Import
Normally, you should not need to import it, it should import automatically when you run commands.
Import-Module "C:\Program Files\Microsoft Azure AD Sync\Bin\ADSync\ADSync.psd1"
Commands
Run a sync
Once it is installed, it will, by default, run every half hour. If you are making changes, you can manually force a sync using one of the below commands.
Use PolicyType Delta to only sync changes since the last run:
Start-ADSyncSyncCycle -PolicyType Delta
Use PolicyType Initial to sync everything:
Start-ADSyncSyncCycle -PolicyType Initial
Get Sync Status
This will give you the current status of a running sync. The sync typically only takes a minute or two, and this will generate an error if a sync is not currently running.
Get-ADSyncConnectorRunStatus
An alternative to this is to go into the Start Menu > Azure AD Connect > Synchronization Service
This will open a GUI interface where you can view the progress of any sync that is running, as well as review any errors generated by the sync.