Tuesday, November 13, 2012

Operation is not valid due to the current state of the object


Hi,

After clicking ‘Start Restore’ while restoring farm, sometimes we get the error as below.
Finally our architect has come up with the solution to clear the roadblock i.e.

Added key to increase value of Maximum Http Collection as below
Post this farm restore went fine. This error comes up if farm back up size is heavy.


Monday, October 29, 2012

SP1 Upgrade in SharePoint 2010


Hi,

In SharePoint 2010, SP1 is required where some features are well performed.
For example in the absence of SP1,user profiles will not be imported.
Below is the sequence that has been followed to upgrade SP1

Step 1:
Run sharepointfoundation2010sp1-kb2460058-x64-fullfile-en-us.exe

Step 2:
Run spflanguagepack2010sp1-kb2460059-x64-fullfile-de-de.exe
Run spflanguagepack2010sp1-kb2460059-x64-fullfile-es-es.exe
Run spflanguagepack2010sp1-kb2460059-x64-fullfile-fr-fr.exe
Run spflanguagepack2010sp1-kb2460059-x64-fullfile-it-it.exe
Run spflanguagepack2010sp1-kb2460059-x64-fullfile-ja-jp.exe
Run spflanguagepack2010sp1-kb2460059-x64-fullfile-ko-kr.exe
Run spflanguagepack2010sp1-kb2460059-x64-fullfile-nl-nl.exe
Run spflanguagepack2010sp1-kb2460059-x64-fullfile-pt-pt.exe
Run spflanguagepack2010sp1-kb2460059-x64-fullfile-ru-ru.exe
Run spflanguagepack2010sp1-kb2460059-x64-fullfile-sv-se.exe
Run spflanguagepack2010sp1-kb2460059-x64-fullfile-tr-tr.exe
Run spflanguagepack2010sp1-kb2460059-x64-fullfile-zh-cn.exe

Step 3:
Run officeserver2010sp1-kb2460045-x64-fullfile-en-us.exe

Step 4:
Run serverlanguagepack2010sp1-kb2460056-x64-fullfile-de-de.exe
Run serverlanguagepack2010sp1-kb2460056-x64-fullfile-es-es.exe
Run serverlanguagepack2010sp1-kb2460056-x64-fullfile-fr-fr.exe
Run serverlanguagepack2010sp1-kb2460056-x64-fullfile-it-it.exe
Run serverlanguagepack2010sp1-kb2460056-x64-fullfile-ja-jp.exe
Run serverlanguagepack2010sp1-kb2460056-x64-fullfile-ko-kr.exe
Run serverlanguagepack2010sp1-kb2460056-x64-fullfile-nl-nl.exe
Run serverlanguagepack2010sp1-kb2460056-x64-fullfile-pt-pt.exe
Run serverlanguagepack2010sp1-kb2460056-x64-fullfile-ru-ru.exe
Run serverlanguagepack2010sp1-kb2460056-x64-fullfile-sv-se.exe
Run serverlanguagepack2010sp1-kb2460056-x64-fullfile-tr-tr.exe
Run serverlanguagepack2010sp1-kb2460056-x64-fullfile-zh-cn.exe

Cumulative updates of august 2012
Run office2010-kb2687353-fullfile-x64-glb.exe

Now after installing the above as per the sequence, now faced issue as below while running the Cumulative updates of august 2012
Remedy for this issue is go to control panel->Uninstall Program

You will be able to see the list of language packs that have been installed as below.

Each language pack has version(marked in blue) as below

Now if you notice that any language pack version number is different, then reinstall that language pack from step 2,step 4
For me Turkish language pack was not getting installed used below command to install the same.
"E:\SP1 for SP2010\Step 4 - Service Pack 1 for Server Language Pack 2010 (KB2460056)\serverlanguagepack2010sp1-kb2460056-x64-fullfile-tr-tr.exe"PACKAGE.BYPASS.DETECTION.CHECK=1

Post this cumulative updates of August 2012 installation went fine.

Note:
1)Central Administration was not opening because till whole installation gets complete, central administration might not open
2)After installation run SharePoint 2010 configuration wizard one by one in all the servers of the farm
3)Cumulative updates of August 2012 takes some time i.e. minimum 4 hours, maximum 8 hours. Till that time please be patientJ

Wednesday, August 29, 2012

Install/Uninstall PowerPivot 2010


Hi,

Below are the commands that needs to be executed for Installation/Un installation of Power Pivot 2010
These commands needs to be run in command prompt
Installation
"E:\SQL2008R2\setup.exe" /ACTION="Install"

Un Installation
"E:\SQL2008R2\setup.exe" /ACTION="UnInstall"

Thursday, August 23, 2012

New version of workflow not created after deployment


Hi,

We were facing an issue while deploying a custom list workflow, designed using SharePoint Designer 2010.
After deployment, a new version of the workflow was not being created. I can see that the changes I have made earlier are reflecting in the existing workflow.
Below are the steps I followed to get the job done (which of course is not working)

1.       Opened the existing workflow using SPD  and clicked on Edit Workflow.
2.       After making changes to the Tasks, I saved the workflow as a template (a wsp).
3.       Deployed the solution to the Solution Gallery and activated it.
4.       Activated the feature created at the Site Level.
When I check the workflows associated with the list, it still shows a single workflow. When I open the workflow again using Designer, it shows the changes that I have made earlier.
I am not sure what is going wrong here. There are a few things that I have noticed. After making changes to the tasks, the forms associated with the workflow change their status as (Needs Update). I opened these forms in InfoPath Designer, which shows that some fields have been added/modified and the form needs to be updated with the list of available fields. Later I publish the form to the server. Even then, I don’t see any changes in the Task form status in SPD. This is also a custom task form that we have designed.

Fix
We have found out the issue. When we tried to publish the workflow to the same site collection, we got an error. So we had to republish it several times before saving it as a template. When this solution was deployed to a different site collection, we were not able to see any new workflow association. 

The issue was with the xoml configuration file where the visibility property of the workflow was set to "DraftPublic" as opposed to the "Public" seen for normal published workflows. So we required to use designer to change this value in the workflow manually and then save it as a template

Error running configuration wizard during sp1 up gradation



Hi,

We have installed the latest Cumulative Updates (April 2012 version) on SharePoint Server 2010 farm. We installed both the Foundation and Server hot fix package on all application servers and then the web front end.
Next step was running the SharePoint 2010 Products Configuration Wizard on the application server. The wizard started out just fine, but in step 9 (“The farm is being upgraded in the timer service process. The task is  41.23% completed.”) where it subsequently failed (Configuration failed). 

 The error message was:
An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown.  Additional exception information: Failed to upgrade SharePoint Products.”


Reading in the logs revealed what seemed to be why the upgrade failed, but no hint on how to fix it:
01/04/2011 15:27:39  14  INF                    Resource id to be retrieved is UpgradeTaskFailConfigSyncDisplayLabel for language English (United States)
01/04/2011 15:27:39  14  INF                    Resource retrieved id UpgradeTaskFailConfigSyncDisplayLabel is Failed to upgrade SharePoint Products.
01/04/2011 15:27:39  14  INF                  Leaving function StringResourceManager.GetResourceString
01/04/2011 15:27:39  14  INF                  Entering function Common.BuildExceptionMessage
01/04/2011 15:27:39  14  INF                    Entering function StringResourceManager.GetResourceString
01/04/2011 15:27:39  14  INF                      Resource id to be retrieved is ExceptionInfo for language English (United States)
01/04/2011 15:27:39  14  INF                      Resource retrieved id ExceptionInfo is An exception of type {0} was thrown.  Additional exception information: {1}

After googling our teammate has found fix for this issue as below.

Fix:  While troubleshooting the issue, we found out that the database was running out of space. We increased the space of the database. Even then the issue wasn’t resolved. We had to run a Power Shell as found in the below article. This fixed the issue and we were able to complete the Configuration Wizard.

Below is the reference link which helped us in resolving this issue.

Monday, August 20, 2012

Search Center Site Collection using powershell


Hi,

Our Requirement was to create site collection for Search Center.

One more important expectation is once Search Center site collection gets created, two pages are to be created under Pages Library.

Those two pages are "Advanced.aspx" and "Results.aspx".

Respective web parts  needs to available on those pages i.e.

Advanced Search Box web part should be available on "Advanced.aspx"
Search Core Results web part should be available on "Results.aspx"

For that below is the script that has been executed

// CreateSiteCollections.ps1
# Automates creation of site collections based on information stored in a XML file.

# This method returns the directory of the script
$0 = $MyInvocation.MyCommand.Definition          
$dp0 = [System.IO.Path]::GetDirectoryName($0)
$RootPath = $dp0 | split-path 


## Get XML configuration file parameters
[string]$InputFile = $("$RootPath\SiteCollectionScripts\WPSiteCollectionsInputs.xml")   

$xmlinput = [xml] (get-content $InputFile)
$item = $xmlinput.SiteCollectionConfig


#Region Create site collection in the web application, if the site collection exsits then return the existed site collection
#otherwise create a new site collection  
Function CreateSiteCollection($name,$url, $description,$webApplication,$ownerAlias, $secondaryOwnerAlias,$contentdatabase,$Template,$LCID)
{
    Try
    {
        Write-Host -ForegroundColor White "- Start to create the Site Collection: `"$name`"..."
        #$sc = get-spsite -identity $url | Out-Null
        $sc = get-spsite -limit all | Where-Object {$_.Url -eq $url}
        if($sc -eq $null)
        {

            $cntDB = get-spcontentdatabase -webapplication $webApplication | where-object {$_.name -eq $contentdatabase}
            if($cntDB -eq $null)
            {
                $cntDB = new-spcontentdatabase -name $contentdatabase -webapplication $webApplication
            }

            $sc = New-SPSite -Url $url -OwnerAlias $ownerAlias -SecondaryOwnerAlias $secondaryOwnerAlias -ContentDatabase $contentdatabase -Description $description -Name $name -Template $Template -Language $LCID
           
            #Add NT Authority/Authenticated users to Search Center and Site Provisioning Application         
          
            if($name -eq "SearchCenter")
            {
                New-SPUser -UserAlias "NT AUTHORITY\authenticated users" -web $url -PermissionLevel Contribute
               
                #add the search center site collection to the current subscription
                $sub = get-spsitesubscription    
                set-spsite -identity $sc -sitesubscription $sub

            }
        }
        else
        {
            Write-Host -ForegroundColor White "- Site collection: `"$name`" already exists, continuing..."
        }
    }
    catch
    {
        Write-Host $_
    }
}
#EndRegion


#Get the Web Application Details

$ContentPortalName = $item.ContentPortalName


$GetSPWebApplication = Get-SPWebApplication $ContentPortalName
    If ($GetSPWebApplication -eq $Null)
        {

            Write-Warning " - Web application does not exist"
            Write-Warning " - Check if the Web Application has been created or not"
            break
        }
    else
                {
            $WebApp = Get-SpWebApplication $ContentPortalName
                }


$scs = $item.selectnodes("SPSiteCollection")
foreach($sc in $scs)
{
    $name = $sc.Name 
    $scUrl = $WebApp.URL+$sc.ManagedPath
    CreateSiteCollection -name $sc.Name -url $scUrl -description $sc.Description -webApplication $WebApp -ownerAlias $sc.OwnerAlias -secondaryOwnerAlias "$env:USERDOMAIN\$env:USERNAME" -contentdatabase $sc.ContentDatabase -Template $sc.Template -LCID $sc.LCID
    Write-Host -ForegroundColor White "- The site collection: $name has been created"

               
}
// WPSiteCollectionsInputs.xml
<?xml version="1.0" ?>
<SiteCollectionConfig>
                <ContentPortalName>http://webappurl</ContentPortalName>            
                <SPSiteCollection>
                                <Name>SearchCenter</Name>
                                <Description>Enterprise Search Center Site</Description>
                                <ManagedPath>sites/SearchCenter</ManagedPath>
                                <ContentDatabase>dbname</ContentDatabase>
                                <Template>SRCHCEN#0</Template>
                                <LCID>1033</LCID>
                                <OwnerAlias>domain\username</OwnerAlias>
                                <SecondaryOwnerAlias> domain\username</SecondaryOwnerAlias>
                </SPSiteCollection>
</SiteCollectionConfig>

Finally I got the result as below

Installing PDF Filter with Powershell


Hi,

Recently we have worked on installing PDF Filter with the power shell.
Along with the script, PDFFilter64installer, pdf16 image was copied in the same folder.
Below is the code as below

//PDFFilterInstall_Batch.bat
Powershell.exe -Command Set-ExecutionPolicy "Bypass"
Powershell.exe -Command "& {E:\PDFFilter\PDFFilterScript.ps1}"
Pause

// PDFFilterScript.ps1
Add-PSSnapin "Microsoft.SharePoint.PowerShell"

$0 = $MyInvocation.MyCommand.Definition                 # Get complete file path (eg:  E:\SP2010AppServer\SetupInputs.xml)
$dp0 = [System.IO.Path]::GetDirectoryName($0)           # Get current Directory  file path  (eg:  E:\SP2010AppServer)
$bits = Get-Item $dp0 | Split-Path -Parent              # Get current Drive   (eg:  E:\)

function InstallPDFFilter()
{
                $installationPackagePath = $dp0
                $installationPackageFileName = "PDFFilter64installer.msi"
                $logoFileName = "pdf16.gif"   
    $searchServiceApplication = "EnterPrise Search Service Application"
    $filterFile = "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML\DOCICON.XML"
    $filterIconPath = "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES\"

    #Install PDF iFilter package
    Write-Host -ForegroundColor White "- Installing PDF Filter..."
    try
    {
        Start-Process "$installationPackagePath\$installationPackageFileName" -ArgumentList "/passive /norestart" -WindowStyle Minimized -Wait
        If (-not $?) {throw}
    }
    catch
    {
        Write-Host -ForegroundColor Red "- Error: $LastExitCode"
                                If ($LastExitCode -eq "1") {throw "- Another instance of this application is already running"}
                                ElseIf ($LastExitCode -eq "2") {throw "- Invalid command line parameter(s)"}
                                ElseIf ($LastExitCode -eq "1001") {throw "- A pending restart blocks installation"}
                                ElseIf ($LastExitCode -eq "3010") {throw "- A restart is needed"}
                                Else {throw "- An unknown error occurred installing package"}
    }
    Write-Host -ForegroundColor White "- PDF Filter installed successfully"
    #Copy logo file to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES\
    Copy-Item "$installationPackagePath\$logoFileName" -destination $filterIconPath

    #Write mapping entry to the DOCICON.xml file under C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML
   
    Write-Host -ForegroundColor White " - Adding pdfs as extension to docicons xml file" 
    # Load XML from file:
    $xmldata = [xml](Get-Content $filterFile)
    $xpath="Mapping[@Key='pdf']"
    $pdfMapping = $xmldata.DocIcons.ByExtension.SelectSingleNode($xpath)
    if($pdfMapping -eq $null -or $pdfMapping -eq "")
    {
        # Create new node:
        $pdfMapping = $xmldata.CreateElement("Mapping")
        $pdfMapping.SetAttribute("Key","pdf")
        $pdfMapping.SetAttribute("Value",$logoFileName)
        # Write nodes in XML:
        $xmldata.DocIcons.ByExtension.AppendChild($pdfMapping)
        $xmldata.Save($filterFile)
    }
    Write-Host -ForegroundColor White " - XML updated."
   
    #add file type to search service application
   
    Write-Host -ForegroundColor White "Adding PDF to the list of search crawl extensions in the Search Appliation..."
    $searchapp = Get-SPEnterpriseSearchServiceApplication $searchServiceApplication
    $pdfExtension = Get-SPEnterpriseSearchCrawlExtension "pdf" -SearchApplication $searchApp -ErrorVariable err -ErrorAction "SilentlyContinue"
   
    if($pdfExtension -eq $null)
    {
        $searchapp | New-SPEnterpriseSearchCrawlExtension "pdf"
        Write-Host -ForegroundColor White " - Adding PDF extension completed."
    }
    else
    {
        Write-Host -ForegroundColor White " - The PDF extension was already in the list"
    }
   
    Write-Host -ForegroundColor White " - Adding pdf entries for Sharepoint PDF Search in the registry..."
    # if (-not $(Test-Path -Path $InputFile -Type Leaf))
    if (-not $(Test-Path "HKLM:\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\Filters\.pdf"))
    {
        New-Item -path registry::'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\Filters\.pdf' | Out-Null
        New-ItemProperty -Path registry::'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\Filters\.pdf' -Name "Extension" -value ".pdf" -PropertyType string  | Out-Null
        New-ItemProperty -Path registry::'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\Filters\.pdf' -Name "Mime Types" -value "application/pdf" -PropertyType string  | Out-Null
        New-ItemProperty -Path registry::'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\Filters\.pdf' -Name "FileTypeBucket" -value "1" -PropertyType dword  | Out-Null
    }
    if (-not $(Test-Path "HKLM:\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf"))
    {
        New-Item -Path registry::'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf' | Out-Null
        New-ItemProperty -Path registry::'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf' -name "(Default)" -Value "{E8978DA6-047F-4E3D-9C78-CDBE46041603}" -PropertyType string | Out-Null
    }
   
   
    #Restart services
    Write-Host -ForegroundColor White "- Restart SharePoint Timer Service..."
    IISReset
    restart-service SPTimerV4
    Write-Host -ForegroundColor White "- Timer Service restarted successfully"
}

InstallPDFFilter

Finally after executing the script you can see the PDF icon in the crawl extensions as below