• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Mister PKI

SSL Certificates * SSL Tools * Certificate Decoder

  • Buy SSL Certificates
  • Blog
  • OpenSSL
  • Keytool
  • SSL Tools
  • Donate

Azure AD Connect Synchronization

February 13, 2023 by Mister PKI Leave a Comment

The Azure AD Connect Synchronization services is the connector in a hybrid AD environment. By hybrid we mean a local authoritative AD (Active Directory) that sync data to Azure Active Directory to be used in Microsoft Cloud Services including Office 365. The purpose of this article is not to demonstrate how to install AD Connect or even configure it, but how to manually sync to Azure AD with PowerShell. We will attempt to answer other common questions along the way.

Manually sync AD Connect

You can manually sync your local Active Directory with AD Connect to Azure with just a few lines of PowerShell code. The sync is also known as an AD Connect Sync Delta, as you will see specified below.

$s = New-PSSession -ComputerName "adconnect.example.com" -Credential ""
Invoke-Command -Session $s -ScriptBlock {Start-ADSyncSyncCycle -PolicyType Delta}
Remove-PSSession $s

Let us break down each line of code in detail.

$s = New-PSSession -ComputerName "adconnect.example.com" -Credential ""
  • Create a new session with New-PSSession and assign it to a variable. The -ComputerName is the name of the server running your Azure AD Connect Synchronization Services. The -Credential will accept your domain admin credentials.
Invoke-Command -Session $s -ScriptBlock {Start-ADSyncSyncCycle -PolicyType Delta}
  • Use the Invoke-Command cmdlet to execute a script block on the remote computer running the ad connect sync services. -Session will take the previous session variable as its parameter. -ScriptBlock is the code to execute. Start-ADSyncSyncCycle -PolicyType Delta is the code to perform the delta sync. Alternatively, -PolicyType Initial can be used to perform a full sync of your local directory. This is usually only done the first time and is not the recommended approach after the initial sync.
Remove-PSSession $s
  • Remove the session created with the New-PSSession command.

How often does AD Connect Sync?

By default, the AD Connect Sync services execute every 30 minutes.

Conclusion – Azure AD Connect Synchronization

This article has demonstrated how to perform Azure AD Connect sync manually with PowerShell on demand. Let us know in the comments if you have any questions or would like to see more examples with Azure AD Connect sync.

Read more of our articles.

More articles about powershell.

Identity Management,  powershell

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Popular Posts

PKCS12

openssl s_client

Keytool

Keytool list

ECDSA vs RSA

OpenSSL

PKCS7

Certificate Decoder

Training Courses

Top online courses in IT & Software

Cyber Security Training

Udemy - The Complete Internet Security Privacy Course icon

Buy SSL Certificates

The SSL Store

Comodo Store

Sectigo Store

RapidSSL

Recent Posts

  • Apereo CAS SLO
  • Azure AD Connect Synchronization
  • Redhat Disable IPv6
  • Linux ls human readable file size
  • Show linux directory size

Footer

  • Twitter
  • YouTube

Pages

  • About Mister PKI
  • Blog
  • Compare and Buy Affordable PKI Certificates
  • Contact Us
  • Full Disclosure
  • Privacy Policy
  • SSL Tools – Certificate Decoder and Certificate Checker

Copyright © 2023