[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$siteurl = "URL of top-level site"
$site=new-object Microsoft.SharePoint.SPSite($siteurl)
$web=$site.OpenWeb()
$field=$web.Fields.GetFieldByInternalName("Title")
$field.Title = "Title"
$field.Update()
$web.Dispose()
$site.Dispose()
var context = new SP.ClientContext("/serverRelativeUrlOfRootWeb");
var field = context.get_web().get_fields().getByInternalNameOrTitle("Title");
field.set_title("Title");
field.update();
context.executeQueryAsync(
function(){
alert("Field renamed successfully.");
},
function(sender,args){
alert(args.get_message());
}
);
将/serverRelativeUrlOfRootWeb
替换为站点集的根网站的服务器相对URL,以便重命名需要的字段。