Forum Discussion

EntilZha's avatar
EntilZha
Iron Contributor
May 13, 2020

Microsoft Graph: The property is missing a required prefix/suffix......

Trying to change the Display Name on a group using Graph in a PowerShell script. When I execute the script I receive the following error:

"The property is missing a required prefix/suffix per your organization's Group naming requirements."
From my reading if I have the permission Directory.ReadWrite.All, it should override the policy.

This policy was design that when a user creates a Team we prefix the created Group/Team's Display Name with the user's department number. 

 

Looking for a solution to this problem, this is our first annual end of cycle and I'm require to change over 1000 groups display name. I rather use Graph then powershell cmdlets to change the Display Name.

 

excerpt of the script: 

$URI = "https://graph.microsoft.com/v1.0/groups/xxxxxxxx-xxxx-xxxx-xxxx-xxGROUPx"

 

$NewName = @{
"description" = "EOSY - 2-D Studio Art 1-06-37"
"displayname" = "EXP_19-20 - 2-D Studio Art 1-06-37"
} | ConvertTo-Json

 

$Results = Invoke-RestMethod -Method PATCH -Uri $URI -Headers $Header -Body $NewName -ContentType 'application/json'

Permissions on Application:

 

 

Thank you for any help in this matter.

 

-Larry

 

  • Where did you see that statement about Directory.ReadWrite.All? And does it apply to both application and delegated permissions? 

    • EntilZha's avatar
      EntilZha
      Iron Contributor

      VasilMichev 

       

      Never found it on any Microsoft site, found that information on couple of the many website I searched looking for a solution. 

       

      My next plan is to see if I add a global admin credential to my Invoke-RestMethod -Credential $Cred would allow me to change Display Name.

       

      Thank You for responding.

       

      -Larry

       

       

      • StephanGee's avatar
        StephanGee
        Steel Contributor

        EntilZha 

        Did you find a solution? We also have a naming convention in place and want to create Teams by the API without following the naming convention of all the other users.

Resources