In this installment its time to look at the various cmdlets that have to do with Features. Of course you can look at the UI to do this but its much, much easier to do this powershell and dare I say more fun.

Now keep in mind that this only related to FARM level features, I will cover Sandbox solutions and features next!

Listing features on Farm, Site Collection and Site

The main cmdlet used within powershell to list features is the Get-SPFeature cmdlets. To show all the features on the farm listed by display name and sorted use this:

1 Get-SPFeature | Sort -Property DisplayName

To show all the features on the Farm grouped by scope in a table use:

1 Get-SPFeature | Sort -Property DisplayName, Scope | FT -GroupBy Scope DisplayName

To see all features for a Web Application:

1 Get-SPFeature -WebApplication http://webapplication

To see all features for a Site Collection:

1 Get-SPFeature -Site http://sitecollection

To see all features for a Site:

1 Get-SPFeature -Web http://siteurl

Remember for some more information relating to the features you can use:

1 Get-SPFeature -Web http://siteurl | Format-List

To see all the members that a feature definition has use:

1 Get-SPFeature -Web http://siteurl | Get-Member

Enabling and Disabling Features

To disable and enable features is all pretty easy once again using the Disable-SPFeature and Enable-SPFeature cmdlets but there is a trick. You need the name of the feature folder that contains the actual feature not what is displayed in the UI so be careful:

1 Enable-SPFeature -Identity "Hold" -URL http://url

You can apply this to any Site and Site Collection scoped features.
Obviously to disable a feature just use the same syntax but with the Disable-Feature cmdlet

1 Disable-SPFeature -Identity "Hold" -URL http://url

Remember though that the -Identity is the DisplayName property of the feature, not the text displayed on the UI which is actually retrieved from a resources file.
For example the Document Sets feature looks like below in the SharePoint interface:
But to actually enable it you have to use the following cmdlet:

1 Enable-SPFeature -Identity DocumentSet -URL http://url

Installing and Uninstalling Features

Once again this is pretty straight forward and is really made up of only two cmdlets: Install-SPFeature and Uninstall-SPFeature
To install a feature you need to specify the name of the folder that your feature contains:
1 Install-SPFeature "FeatureFolderName"

To uninstall simply use the same Uninstall-Feature command with the same parameters:

1 UnInstall-SPFeature "FeatureFolderName"
 
 
【原文地址:http://www.sharepointanalysthq.com/2010/09/sharepoint-2010-powershell-feature-cmdlets-2/】

[转]SharePoint 2010 Powershell Feature Cmdlets的更多相关文章

  1. SharePoint 2010 PowerShell 系列 之 备份、还原、部署 .WSP

    转:http://www.cnblogs.com/Fengger/archive/2012/08/24/2654093.html PowerShell系列目录 最近在部署测试环境,就顺便把PowerS ...

  2. sharepoint 2010 powershell

    可参看云总的博客:http://blog.csdn.net/yun_liang1028/article/details/6419729

  3. SharePoint 2010 最佳实践学习总结------第2章 SharePoint Windows PowerShell指南

    第2章 SharePoint Windows PowerShell指南 SharePoint 2010是SharePoint系列产品中第一个开始支持Windows PowerShell的产品,在以前的 ...

  4. Feature Stapling in SharePoint 2010

    http://msdn.microsoft.com/en-us/library/bb861862(v=office.12).aspx http://gallery.technet.microsoft. ...

  5. SharePoint solution and feature management with PowerShell

    /* Author: Jiangong SUN */ Hello, I want to introduce SharePoint solution and feature management usi ...

  6. [SharePoint 2010] SharePoint 2010 部署、收回和删除解决方案----STSADM和PowerShell

    STSADM stsadm -o addsolution –filename c:\bin\CustomerSiteSearch.wsp stsadm -o deploysolution –name ...

  7. SharePoint 2010: Change welcome page on PowerShell

    摘要: SharePoint 2010之后呢, 建立一个 Team Site会有两个 default page, 分别是 Sitepages/home.aspx and default.aspx. 这 ...

  8. 通过PowerShell卸载全部的SharePoint 2010 解决方式

    通过PowerShell卸载全部的SharePoint 2010 解决方式         为了演示.我常常须要拆毁再重建SharePoint 2010 环境.         我常常须要用到的操作就 ...

  9. SharePoint 2010 常用技巧及方法总结

    1.代码调试确定进程cd c:\windows\system32\inetsrvappcmd list wppause注:保存成批处理文件,查看进程.bat,用的时候双击即可 2.类似列表新建打开方式 ...

随机推荐

  1. tf.slice函数解析

    tf.slice函数解析 觉得有用的话,欢迎一起讨论相互学习~Follow Me tf.slice(input_, begin, size, name = None) 解释 : 这个函数的作用是从输入 ...

  2. gcd的性质+分块 Bzoj 4028

    4028: [HEOI2015]公约数数列 Time Limit: 10 Sec  Memory Limit: 256 MBSubmit: 865  Solved: 311[Submit][Statu ...

  3. [BZOJ1911][BZOJ1912][BZOJ1913]APIO2010解题报告

    特别行动队 Description   这个好像斜率优化不是一般地明显了啊...只不过要分a的正负两种情况考虑是维护上凸还是下凸 /********************************** ...

  4. 【Atcoder】AGC 020 D - Min Max Repetition 二分+构造

    [题意]定义f(A,B)为一个字符串,满足: 1.长度为A+B,含有A个‘A',B个'B'. 2.最长的相同字符子串最短. 3.在满足以上2条的情况下,字典序最小. 例如, f(2,3) = BABA ...

  5. IP判断 (字符串处理)

    关于IP合法性判断的题目,每个oj上的约束条件不尽相同,我就根据自己做过的题目吧所有的约束条件汇总到一块,到时候做题时只需要把多余的越是条件删掉即可 题目描述: 对于IP我们总会有一定的规定,合法的I ...

  6. 安装node-sass的正确姿势【转】

    安装 node-sass 的时候总是会各种不成功,今天我琢磨了一会儿总算知道要怎么解决了. 首先要知道的是,安装 node-sass 时在 node scripts/install 阶段会从 gith ...

  7. 面试中关于Java虚拟机(jvm)的问题看这篇就够了

    最近看书的过程中整理了一些面试题,面试题以及答案都在我的文章中有所提到,希望你能在以问题为导向的过程中掌握虚拟机的核心知识.面试毕竟是面试,核心知识我们还是要掌握的,加油~~~ 下面是按jvm虚拟机知 ...

  8. python之supervisor进程管理工具

    supervisor是python写的一个管理进程运行的工具,可以很方便的监听.启动.停止.重启一个或多个进程:有了supervisor后,就不用字节写启动和监听的shell脚本了,非常方便. sup ...

  9. Mysql存储之原生语句操作(pymysql)

    Mysql存储之原生语句操作(pymysql) 关系型数据库是基于关系模型的数据库,而关系模型是通过二维表时实现的,于是构成了行列的表结构. 表可以看作是某个实体的集合,而实体之间存在联系,这个就需要 ...

  10. 016 sleep,wait,yield,join区别

    1.线程通常有五种状态,创建,就绪,运行.阻塞和死亡状态.2.阻塞的情况又分为三种:(1).等待阻塞:运行的线程执行wait()方法,该线程会释放占用的所有资源,JVM会把该线程放入“等待池”中.进入 ...