0

how connect in sharepoint management shell of 1 site only without an access in https://org-admin.sharepoint.com, I have an site collection admin in 1 site of this sharepoint and i need to connect it in sharepoint management shell to remove content type under in _Hidden Group thanks.

0

Yes, you could do that.

Demo PowerShell code for your reference:

$adminUPN="xxx@xxx.onmicrosoft.com"

$userCredential = Get-Credential -UserName $adminUPN -Message "xxx"

Connect-PnPOnline -Url https://xxx.sharepoint.com/sites/wendy -Credentials $userCredential

#Get content type from _Hidden group
Get-PnPContentType|? { $_.Group -eq '_Hidden' }
#remove "ContentType1" content type
Remove-PnPContentType -Identity "ContentType1" -Force

Get-PnPContentType|? { $_.Group -eq '_Hidden' }

Note: $adminUPN could be just the site collection administrator of site collection, in my test, it could work well.

Result: enter image description here enter image description here

  • It's work Thanks a lot Kally have a great day ^_^ – Randy Prado Jul 10 at 8:27
  • I am glad to help you, please remember to accept my reply as answer.:) – Kally_MSFT Jul 10 at 9:39

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.