Getting Started with PowerShell for SharePoint

Windows PowerShell is a task-based command-line shell and scripting language designed especially for system administration. Built on the .NET Framework, Windows PowerShell™ helps IT professionals and power users control and automate the administration of the Windows operating system and applications that run on Windows.

Built-in Windows PowerShell commands, called cmdlets, let you manage the computers in your enterprise from the command line. Windows PowerShell™ providers let you access data stores, such as the registry and certificate store, as easily as you access the file system. In addition, Windows PowerShell™ has a rich expression parser and a fully developed scripting language.

With SharePoint 2010  developers and administrators will  have full access to the SharePoint API from the PowerShell Command line.  Stsadm will continue to be supported and users will be able to continue using it however it  will be depreciated over time. PowerShell is a lot more flexible and powerful.

Stsadm was often criticized for having difficult to a remember and sometimes inconsistent set of commands; in addition there were many scenarios that it simply didn’t cover. With the introduction of PowerShell most of these issues have been addressed.  For e.g. if one would like to see all the lists in the SharePoint Farm then the user can execute the below command in the PowerShell Prompt

PS C:Usersmember> $sitelists = foreach ($site in get-spsite) {
foreach ($web in $site.AllWebs) {
foreach ($list in $web.lists) {
$list } } }
PS C:Usersmember> $sitelists | get-member

Output:

sharepoint powershell

sharepoint powershell

To do the above with SharePoint 2007, one would have to rollout a new extension, however with introduction of PowerShell into SharePoint 2010, it becomes  simple task  to execute a script in the  PowerShell Prompt.

Continues…

Pages: 1 2




Array

No comments yet... Be the first to leave a reply!