Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Azure AD Powershell help

$
0
0

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
}


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>