[FEATURE] Sync-PnPSharePointUserProfilesFromAzureActiveDirectory and Get-PnPUPABulkImportStatus - Add Timestamp information
Is your feature request related to a problem? Please describe. Not related to a problem, just improvement
Describe the solution you'd like Once a new Sync job is created, it should register the creation timestamp, and its completion timestamp, this information will accompany each entry retrieved by Get-PnPUPABulkImportStatus - two new fields: CREATED and COMPLETED
Inspecting the queues with Get-PnPUPABulkImportStatus only provides basic information without any time context for the activity, having timestamps will improve auditing and further options for automating queues results, specially to measure performance with the time spent from CREATION to COMPLETION, today this command simply list the queue and you can't tell when each entry was created and then completed, and how much time was spent in each entry (imagine if you are testing different sync using queries with different options, today I measure more or less with a stop watch), the ideal is having this information on each entry.
I would like very much to have an output like this:
`Error : NoError ErrorMessage : JobId : 964acc7e-43b7-4599-b58b-26b2ede51231 LogFolderUri : SourceUri : https://tenant.sharepoint.com/teams/Sites/UPS/userprofilesyncdata-20220429035223-c0554e49d6494f66974968c6bc780baf.json State : Succeeded Context : Microsoft.SharePoint.Client.ClientContext Tag : Path : ObjectVersion : ServerObjectIsNull : False TypedObject : Microsoft.Online.SharePoint.TenantManagement.ImportProfilePropertiesJobInfo Created : 30/04/2022 18:40 pm Completed : 30/04/2022 19:20 pm
Error : NoError ErrorMessage : JobId : 110892d0-ab17-4d1e-a9df-567840bxbd12 LogFolderUri : SourceUri : https://tenant.sharepoint.com/teams/Sites/UPS/userprofilesyncdata-20220429061417-b0d0de4ebda64799b179a5a7db4403f0.json State : Succeeded Context : Microsoft.SharePoint.Client.ClientContext Tag : Path : ObjectVersion : ServerObjectIsNull : False TypedObject : Microsoft.Online.SharePoint.TenantManagement.ImportProfilePropertiesJobInfo Created : 24/04/2022 23:40 pm Completed : 25/04/2022 01:20 am`
Describe alternatives you've considered Right now the only way to tell when an entry was created is the timestamp of the file in the document library - but it is not reliable information, files are created in the later stage of the sync process.
Additional context Just adding timestamps will significantly improve things! Maybe allowing custom TAGs could be next :)
I like your suggestion @MrDrSushi . The challenge we have with doing something like this is that currently we are just calling into SharePoint through CSOM to get the bulk import status and pass it near 1 on 1 to the output of the cmdlet. Surely we could enrich the output with timestamps, but where would we have to persist this information? It feels to me like this would be more of a design change request to the SharePoint Online Product Group than it would be for the PnP PowerShell team.
The place to request this from the Product Group would be through the Microsoft Feedback portal. In all honesty, I give it very little chance it will be applied by the PG, but then again, if you don't try, you don't win.
Let me know in case you disagree and believe there would be options for PnP PowerShell to store this information in a generic way.
Thanks KoenZomers! Now I understand the challenge behind of my suggestion, I really thought it was something simple to be captured with current timestamps during the queues, but I'm glad you did explain in detail what is happening behind the curtains, this is one of those things that only sounds easy but the reality is far scarier, thanks for the explanation! I will follow with your suggestion and leave a comment on the Microsoft Feedback portal.
This suggestion came out after examining too many entries from syncs, it was impossible to tell them apart, I'm really glad with your response, thank you so much for your response!
You're welcome. It can be challenging indeed to match them. In general what I do is that the last status returned is the one of the last job submitted, so if you do Get-PnPUPABulkImportStatus | Select -Last 1, you will always have the most recent one. Moreover, when submitting a new import job, either manually or through the Sync-PnPSharePointUserProfilesFromAzureActiveDirectory cmdlet, it should return the Id of the job that was created for it. With this Id, you can link it back to the appropriate entry in Get-PnPUPABulkImportStatus, so you could consider keeping some kind of record of the jobs you submit in i.e. a SharePoint list.