Forum Discussion

EdSchreibman's avatar
EdSchreibman
Copper Contributor
Jun 24, 2021
Solved

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-AzureADDirectoryRoleMember , I think I'm missing how to add "" somewhere in "-ObjectId $admins.ObjectId"?

code:

$admins = Get-AzureADDirectoryRole | where{$_.displayname -like "*administrator"}
Get-AzureADDirectoryRoleMember -ObjectId $admins.ObjectId

 

 

3 Replies

No RepliesBe the first to reply

Resources