User Word Automation Service using PowerShell

With PowerShell also possible to use Word Automation Service to convert documents to pdf, xps, etc formats.

Execute below script in PowerShell on your SharePoint Server. Don’t forgot to make necessary changes in script as per your environment. Also Word Automation Service should be in running state.

[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Word.Server")

$jobSettings = New-Object Microsoft.Office.Word.Server.Conversions.ConversionJobSettings

$jobSettings.OutputFormat = "PDF"

$job = New-Object Microsoft.Office.Word.Server.Conversions.ConversionJob("Var Word Automation Service", $jobSettings)

$job.UserToken = (Get-SPWeb http://VarSiteName).CurrentUser.UserToken

$job.AddFile("http://VarSiteName/Document%20Library/VarDocName.docx", "http://VarSiteName/Document%20Library/VarDocName.pdf")

$job.Start()

For UI based solution check this link: SharePoint Document Converter

Issues faced while upgrading SharePoint 2007 to SP2

Hi friends, upgrading SharePoint 2007 to SP2 was not an easy task for me. I almost spent more than a week to fix all the issues occurred. I am sharing my findings so you will know what kind of issues can come and how to resolve them.

Note:- Before you start the installation, you must get the correct service packs/cumulative packs  and install in correct order (install first WSS and then SharePoint SP2). After installation, you will be asked to run the SharePoint Product Configuration wizard. That is the area where your fight will start with SharePoint. Below i have list down the issues i faced and solutions as well. 🙂 For me update always failed at step 8 (seems to be big important step).

Note:- Keep your eye on event log and find for error keyword in log file generated after configuration failure. Upgradelog.txt file contain all the error details and present in “c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS” directory. Search for error count at bottom of the file (e.g. 1 errors and 0 warnings encountered.). This file is the main source and guide us to fix all issues.

Issue 1 – Unable to start the SharePoint Search service. Error was log on failure. To fix this issue you must check the service account try to run the service during configuration wizard. It uses the account which you have used to setup the SharePoint server. To reset the account click here

Issue 2 – After fixing above issue, i ran into another one. Below are the error details from upgrade.log file.

[SPManager] [ERROR] [7/18/2011 3:36:22 PM]: Pre-Upgrade [SPSite Url=http://ServerName] failed. Microsoft.SharePoint.Upgrade.SPSiteWssSequence has the ContinueOnFailiure bit set. Moving on to the next object in sequence.
[SPManager] [ERROR] [7/18/2011 3:36:22 PM]: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)
[SPManager] [ERROR] [7/18/2011 3:36:22 PM]:    at Microsoft.SharePoint.Library.SPRequestInternalClass.GetSiteQuota(String bstrUrl, UInt16& pdwQuotaTemplateID, Int64& plDiskQuota, Int64& plDiskWarning, Int32& plUserQuota)
   at Microsoft.SharePoint.Library.SPRequest.GetSiteQuota(String bstrUrl, UInt16& pdwQuotaTemplateID, Int64& plDiskQuota, Int64& plDiskWarning, Int32& plUserQuota)
   at Microsoft.SharePoint.Administration.SPQuota..ctor(SPSite site)
   at Microsoft.SharePoint.SPSite.get_Quota()
   at Microsoft.SharePoint.Upgrade.SPSiteSequence.PreUpgrade()
   at Microsoft.SharePoint.Upgrade.SPManager.Upgrade(Object o, Boolean bRecurse)

I removed the web application and started the configuration wizard again and it worked fine. (Note: I removed the application because it was empty and in my development environment. But this not be the case all the time. We must find the root cause with the help of error message and fix it.)

Some useful links: http://support.microsoft.com/kb/944267
http://code-journey.com/2009/error-when-updating-windows-sharepoint-services-3-0-with-sp2-an-update-conflict-has-occurred-and-you-must-re-try-this-action-the-object-spsearchdatabase/

Cumulative packs links: http://technet.microsoft.com/en-us/office/sharepointserver/bb735839

SharePoint 2007 Cumulative Updates and Internal Version Numbers

%d bloggers like this: