Forum Discussion
EdSchreibman
Jun 24, 2021Copper Contributor
Azure Cloud Shell error with string
I get this error: Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'ObjectId'. Specified method is not | supported.' Trying to pass this variable to Get-AzureAD...
- Jun 24, 2021Well there are multiple built-in roles that match your query, so the $admins variable is effectively an array, meaning that $admins.ObjectId is not a string either. This will work:
Get-AzureADDirectoryRoleMember -ObjectId $admins[0].ObjectId
and repeat for each group.
VasilMichev
Jun 24, 2021MVP
Well there are multiple built-in roles that match your query, so the $admins variable is effectively an array, meaning that $admins.ObjectId is not a string either. This will work:
Get-AzureADDirectoryRoleMember -ObjectId $admins[0].ObjectId
and repeat for each group.
Get-AzureADDirectoryRoleMember -ObjectId $admins[0].ObjectId
and repeat for each group.
EdSchreibman
Jun 29, 2021Copper Contributor
Perfect. Thanks