Hi,
I need to add Description and add azure group owner of 150 Azure Ad group with every group has a different description and different owner , I created a CSV with userprinciplename and groupname .. Userprinciplename is the users
i tried to create a script but unfortunately it don't work any help will be appreciated below is the one i don't get the variable of
Groupobject ..
$users= Import-Csv "C:\azurergroupowner.csv" | ForEach-Object {$userobject= (Get-AzureAduser -ObjectId $_.userprincipalname).ObjectId
}
$Groupobject = (Get-AzureAdgroup -ObjectId $_.displayname).ObjectId
Add-AzureADGroupOwner -ObjectId $Groupobject -RefObjectId $userobject
}