Welcome on my SharePoint 2010 blog

Hello,

My name's Roy. I'm a dutch SharePoint & BI consultant/architect at Advantive B.V. At this moment I'm busy with some big SharePoint 2010 projects in The Netherlands. In all the projects I've got different roles, like: Business consultancy, Lead Consultant, Architect (logical and technical), Development and Teaching/courses.

Products where you can ask me about are: SharePoint, Visual Studio, SQL Server, PowerPivot, Analysis and Reporting Services, Visio Services, InfoPath, PerformancePoint Services, Team Foundation Server, Office line.

I love to work and to write about Microsoft SharePoint 2010 so, feel free and read/comment my Blogs!

Greetz.

Wednesday, November 10, 2010

Deploy InfoPath 2010 Forms with PowerShell

How to deploy Administrator Approved InfoPath 2010 forms with PowerShell....well it's pretty easy and it saves you a lot of work.

So: instead of publishing the form to the server (administrator approved publishing), send a question to your administrator to verify it and then wait till he/she uploaded it and deployed the solution and activated the feature on your site collection you can use the following commands:

Uninstall the existing solution (based on the from file name):
Uninstall-SPInfoPathFormTemplate -Identity Exampleform.xsn

Install the new solution (based on the from file name):
Install-SPInfoPathFormTemplate -Path C:\Form.xsn

Disable feature on site collection level
Disable-SPInfoPathFormTemplate -Identity "Form.xsn" -Site http://SPSite 

Enable feature on site collection level
Enable-SPInfoPathFormTemplate -Identity "Form.xsn" -Site "http://SPSite"  

Important note:
Make sure that you publish the xsn as follows:

  • Open the backstage in infopath after creating the form and click Server SharePoint:

  • Choose your site collection and click next


  •  Then Check that you must use the form throughout the browser and choose the last option (by administrator approved form) and click next


  • Choose a location (on your local machine or network drive) where to publish the xsn (not to SharePoint location!! because you cannot enter a sharepoint path in the cmdlet in PowerShell).


  • If you want to add columns to the sharepoint forms list or parameters, you can add them here from your InfoPath field list. Click next.


  •  Click publish and your xsn is published to your location. Now you can use the above PowerShell scripts to deploy the solution and activate the feature.


Werner and I did it again!!

1 comment: