Determine last time that AD has synced with Office 365

When I look at the password sync field within the Office 365 web portal it says "Warning. no recent synchronization."

What PowerShell command or other steps can I take to determine the last day and time when password synchronization between Server 2016 Active Directory and Office 365 occurred?
IT GuyNetwork EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vasil Michev (MVP)Commented:
Check the event logs on the server, it holds entry for each time the sync process runs.
IT GuyNetwork EngineerAuthor Commented:
Can you provide me with a PowerShell command that will display this information?

I would rather be able to type in a PowerShell command to get this info rather than sorting through the event logs.
Vince MabarySystems and Database AdministratorCommented:
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

IT GuyNetwork EngineerAuthor Commented:
What is the exact syntax of the Get-EventLog command that I can use to determine last time that Server 2016 Active Directory has synced with Office 365?
Vince MabarySystems and Database AdministratorCommented:
I don't currently have an AD server for testing/comparison.  But you can try this as an example.  The events you are looking for will either fall under the application, security, or system for LogName, if you can force a sync and then check those logs then you'll likely be able to find a good Source and Message string.

Get-EventLog -LogName Application -Source WinMgmt -Message "*event*" | out-host -paging

Open in new window

I included the "out-host -paging" to ease the process as it performs a "page/more" type function.  Cheers!
IT GuyNetwork EngineerAuthor Commented:
What events in particular should I search for while using the PowerShell command listed above?
IT GuyNetwork EngineerAuthor Commented:
These articles are great.

However, does anyone know what the exact PowerShell command or PowerShell script is that will tell me the exact date and time that AD has last synced with Office 365 or with Office 365 Azure?
You should find Get-MsolCompanyInformation has what you are after.

This is an O365 powershell command
timgreen7077Exchange EngineerCommented:
see the below link and it will show you how to pull last sync info.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.