Hi Team,
I need to hide(disable) the"Disable view selector menu","Disable 'Save This View' button","Display search box" property in the "Miscellaneous" section Document library view web part properties options using power shell script.Please let me know how we can disable these properties from document library view page web part using script . I have tried the below code and not able to get the exact web part property names for this options.
$snapin = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
if ($snapin -eq $null)
{
Write-Host "Loading SharePoint Powershell Snapin"
Add-PSSnapin "Microsoft.SharePoint.Powershell"
}
$webpartproperty ="Send first row to connected Web Parts when page loads"
$currentsite= Get-SPSite "SiteCollectionName"
$SPWeb = $currentsite.OpenWeb()
$page = $SPWeb.GetFile("DocumentLibraryName/Forms/All%20Jobs%20Details.aspx")
## $page.CheckOut()
$webpartmanager = $SPWeb.GetLimitedWebPartManager("DocumentLibraryName/Forms/All%20Jobs%20Details.aspx",[System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
for($i=0;$i -lt $webpartmanager.WebParts.Count;$i++)
{
if($webpartmanager.WebParts[$i].title -eq "DocumentLibraryName")
{
$wp=$webpartmanager.WebParts[$i];
##$temp = $wp.SchemaXml;
$wp.ChromeType="TitleAndBorder";
##Save changes to webpartmanager. This step is necessary. Otherwise changes won't be reflected
$webpartmanager.SaveChanges($wp);
break;
}
}
Thank you,
Mylsamy