Forum Discussion
therealkristaps
Jun 17, 2021Copper Contributor
Multiple values to -ObjectId ?
Hello world,
I am little bit concerned about whether I can add multiple values to -ObjectId as in the example below? I need to test this in production, but I am a bit unsure. Here's a part of the code:
Connect-AzAccount -Credential $ADDcredentials -Subscription '*****-*****-*****-*****'
$ADDmembers = Get-AzADGroupMember -ObjectId "*****-*****-*****-*****"
return $ADDmembers
The question is if I can add multiple values somehow to object ID?
Thanks a lot in advance.
2 Replies
Sort By
- SchnittlauchSteel ContributorHi therealkristaps ,
Welcome to the MTC!
I would try it with foreach. Just put the values in a csv.
I have never try it. Anything like this:
Foreach ($testobject in $ImportOfObjectIDs) {Get-AzADGroupMember -ObjectId "$testobject")
Try it yourself, if you don't reach more, write a small comment.
Schnittlauch- therealkristapsCopper ContributorSchnittlauch Thanks a lot 🙂 Will try this out.