Forum Discussion

Yallos's avatar
Yallos
Copper Contributor
Jun 17, 2022
Solved

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 # ...
  • farismalaeb's avatar
    Jun 17, 2022

    Yallos 

    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

Resources