I need to create a modern dashboard which can show the status of DB maintenance was run, and DB was archived
This may help you get started: It shows the start and end time in the last 24 hours of a maintenance cycle. It's in SQL, just change it to SWQL
SELECT TOP 2 [Message],[EventTime] As 'Event Time' FROM [dbo].[Events]WHERE [Message] LIKE '%Nightly Maintenance%' AND [EventTime] >= DATEADD(hh, -24, GETDATE()) --last y daysORDER BY EventTime DESC