2

When I programmatically change the title of a group-based site using PowerShell, the site gets the new name, but the associated Microsoft 365 group does not. Furthermore, when you log in to the site, it shows up with the new name for a while, and then reverts to the old name, as if you had not changed the site name (sync back worked). What i tried:

  • Set-PnPWeb -Title "<new site title"
  • Set-PnPTenantSite -Title "<new site title"

Here are steps and screenshots: enter image description here 1 - I changed group-based site title (added [renamed] suffix) 2 - loaded site - new name appears correctly 3 - checked AAD - group is not renamed 4 - checked m365 admin center - group is not renamed 5 - in Teams desktop app team name is not renamed 6 - went to site information - it's old (original) name. Cancel (did not save it). 7 - refresh browser - site new title is gone

I tried delegated and application credentials, I tried to wait 24 hours after renaming - all the same - new site title is not propagated to Microsoft 365 group or team name.

When I change the site title with GUI (gear box->site information) - it works ok, i.e. new site title is propagated to the group/team display name.

I did not find anything on Microsoft on the problem.

Can anyone confirm the same behavior or does anybody know if this is expected or not. I know the solution would be just to rename the group (or team)... But due to some circumstances I need to change site title.

2
  • I can confirm the issue - I was able to repeat steps and observe the same behavior... Commented Aug 24 at 11:50
  • 1
    This is by design. Let me complete research so I can provide more details. Commented Aug 28 at 12:50

2 Answers 2

1

It seems like for group sites "site title" is only propagating from group name down to site name. I talked to Microsoft and they confirmed that this is by design. They shared a sequence of API calls when you rename site with GUI - the first call is to update group name, and then group properties are synchronized to site. I was able to track it also and write an article.

enter image description here

But when you are updating site title programmatically - you are updating just site title, and no wonder it reverts to the original one when group properties are synchronized back to site. So this is expected behavior.

The only correct way to update team-connected SharePoint site title (and any group-based site) programmatically - is to update the group first:

Set-PnPMicrosoft365Group -Identity $group -DisplayName "New Site Title"

or to update connected team:

Set-PnPTeamsTeam -Identity $team -DisplayName "New Site Title"
0

Do you mean when you change the name of the site, but the names of the Members, Owners, Visits, etc. groups still keep the old site name?

If yes, then this is the default behavior for SharePoint, as SharePoint's PowerShell doesn't seem to change all the site names exactly. I did a test and even though I changed the name of the site, it still showed the old name in the site information. enter image description here

However, if you change it through the UI, it will change all the places where the site name is used. So it's better to modify the site name through the UI.

1
  • Hi Karley, thanks for prompt response, but no - I did not mean SharePoint groups, I meant Microsoft 365 group (and team display name).
    – Janet
    Commented Aug 23 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.