I have 4 custom lists which i want to replicate manually inside another tenant. now i can access the list content type and re-create the columns, but how i can know if the list have any Read-Only fields which will be hidden inside the UI? can i run a power shell script to get all the hide fields inside a list?
2 Answers
You care this:
cls
Import-Module -Name SharePointPnPPowerShellOnline -Verbose
$cred= Get-Credential
#Config Variables
$SiteURL = "https://yourtenant.sharepoint.com/sites/yourSite/"
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Credentials $cred
$list = Get-PnPList -Identity "Contact" #List Name
$fields=Get-PnPField -list $list
$fields.Count #count of all fields
$ReadOnlyfields = $fields | where {$_.ReadOnlyField -eq $True}
$ReadOnlyfields.Count #count of all ReadOnly Fields
#Print out all readonly fields
Foreach($fld in $fields)
{
if($fld.ReadOnlyField -eq $True)
{
Write-Host $fld.Title `t $fld.InternalName `t $fld.Id
}
}
@SharePoint TestDev,
If you want to replicate lists, why not have a try below methods: