Reputation: 27
I was using
https://graph.windows.net/aaa2a672-ae0e-4ac3-9aec-xxxxxx/groups?api-version=1.6&$filter=displayName%20eq%20'kevingroup2'
to get data of kevingroup2
The response was
{ "odata.metadata": "https://graph.windows.net/aaa2a672-ae0e-4ac3-9aec-xxxx/$metadata#directoryObjects", "value": [ { "odata.type": "Microsoft.DirectoryServices.Group", "objectType": "Group", "objectId": "b5685a42-1de7-478d-94b4-de50ac9a2222", "deletionTimestamp": null, "description": "kevin group 2", "dirSyncEnabled": null, "displayName": "kevingroup2", "lastDirSyncTime": null, "mail": null, "mailNickname": "d6460146-0", "mailEnabled": false, "onPremisesDomainName": null, "onPremisesNetBiosName": null, "onPremisesSamAccountName": null, "onPremisesSecurityIdentifier": null, "provisioningErrors": [], "proxyAddresses": [], "securityEnabled": true } ] }
How do I extract objectId of the record?
Thanks!
Upvotes: 0
Views: 237
Reputation: 15754
You just need to use the api with the filter as below:
https://graph.windows.net/xxxxxxxxx/groups?$filter=displayName eq 'kevingroup2'&$select=objectId
By the way, Microsoft recommends customers to use microsoft graph rather than azure ad graph. So you can refer to this microsoft graph api to get the groups.
Upvotes: 0