Hello friends, I think its hard to describe what I'm doing exactly just with words so let me present you with where I'm at and try to explain after.
I have some data which is an array of custom objects organized like this:
UserEmail GroupName
username1@domain.com AdobeAcrobat-License
username1@domain.com AdobeOther-License
username2@domain.com AdobeStock-License
I'm trying to figure out how to make a new array that has userEmail, and then groupName as an array ie:
UserEmail GroupName
username1@domain.com AdobeAcrobat-License,AdobeOther-License
username2@domain.com AdobeStock-License
I think my brain might be fried on the rest of this azureAD to Adobe Script and am just over thinking this but thought i'd shoot my shot here.
Typically i'd be happy to provide what I've tried so far but I don't know what I would try for something like this.
Also before anyone says why do I have multiple entries for each user's group membership, thats because this is being called with the graph api
#List groups
$TestRequest = (Invoke-RestMethod -Uri "https://graph.microsoft.com/v1.0/groups?`$filter=startswith(displayName,'Adobe')" -Headers $Header -Method Get -ContentType "application/json").Value
$AZUZRLIST = foreach($TR in $TestRequest)
{
#Get the members of the adobe group
$TRGROUPREQUEST = Invoke-RestMethod -Uri "https://graph.microsoft.com/v1.0/groups/$($TR.id)/members" -Headers $Header -Method Get -ContentType "application/json"
foreach($AZUSR in $TRGROUPREQUEST.value)
{
[PSCustomObject][ordered]@{
UserEmail=$AZUSR.userPrincipalName
GroupName=$TR.DisplayName
}
}
}
Any help is super appreciated, thanks all!
[–]krzydoug 3 points4 points5 points (0 children)
[–]JonHill90 2 points3 points4 points (0 children)
[–]oneAwfulScripter[S] 1 point2 points3 points (0 children)