Usage
m365 aad administrativeunit member list
Description
Retrieves members (users, groups, or devices) of an administrative unit
Options
| Option |
Description |
-i, --administrativeUnitId [administrativeUnitId] |
The id of the administrative unit. Specify either administrativeUnitId or administrativeUnitName. |
-n, --administrativeUnitName [administrativeUnitName] |
The name of the administrative unit. Specify either administrativeUnitId or administrativeUnitName. |
-t, --type [type] |
When specified, the command returns only objects of specified type. Allowed values are user, group and device. |
-p, --properties [properties] |
Comma-separated list of properties to retrieve. |
-f, --filter [filter] |
OData filter to use to query the list of members with. Applied only when type is specified. |
Examples
List members of an administrative unit specified by its id
m365 aad administrativeunit member list --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7
List members of an administrative unit specified by its id. For each one return the id and the displayName
m365 aad administrativeunit member list --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7 --properties 'id,displayName'
List members of an administrative unit specified by its name
m365 aad administrativeunit member list --administrativeUnitName 'Marketing Division'
List users of an administrative unit specified by its id
m365 aad administrativeunit member list --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7 --type user
List users of an administrative unit specified by its id that are guest users
m365 aad administrativeunit member list --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7 --type user --filter "userType eq 'Guest'"
List groups of an administrative unit specified by its id
m365 aad administrativeunit member list --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7 --type group
List groups of an administrative unit specified by its id and include owners names
m365 aad administrativeunit member list --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7 --type group --properties 'id,displayName,owners/displayName'
List devices of an administrative unit specified by its id
m365 aad administrativeunit member list --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7 --type device
List devices with linux operating system of an administrative unit specified by its id
m365 aad administrativeunit member list --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7 --type device --filter "operatingSystem eq 'linux'"
Default properties
Additional Info
https://learn.microsoft.com/en-us/graph/api/administrativeunit-list-members?view=graph-rest-1.0&tabs=http
The endpoint supports OData cast, you can cast to get either only users, groups or devices. To support casting, set an option type with one of possible values user, group and device.
For large administrative units, the casting can be useful and expected by the end-users.
Response output formatting
To know which item in the response array is what type, we'll add our own property based on the odata metadata.
"@odata.type": "#microsoft.graph.device" becomes "type": "device".
I will work on this
Usage
m365 aad administrativeunit member list
Description
Retrieves members (users, groups, or devices) of an administrative unit
Options
-i, --administrativeUnitId [administrativeUnitId]administrativeUnitIdoradministrativeUnitName.-n, --administrativeUnitName [administrativeUnitName]administrativeUnitIdoradministrativeUnitName.-t, --type [type]user,groupanddevice.-p, --properties [properties]-f, --filter [filter]typeis specified.Examples
List members of an administrative unit specified by its id
List members of an administrative unit specified by its id. For each one return the id and the displayName
m365 aad administrativeunit member list --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7 --properties 'id,displayName'List members of an administrative unit specified by its name
m365 aad administrativeunit member list --administrativeUnitName 'Marketing Division'List users of an administrative unit specified by its id
List users of an administrative unit specified by its id that are guest users
m365 aad administrativeunit member list --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7 --type user --filter "userType eq 'Guest'"List groups of an administrative unit specified by its id
List groups of an administrative unit specified by its id and include owners names
m365 aad administrativeunit member list --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7 --type group --properties 'id,displayName,owners/displayName'List devices of an administrative unit specified by its id
List devices with linux operating system of an administrative unit specified by its id
m365 aad administrativeunit member list --administrativeUnitId 03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7 --type device --filter "operatingSystem eq 'linux'"Default properties
Additional Info
https://learn.microsoft.com/en-us/graph/api/administrativeunit-list-members?view=graph-rest-1.0&tabs=http
The endpoint supports OData cast, you can cast to get either only users, groups or devices. To support casting, set an option
typewith one of possible valuesuser,groupanddevice.For large administrative units, the casting can be useful and expected by the end-users.
Response output formatting
To know which item in the response array is what type, we'll add our own property based on the odata metadata.
"@odata.type": "#microsoft.graph.device"becomes"type": "device".I will work on this