Apr 19 2019
07:08 AM
- last edited on
Jan 14 2022
04:39 PM
by
TechCommunityAP
Apr 19 2019
07:08 AM
- last edited on
Jan 14 2022
04:39 PM
by
TechCommunityAP
I'm trying to use the Get-AzureADusers command to get the following fields into a csv file:
NAME,ENABLED, OS, VERSION, JOIN, TYPE, OWNER, USER NAME, MDM, COMPLIANT, REGISTERED, ACTIVITY
I keep getting an error that its not valid value but I can see those values in the Azure view.
TIA
#AzureAD
Apr 19 2019 10:53 AM
Might help if you give us the exact cmdlet you are running. The properties you've listed seem to correspond to device objects, not users...
Apr 22 2019 11:06 AM
Hi Faiza!
You probably need to use a combination of cmdlets to get that data.
#Get All Devices
$devices = Get-AzureADDevice -All $true
For each device you can use Get-AzureADDeviceRegisteredUser or Get-AzureADDeviceRegisteredOwner to get the person associated with it.
Apr 23 2019 06:21 AM
@joshuatoonGood to hear from you!
I'm running the Get-AzureADDevice -all but only get the ObjectID, DeviceID, Displayname
in the Azure portal under Azure Active Directory - Devices I can see the following:
Apr 23 2019 09:59 AM
@Faiza Qadri as Joshua wrote combination of cmdlets should work in your case (Get-AzureADDevice, Get-AzureADDeviceRegisteredOwner).
Another alternative is to use old cmdlet which still works:
get-msoldevice -All -ReturnRegisteredOwners | ft DisplayName,Enabled,DeviceOsType,DeviceTrustType,DeviceTrustLevel,RegisteredOwners,ApproximateLastLogonTimestamp
But this doesn't return the compliant information. One method to list compliant status could be to list all devices via Graph API (https://developer.microsoft.com/en-us/graph/graph-explorer):