25,117 questions
Hi @Kasumu, Abimbola ,
maybe this helps to get started
CSV-File (AzureADgroups.csv)
GroupName,GroupOwner
groupPeter,******@yourdomain.net
groupPaul,******@yourdomain.net
PowerShell Script (installed AzureAd PowerShell module required):
Import-Module AzureAD
Connect-AzureAD
Import-Csv -Path "Junk\AzureADgroups.csv" | ForEach-Object {
$ownerUserObj = Get-AzureADUser -ObjectId ($_.GroupOwner).Trim()
$AADgroupObj = Get-AzureADGroup -SearchString ($_.GroupName).Trim()
Add-AzureADGroupOwner -ObjectId $($AADgroupObj.ObjectId) -RefObjectId $($OwnerUserObj.ObjectId)
}
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten