Starting the Document Conversion and Load Balancer Service and Document Conversion Launcher Service on SharePoint 2010 using PowerShell
During my training in SharePoint I’ve been tasked with scripting an install of SharePoint. I know that there are other installers out there, but I wanted to learn as much as I could about installing it the ‘hard’ way. I had most of my 2 server farm installed and working without touching the GUI once. (Well OK, just once – but I haven’t worked my way around that yet!)
In all of the Installer routines I found on the internet there wasn’t one that documented starting the pair of Document Conversion… services. So I had a try myself. Starting the first service, the Document Conversions Load Balancer Service wasn’t too hard. I simply issued*
1Start-SPServiceInstance -Identity (Get-SPServiceInstance | where
2 {$\_.TypeName -eq "Document Conversions Load Balancer Service" -and $\_.Parent.Name -eq “{servername}”})
* I know there is probably a simpler way of doing this but I'm new to this
Easy. So I thought it would be great to just start the other service in the same kind of way. So I tried. Great! The service started, but when I checked the settings I discovered that the Load Balancer property wasn’t set.
So, how do I set that property? Well I had a hunt around the internet and couldn’t find much, but I did find another soul out there with a similar problem, so similar in fact he inspired me to find my answer. His post http://social.technet.microsoft.com/Forums/en/sharepoint2010setup/thread/205b9f5e-9c32-49c2-ad47-4c2a0e97b4ea showed me that you can access the properties from the command line. I just had to find them.
I started this process by creating a ServiceInstance variable I could interrogate.
1$launcher = Get-SPServiceInstance | ? {$\_.typename –eq "Document Conversions Launcher Service"}
Then to interrogate the properties
1$launcher | get-member -membertype property
Which returns this lovely list:
1 TypeName: Microsoft.Office.Server.Conversions.LauncherServiceInstance
2
3Name MemberType Definition
4\---- ---------- ----------
5CanUpgrade Property System.Boolean CanUpgrade {get;}
6Description Property System.String Description {get;}
7DisplayName Property System.String DisplayName {get;}
8Farm Property Microsoft.SharePoint.Administration.S...
9Hidden Property System.Boolean Hidden {get;}
10Id Property System.Guid Id {get;set;}
11Instance Property System.String Instance {get;set;}
12IsBackwardsCompatible Property Microsoft.SharePoint.TriState IsBackw...
13LoadBalancerServerId Property System.Guid LoadBalancerServerId {get...
14ManageLink Property Microsoft.SharePoint.Administration.S...
15Name Property System.String Name {get;set;}
16NeedsUpgrade Property System.Boolean NeedsUpgrade {get;set;}
17NeedsUpgradeIncludeChildren Property System.Boolean NeedsUpgradeIncludeChi...
18Parent Property Microsoft.SharePoint.Administration.S...
19Port Property System.Int32 Port {get;set;}
20Properties Property System.Collections.Hashtable Properti...
21ProvisionLink Property Microsoft.SharePoint.Administration.S...
22Roles Property System.Collections.Generic.ICollectio...
23Server Property Microsoft.SharePoint.Administration.S...
24Service Property Microsoft.SharePoint.Administration.S...
25SingleServer Property System.Boolean SingleServer {get;set;}
26Status Property Microsoft.SharePoint.Administration.S...
27SystemService Property System.Boolean SystemService {get;}
28TypeName Property System.String TypeName {get;}
29UnprovisionLink Property Microsoft.SharePoint.Administration.S...
30UpgradeContext Property Microsoft.SharePoint.Upgrade.SPUpgrad...
31UpgradedPersistedProperties Property System.Collections.Hashtable Upgraded...
32Version Property System.Int64 Version {get;}
And here we have it!
1LoadBalancerServerId Property System.Guid LoadBalancerServerId {get...
Ok, but it wants a System.Guid? Since the property wanted a server name I presumed it wanted the Guid of the server. After a bit more searching it turns out we can find a server Guid from the Get-SPServer commandlet.
1$svrguid = (Get-SPServer | ? {$\_.address -eq "{server name}"}).id
Now we have the Guid we can just set the property in the ServiceInstance variable and update the configuration
1$launcher.LoadBalancerServerId = $svrguid
2$launcher.update()
And finally we can start the service.
1Start-SPServiceInstance -Identity (Get-SPServiceInstance | where {$\_.TypeName -eq "Document Conversions Launcher Service" -and $\_.Parent.Name -eq “{server name}”})
Viola! Both services are now configured and running.
As postscript, whilst I was working on this I kept getting the following error when I issued the update() command:
Exception calling "Update" with "0" argument(s): "An update conflict has occurred, and you must re-try this action. The object LauncherServiceInstance was updated by domainadminuser, in the w3wp (3484) process, on machine SP2010. View the tracing log for more information about the conflict."
This was simply me making changes to the service outside PowerShell without creating a new copy of the $launcher ServiceInstance variable. Once I re-created the $launcher variable it all worked fine.