PowerShell gains clarity the more you use it. In SharePoint 2010, there are numerous things that are only possible via PowerShell.
These are three PowerShell command-lets that I find very useful in administering SharePoint and this example is one way to use them together to interrogate objects within SharePoint:
Where-Object - http://technet.microsoft.com/en-us/library/ee177028.aspx
Get-Command - http://technet.microsoft.com/en-us/library/ee176842.aspx
Get-Member - http://technet.microsoft.com/en-us/library/ee176854.aspx
Example:
Assumes your powershell has the SharePoint snap-in loaded or that you are using the SharePoint management console.
Get-SpFeature ran by itself will return a list of SharePoint features that are present in your SharePoint environment. One of the headings (aka properties) in the list that results from running this cmdlet, is DisplayName.
Get-SPfeature piped into Get-member will return a list of all the methods and properties that are present within the Get-SPFeature.
Get-SPFeature | Get-Member
Now let's backup a few and assume that the exact name of the powershell command-let with that gets SharePoint features is partially uknown, but that it is known that it has "feature" as part of the word in the noun section. Verb-Noun, *-*Feature*
So, run Get-Command -Noun *feature* and a generate list of comand-lets which appear with feature in the noun section, Get-SPFeature, included.
Finally, the where-object command used in conjunction with get-spfeature will bring a list of features that contain "WebParts" in the displayname, as follows:
Get-SPFeature | Where-object {$_.Displayname -like "*webparts*"}
The results of the one-liner above, include only three of the properties of Get-SpFeature, one of them shows the admin that webparts are scoped at the Web (application), Farm, or Site (collection) level. This is handy when troubleshooting activation of features, as sometimes solutions that are scoped at web parts which are scoped to the site collection, require the use of ?Scope=Site appended to the control page, in order to access the button tied to the method that allows activation.
Video Content
Translate
Subscribe to:
Post Comments (Atom)
Popular Posts
-
When you're migrating sites using export-spweb and import -spweb , you might receive an error message on the import, when reviewing th...
-
Here are a couple ways to copy content around in SharePoint: Backup-SPSite and Restore-SPSite and Export-SPWeb and Import-SPW...
-
Log onto each additional server that you wish to join into the farm Open the ”SharePoint 2010 Management Shell” administratively (righ...
-
Let's say you go to provision a Project Web App via managed service applications, project server server application, and it fails. Ther...
-
Configuring User Profile Synchronization Service Applications for SharePoint 2010 or SharePoint 2013This post assumes you've already installed the SharePoint Binaries (Grey Wizard), and that you are not using the Farm Config Wizard (Wh...
-
If you ever run into a situation where your farm suddenly fails to create the web application on all front end web servers, in other words i...
-
Sorry to be blogurgitating this week. Here's a really good technet site with a load of virtual labs: SharePoint Server 2010 In...
-
When the need to list out the members of an active directory group arises, say management asks, who are the members of this group, and you d...
-
Once a web application has been extended into a zone, the option to choose that zone disappears from the drop down, off the extend web appli...
-
The steps below turn your team site into a team site that is capable of using publishing features and capabilities. But all they really do,...
No comments:
Post a Comment
Thanks for commenting, if you have a question and want a reply, please post it on TechNet forums and reference this blog, or navigate to www.SharePointPapa.com and post it there, all of these blog posts and more are on my SharePoint Papa site.