Last active
April 28, 2024 11:29
-
-
Save alexverboon/b60550b381fafdb39be0dc1e6c1e4875 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get Entra ID Device Info around registration and Management | |
# Devices with ManagementType 'MicrosoftSense' are managed with MDE Settings Management. | |
# Devices with OperatingSystem 'Windows Server' are also managed by MDE settings management | |
$Result = [System.Collections.ArrayList]::new() | |
$AllDevices = Get-MgDevice -All | |
foreach ($Device in $AllDevices) { | |
$DeviceDetail = $Device.AdditionalProperties | |
$object = [PSCustomObject]@{ | |
DeviceName = $Device.DisplayName | |
ManagementType = $DeviceDetail.managementType | |
enrollmentType = $DeviceDetail.enrollmentType | |
SystemLabels = $Device.Systemlabels | |
IsManaged = $Device.isManaged | |
TrustType = $Device.trustType | |
DeviceId = $Device.DeviceId | |
OperatingSystem = $Device.OperatingSystem | |
OperatingSystemVersion = $Device.OperatingSystemVersion | |
} | |
[void]$Result.Add($object) | |
} | |
$Result | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment