Hello @Cai, Xiaoxiao/蔡 筱筱 ,
You can use below Microsoft Graph API to get group members and selected properties such as companyName.
GET https://graph.microsoft.com/v1.0/groups/{group-id}/members?$select=userPrincipalName,companyName,assignedLicenses
Equivalent Graph PowerShell:
Import-Module Microsoft.Graph.Groups
Get-MgGroupMember -GroupId $groupId -Property "userPrincipalName,companyName,assignedLicenses"
Additional reference:
group-list-members
msgraph-sdk-powershell
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".