question

HarikrishnanP-2692 avatar image
0 Votes"
HarikrishnanP-2692 asked HarikrishnanP-2692 commented

Usage of Add-PnPContentTypesFromContentTypeHub

Hi,

Has anybody tried using the new command Add-PnPContentTypesFromContentTypeHub to sync content types from the hub to the site collection? I tried to use this command as per the documentation. But I'm getting an error as below.

Add-PnPContentTypesFromContentTypeHub : The type of data at position 249 is different than the one expected.
At line:1 char:1
+ Add-PnPContentTypesFromContentTypeHub -ContentTypes $list -Connection ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Add-PnPContentTypesFromContentTypeHub], InvalidOperationException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.ContentTypes.AddContentTypesFromContentTypeHub

office-sharepoint-onlinewindows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered CallumCrowley commented

Hello @HarikrishnanP-2692

I may recommend you to give a read to the sintex changes in SharePoint published last month. The "write error" seems like the input is not as expected.

Check: https://techcommunity.microsoft.com/t5/sharepoint-syntex/syntex-product-updates-august-2021/ba-p/2606438

Hope this helps you,
Best regards

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I'm experiencing the exact same issue. I have implemented the PowerShell exactly as described and this was working up until the end of last week. I tried running the cmdlet this morning and it is throwing this error. It's not clear if it is adding the content types to the site, despite throwing the error.

1 Vote 1 ·

Its not saying about any syntax changes related to the command. I have tried the same code published in PnP Github,but that also not working

$list = New-Object Collections.Generic.List[string]
$list.Add('0x0101')
$list.Add('0x01')
Add-PnPContentTypesFromContentTypeHub -ContentTypes $list

0 Votes 0 ·
CallumCrowley avatar image CallumCrowley HarikrishnanP-2692 ·

It's not an issue with our implementation of the cmdlet, I think it's a problem with the underlying CSOM unfortunately, as described in the GitHub issue:

https://github.com/pnp/powershell/issues/1080

0 Votes 0 ·
HarikrishnanP-2692 avatar image
0 Votes"
HarikrishnanP-2692 answered CallumCrowley commented

I even tried in Azure runbook, I was getting the same error. We are using some content types based logic in the script,so according to Microsoft auto-syncing of content type will stop this month. So this is very critical .

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Agreed, this is very important to our project and we've implemented the cmdlet under the assumption that it is production ready.

1 Vote 1 ·
YiLu-MSFT avatar image
0 Votes"
YiLu-MSFT answered CallumCrowley commented

Hi @HarikrishnanP-2692
Since I could not search any documents to explain this issue, I suggest you could open a service request in Microsoft 365 admin center for better help.
131082-image.png



If an Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (24.7 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

This isn't an individual tenant problem, it's affecting multiple tenants. Surely this has to be raised through a different channel?

The issue is with Microsoft.SharePointOnline.CSOM as described by those attempting to use PnP.PowerShell (which relies on this library):

https://github.com/pnp/powershell/issues/1080

0 Votes 0 ·
HarikrishnanP-2692 avatar image
0 Votes"
HarikrishnanP-2692 answered HarikrishnanP-2692 commented

I have raised a ticket with Microsoft. They said PnP is not an MS product, so they can't do the support for the same. It's interesting that MS only suggested using this command. Considering that its only 2 weeks left to stop the automatic synchronization, it's really frustrating.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Surely if the underlying CSOM is causing the issue, this is indeed a problem Microsoft will need to address?

0 Votes 0 ·

Yes, but they simply responded in this way. Based on the confirmation, they will not be immediately stopping automatic content type synchronization this month. It might be due to this error even though they are not agreeing on it.

0 Votes 0 ·