Skip to content

Instantly share code, notes, and snippets.

@alexverboon
Last active April 28, 2024 11:29
Show Gist options
  • Save alexverboon/b60550b381fafdb39be0dc1e6c1e4875 to your computer and use it in GitHub Desktop.
Save alexverboon/b60550b381fafdb39be0dc1e6c1e4875 to your computer and use it in GitHub Desktop.
# 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