Monday, October 30, 2006
« SharePoint/Powershell Quickie: Upload a ... | Main | SharePoint/PowerShell 2: Add some Users ... »

Hi,

Just like to thank all those who attended the Presentation last Thursday on controlling SharePoint with PowerShell and Extending the Administration Object model.

I know it was pretty fast paced and technical so I plan to follow it up with a series of blogs entries recapping the steps and scripts in greater detail.

Some of the topics covered were:

   Powershell Basics

   Exchange produces PowerShell samples from the new UI console

   Creating a new SharePoint WebApplication and applying a portal template

   Adding users defined in a CSV file to Active Directory

   Adding those users defined in a CSV file to SharePoint roles

   Adding in webs as defined in a CSV file

   Adding content in an XML file to a Publishing Web

   Uploading a directory of files in 4 lines of Script.

   Creating a custom STSAdm command

   Creating an application to sync User Profile properties back to Active Directory

I've attached the PowerShell scripts and PowerPoint Slides.

I'm not able to post the sample code of the AD Sync application as parts of the code is proprietary but I will post a sample application that does a scheduled backup using exactly the same template.

Presentation-SPPowerShell.zip (46.78 KB)

Colin Byrne

Flexnet Consultants

Monday, October 30, 2006 2:15:41 PM (GMT Standard Time, UTC+00:00)
Thanks for including the ZIP with the presentation - it looks great. One of our goals with creating PowerShell was to make Consultants such as yourself more productive. Where are we with respect to that goal? Also, what things can we do to improve in that direction?

Thanks!
Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
Jeffrey Snover
Monday, October 30, 2006 3:26:37 PM (GMT Standard Time, UTC+00:00)
Thanks Jeffrey but most of the slides came from you!

What can I say, you've done a great job of creating a tool that puts very few limits in the way of a consultant, dev, admin or even a user creating and using scripts that makes parts of their job a repeatable process. That leaves a lot more time to concentrate on the higher level problems.
With PowerShell I like the way that learning a simple syntax (import-csv, import-xml) and using the pipeline you can create complex data driven processes.

To improve things, well a Visual Studio plug-in with the usual trimmings(intellisense, debugging...) would lower the entry 'knowledge barrier' even further.
We can use the System.Data libraries directly but how about a DLINQ like handling of data in PowerShell. Maybe you get this for free with ADO vNext, but DLINQ with Pipelines would be very powerful.

A lot of the future development path that will help the most will be external applications using PowerShell as its controllable API, the Exchange team have made a great start but I'd want products like future versions of SharePoint to do the same. Its a lot of work I know but ultimately there's no reason apps can't have a history buffer of PowerShell comands that could be cut, pasted and adapted.

Finally maybe its just me but just one issue caused me problems. Generics. The SharePoint object model has a few places that this kind of syntax is needed

SPFarm farm = SPFarm.Local
FormsService fs= farm.Services.GetValue<FormsServices>("")

I've seen no samples on generics so not sure how that can be done in PowerShell, I end up looping through the collection matching on a property, inefficient and just not pithy.

Regards,
Colin Byrne
colin
Comments are closed.