简体   繁体   中英

How to get Azure join date and account that joined?

Hi I am trying to get through powershell the Join Date for all our Azure AD only devices and if possible the account that joined the device?

Get-AzureADDevice and $_.DeviceTrustType do not hold this information.

Dsregcmd only holds registered date - I am hoping to get the actual AD Azure join date and account. Thanks

I tried to reproduce the same in my environment and got the below results:

I have one Azure AD joined device in my directory like below:

在此处输入图像描述

To know the device details like join date and account that performed this, you can check Audit Logs like below in Portal:

在此处输入图像描述

Mostly joined date and registered date will be same with seconds' gap.

To get the same details via PowerShell , you can execute below command like this:

Get-AzureADAuditDirectoryLogs | where-object Category -eq "Device" | select activityDisplayName,activityDateTime,InitiatedBy | ft

Response:

在此处输入图像描述

To get full details of specific activity like Register device , you can filter the command like below:

Get-AzureADAuditDirectoryLogs -Filter "activityDisplayName eq 'Register device' " | where-object Category -eq "Device" | fl

Response:

在此处输入图像描述

To get full details of specific activity like Add device , you can filter the command like below:

Get-AzureADAuditDirectoryLogs -Filter "activityDisplayName eq 'Add device' " | where-object Category -eq "Device" | fl

Response:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM