Forum Discussion
Get Azure Joined Device Information using PowerShell
I like to capture as much information on an Azure Join device using Powershell. Some of the information I looking to capture can be found in "Intune for Education" --> Device --> Go to Device Detail.
Not limited to the information below.
I tried using what GitHub had for Intune (https://github.com/microsoft/Intune-PowerShell-SDK) but couldn't get it to work.
Any help would greatly be appreciated.
Thank You,
-Larry
6 Replies
- bjclsBrass Contributor
EntilZha I'm glad I could help!
If you use the 'beta' schema instead of 'v1.0' (https://github.com/Microsoft/Intune-PowerShell-SDK#known-issues-and-workarounds) and you run the same command: Get-IntuneManagedDevice an extra value: usersLoggedOn is shown.
Update-MSGraphEnvironment -SchemaVersion 'beta'
This value shows an ID that you can lookup with the command: Get-AzureADUser -ObjectId
For your second question I've used a Graph API call, because I didn't find a command in this module:
$apiUrl = "https://graph.microsoft.com/beta/devices/$Deviceid/memberof"
$Data = Invoke-RestMethod -Headers @{Authorization = "Bearer $($Tokenresponse.access_token)" } -Uri $apiUrl -Method Get
$DeviceGroups = ($Data | select-object Value).ValueOr you could check the members of a group: Get-AADGroupMember instead of the group membership.