Forum Discussion
Yallos
Jun 17, 2022Copper Contributor
How to Bulk rename Security groups on AAD
Hi Team, I'm trying to rename over 100 Azure security groups using PowerShell but I just can't get the script to work without errors. I want to add "NG" to the output of the GetAzADGroup command # ...
- Jun 17, 2022
The ForEach needs a small correction
You wroteForEach{Set-AzureADGroup -ObjectID $.objectid -Displayname $.displayname}
The $.ObjectID should be $_.ObjectID
Also the $.Displayname should be $_.DisplayName
farismalaeb
Jun 17, 2022Iron Contributor
The ForEach needs a small correction
You wrote
ForEach{Set-AzureADGroup -ObjectID $.objectid -Displayname $.displayname}
The $.ObjectID should be $_.ObjectID
Also the $.Displayname should be $_.DisplayName
Yallos
Jun 17, 2022Copper Contributor
farismalaeb Thanks a lot for your input. One of those days you know.
Issue resolved
Import-Csv -Path C:\Users\Prince\Downloads\"exportGroup_2022-6-15.csv"| ForEach{Set-AzureADGroup -ObjectID $_.Objectid -Displayname $_.displayname}