Friday, 4 December 2009

Creating Office Web Apps Service Applications with PowerShell

I was following the “Deploy Office Web Apps (SharePoint Server 2010)” beta guide published by Microsoft and got to the part on page 8 where it describes how to create the service applications and their proxies using PowerShell.

I ran the following script documented in the article:

$appPool = Get-SPIisWebServiceApplicationPool
–Name “SharePoint Web Services Default”
New-SPWordViewingServiceApplication –Name “WdView” –AppPool $appPool |
New-SPWordViewingServiceApplicationProxy –Name “WdProxy”
New-SPPowerPointServiceApplication –Name “PPT” –AppPool $appPool |
New-SPPowerPointServiceApplicationProxy –Name “PPTProxy”
New-SPExcelServiceApplication –Name “Excel”
-SPIisWebApplicationPool $appPool |

Well, I didn’t even get past the first line without PowerShell reporting an error. I could have switched to the UI and configured it there, but as I decided to crack the problem instead. After a good old trial and error session, the script now reads:

$appPool = Get-SPIisWebServiceApplicationPool –Identity “SharePoint Web Services System” |
New-SPWordViewingServiceApplication –Name “WdView” –ApplicationPool $appPool |
$WdViewSA = Get-SpServiceApplication -Name "WdView" |
New-SPWordViewingServiceApplicationProxy –Name “WdProxy” -URI $WdViewSA.Uri.AbsoluteUri |
New-SPPowerPointServiceApplication –Name “PPT” –ApplicationPool $appPool |
New-SPPowerPointServiceApplicationProxy –Name “PPTProxy” -ServiceApplication "PPT" |
New-SPExcelServiceApplication -Name "Excel" -ApplicationPool $appPool |

Hope this helps someone…. at least until RTM launches and they have rewritten the documentation :-)