3

I am using SharePoint 2016 and want to hide created, created by, modified and modified by fields. This is in the document library view and not the new, edit or display forms (i.e. if you click on a Documents document library).

I need to do it via Powershell as part of a migration script but have had no luck. Can anyone assist?

Many thanks!

0

Remove Field from View using PowerShell in SharePoint for your reference:

http://www.sharepointdiary.com/2015/11/remove-field-from-view-in-sharepoint-using-powershell.html

  • You can add details from the link. Links may break in future, content in your answer will add value. – Asad Refai Aug 1 '18 at 6:16
0

You can remove columns out of a view by powershell.

Copy this code and paste to a text file you rename to filename.ps1.

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue
$web = Get-SPWeb https://siteurl
$list = $web.Lists["put list name here"];
$view = $list.Views | ? { $_.Title -eq 'All items' }
$view.ViewFields.delete(created)
$view.ViewFields.delete(modified)
$view.Update()

The script gets web -> list -> view. Then it removes ceated and modified from the view. You can add more columns as you want. With update it updates the list.

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.