How to list a specific event under User Device Registration Event Log

T Crha 396 Reputation points
2023-03-06T14:24:54.5066667+00:00

Hello,

I am trying to troubleshoot issues with workstation Azure hybrid join, and I need to look for specific events within that particular workstation (while connected remotely via PSSession).

If I use this:

(Get-WinEvent -ListProvider 'Microsoft-Windows-User Device Registration').Events

I am able to see a list of events related to Azure and MDM and so on, but I am not able to modify the cmdlet so it gives me the exact time of the event, along with its count.

Can you please help me to find out how to list those events along with the time they were actually logged?

Thank you,

Tomas

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,751 Reputation points
    2023-03-07T15:22:46.2033333+00:00

    Hello there,

    You can use the below PowerShell script to Compare the Time of an Event generated with the Current time.

    $timeGenerated=(get-WinEvent @{LogName='Microsoft-windows-International/operational';id=1001} -maxevents 1).TimeGenerated

    $diffMinutes=(New-TimeSpan $timeGenerated (Get-Date)).TotalMinutes

    You can also use the Get-EventLog cmdlet gets events and event logs from local and remote computers. By default, Get-EventLog gets logs from the local computer. To get logs from remote computers, use the ComputerName parameter.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer–


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.