0

I know you can change a content type name for an existing list using PowerShell for SharePoint On-premises versions, but I don't see any documentation for SharePoint Online. Does anyone have a link to the documentation if it exists? If the documentation does not exist, is it possible to do it so via PowerShell or any other method for that matter?

0

I tend to use CSOM as I can run it torwards both on prem and online.

It's not PowerShell, but I think it can be easily converted.

Not sure why you would want to rename just the list content type; ideally I would rename it at the site collection level.

public void RenameListContentType(ClientContext context, string listTitle)
{    
    List list = context.Web.Lists.GetByTitle(listTitle);
    ContentType ct = list.ContentTypes.GetById("0x010100F92FB91056B24E40ACCE93A804002EFF001822ADB6403249B6AC60D10F8970E85E0001D97A142CFB4CD1BB0876B3669E30D3007022460F2F2E6C4BB4682EE84C366DF3");
    context.Load(list);
    context.Load(ct);
    context.ExecuteQuery();

    ct.Name = "New ct name";
    ct.Update(false);

    context.ExecuteQuery();
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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