sharepoint shell 设置列表字段属性

--连接站点

Connect-PnpOnline -url http://dvt193:112

--修改属性

Set-PnPField -List "权限测试" -Identity "权限栏目" -Values @{$ShowInViewForms = $false}

$list=get-pnplist -Identity 权限测试 set-pnpfield -List $list -identity 权限栏目 -Values @{Required="true"}

字段显示属性找不到,可以使用shell脚本设置

#Get the web, list and column objects
$web = Get-SPWeb http://dvt193:112
$list = $web.Lists["权限测试"]
$column = $list.Fields["权限栏目"]

#Change the ShowInEditForm property and update objects
$column.ShowInDisplayForm = $false
$column.ShowInNewForm = $false
$column.ShowInEditForm = $false
$column.Update()
$list.Update()
$web.Dispose()




#Get the web, list and column objects
$web = Get-SPWeb http://dvt193:85
$list = $web.Lists["公司列表模板new"]
$column = $list.Fields["发布时间"]
$column1 = $list.Fields["审批时间"]
$column2 = $list.Fields["审批人"]

#Change the ShowInEditForm property and update objects
$column.ShowInDisplayForm = $false
$column.ShowInNewForm = $false
$column.ShowInEditForm = $false
$column1.ShowInDisplayForm = $false
$column1.ShowInNewForm = $false
$column1.ShowInEditForm = $false
$column2.ShowInDisplayForm = $false
$column2.ShowInNewForm = $false
$column2.ShowInEditForm = $false
$column.Update()
$column1.Update()
$column2.Update()
$list.Update()
$web.Dispose()

猜你喜欢

转载自www.cnblogs.com/520yun/p/9052321.html
今日推荐