Retrieves the User Device Registration events from the device and either save them as a log file to C:\ProgramData\Microsoft\IntuneManagementExtension\Logs (which will be included with the logs files collected with Collect Diagnostics from Endpoint), or specify a file name and path. Be sure to set/update the file extension to xlsx before opening the resulting file.
This script has no dependencies.
Version 1.0: Initial publish.
Version 1.1: Fixed script exiting after installing required module.
Version 1.2: Fixed previous fix in 1.1.