Powershell-遍历特定网站集&将索引列分配给特定列表 [英] Powershell - Loop through specific site collections & assign Index Column to specific lists

查看:69
本文介绍了Powershell-遍历特定网站集&将索引列分配给特定列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Powershell,我要遍历Web应用程序中具有特定托管路径的所有网站集,然后遍历两个特定列表,并为这些列表分配索引列.

Using Powershell, I want to loop through all site collections having specific Managed Path in a Web Application and then two specific Lists and assign Index Column of those Lists.

我知道如何通过下面的代码创建列索引,但是如何像上面那样遍历?任何建议都是可取的.

I got to know how to make column index by below code but how to traverse like above? Any suggestion would be appreciable.

$web = Get-SPWeb http://sharepoint

$spList =
$web.Lists["ListName"]

$spField =
$spList.Fields["FieldName"]

$spField.Indexed = $true

$spField.Update()


推荐答案

检查这个真实的示例,如何迭代所有站点,子站点...

check this real example how to iterate all sites, subsites...

http://www. sharepointdiary.com/2012/06/iterate-through-webapps-sitecollections-sites-lists-listitems.html


这篇关于Powershell-遍历特定网站集&将索引列分配给特定列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆