Triggering Intune Management Extension (IME) Sync

During some recent automations I got the question about triggering Intune Management Extension (IME) somehow. The typical action I take in my lab environment is to restart the IME service:

Intune Management Extension (IME) service restarting

Of course this will re-initialize everything and also start a new Sync, but I thought there must also be a way to accomplish the Sync without the “all or nothing” method.

Investigation Phase

So, I remembered that a Sync in Company Portal does also trigger IME to start a Sync process. Lets verify this, open Company Portal, click on Settings, and then on the Sync button:

Company Portal starting a Sync

If we look at the IME log files (C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\IntuneManagementExtension.log) closely, you can see the IME receives a signal to start a Sync process:

Intune Management Extension (IME) log file starting sync process

How do we find the trigger to raise the signal?

A good way to identify for example command line arguments in executables, is to use the strings.exe from Windows Sysinternals. If we look at the documentation about Strings you can find an easy way to search for strings in an executable:

strings * | findstr /i TextToSearchFor

Utilizing this and searching for the keyword “Sync” in the main executable from the IME service Microsoft.Management.Services.IntuneWindowsAgent.exe

Intune Management Extension IME Windows service properties

should be a way to go:

strings "C:\Program Files (x86)\Microsoft Intune Management Extension\Microsoft.Management.Services.IntuneWindowsAgent.exe" | findstr /i Sync
Windows Sysinternals strings usage to identify arguments

Et voilà – here we go! You can see a string found in the output:

intunemanagementextension://syncapp

So give it a try by running it from the user session via the Run dialog:

Windows Run dialog to trigger IME sync

Monitoring the log file gives us the evidence that the command actually triggered a Sync, it raised the signal to the service:

Intune Management Extension (IME) log file starting sync process

This gives us a convenient way to start the sync process for the IME just by execution a command. As the command is a URL Moniker we have to call it via the Windows Shell like seen above with the Run dialog [Win] + [R]. If we want to call this from a PowerShell script we can do this by executing this snippet:

$Shell = New-Object -ComObject Shell.Application
$Shell.open("intunemanagementextension://syncapp")

Summary

I have shown a technique how to find unknown command line arguments, which also might reveal other options like the Moniker Provider we have seen here. This approach can also be used to find install commands/parameters for setup executables for examples. Finally with that approach we have found a way to easily trigger IME Sync process via “intunemanagementextension://syncapp“.

Happy syncing!