Tag Archives: best Sharepoint 2013 cloud server

SharePoint 2013 Hosting :: How To Update Conflict Error in SharePoint Using PowerShell Script

Hi guys this article explains you about How To Update Conflict Error in SharePoint Using PowerShell Script. Many of you must have come across the issue “An update conflict has occurred and you must re-try this action” and it is suggested to remove the file system cache on the front-end servers. There are many articles to show how to do this manually. But here I will show you how to resolve it using a PowerShell script.

Cause for this issue

This issue occurs if the contents of the file system cache on the front-end servers are newer than the contents of the configuration database.

Resolution

To resolve this issue, clear the file system cache on all servers in the server Farm on which the Windows SharePoint Services Timer service is running. This can be done manually, but consider a large Farm where the administrator needs to login to each of the servers to perform the activity manually. It is time-consuming and people can make mistakes. PowerShell becomes handy here.

The following procedure can resolve the issue:

  1. Stop the SharePoint timer service
  2. Take a backup of the system cache files before deleting it
  3. Delete the XML files from the cache folder
  4. Reset the cache.ini file to the value 1
  5. Start the SharePoint timer service

Now I will explain how to perform the preceding tasks using a PowerShell script.

  • Stop SharePoint timer service

The following piece of code stops the SharePoint timer service:

    Function StopSPTimerServicesInFarm([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        Write-Host ""  
        foreach($server in $farm.Servers)  
            {  
            foreach($instance in $server.ServiceInstances)  
                    {  
                            # If the server has the timer service then stop the service  
                           if($instance.TypeName -eq $timerServiceInstanceName)  
                           {  
                                [string]$serverName = $server.Name  
       
                                Write-Host "Stop " $timerServiceName " service on server: " $serverName -fore yellow  
                                   
                                $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                                $serviceInternalName = $service.Name  
                                sc.exe \\$serverName stop $serviceInternalName > $null  
      
                                  # Wait until this service has actually stopped  
                      write-host "Waiting for '$timerServiceName' service on server: " $serverName " to be stopped" -fore yellow  
                                  do  
                          {  
                                  Start-Sleep 1  
                                  Write-Host -foregroundcolor DarkGray -NoNewLine "."  
                                  $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                          }  
                         while ($service.State -ne "Stopped")  
                     write-host " '$timerServiceName' service on server: " $serverName " stopped successfully" -fore green              
                                 break;  
                           }  
                    }  
            }  
       
            Write-Host ""  
    }
  • Backup config cache files

The following piece of code backs up the config cache files before deleting it:

Function BackupSPConfigFiles([Microsoft.SharePoint.Administration.SPFarm]$farm)  
{  
    write-host ""  
    write-host "Backup SP config cache files" -fore yellow  
      
    foreach($server in $farm.servers)  
    {  
        foreach($instance in $server.ServiceInstances)  
        {  
            if($instance.TypeName -eq $timerServiceInstanceName)  
            {  
                $ServerName = $server.name  
                $FolderName  = $servername + "SPConfigCacheBackup"  
                write-host "Creating a folder to hold the backup files" -fore magenta  
                write-host "Checking whether the folder aleady exist"  
                if(Test-path $scriptbase\$FolderName)  
                {  
                    write-host "Folder already exists and the script is deleting it......"  
                    remove-item $scriptbase\$FolderName -recurse -confirm:$false   
                    write-host "Existing folder deleted" -fore green  
                }  
                else  
                {  
                    write-host "Folder does not exist"  
                }  
                New-Item $scriptbase\$FolderName -type directory  
                write-host "New folder created to hold the backup files" -fore magenta  
                write-host "Backup of SP config files for the server " $serverName " started ...... " -fore yellow  
                $path = "\\" + $serverName + "\c$\ProgramData\Microsoft\SharePoint\Config"  
                Copy-Item $path -Destination $scriptbase\$FolderName -recurse  
                write-host "SP config cache files backed up for the server " $serverName " Sucessfully..." -fore green  
            }  
        }  
    }  
    write-host "SP config caches files are backed up" -fore green  
    write-host ""  
}
  • Deleting XML files

The following piece of code deletes the XML files:

    Function DeletingXMLFiles([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        Write-host ""  
        write-host "Deleting SP config cache XML files from each server in the farm" -fore yellow  
        $path = ""  
        foreach($server in $farm.servers)  
        {  
            foreach($instance in $server.ServiceInstances)  
            {  
                if($instance.TypeName -eq $timerServiceInstanceName)  
                {  
                    $serverName = $server.Name  
                    write-host "Deleting SP config cache files from the server " $servername -fore magenta  
                    $path = "\\" + $serverName + "\c$\ProgramData\Microsoft\SharePoint\Config\*-*\*.xml"  
                    remove-item -path $path -force  
                    write-host "SP config cache files deleted on the server " $servername -fore magenta  
                    break  
                }  
            }  
        }  
        write-host "SP config cache XML files from each server in the farm is deleted successfully......" -fore green  
        write-host ""  
    }
  • Reset timer cache

The following piece of code resets the timer cache:

Function ResetTimerCache([Microsoft.SharePoint.Administration.SPFarm]$farm)  
{  
    write-host ""  
    write-host "Reseting the value of timer cache to 1" -fore yellow  
    $path = ""  
    foreach($server in $farm.servers)  
    {  
        foreach($instance in $server.ServiceInstances)  
        {  
            if($instance.TypeName -eq $timerServiceInstanceName)  
            {  
                $serverName = $server.Name  
                write-host "Reseting the value of timer cache file in server " $serverName -fore magenta  
                $path = "\\" + $serverName + "\c$\ProgramData\Microsoft\SharePoint\Config\*-*\cache.ini"  
                Set-Content -path $path -Value "1"  
                write-host "Value of timer cache file in server " $serverName " is resetted to 1" -fore magenta  
                break  
            }  
        }  
    }  
    write-host "The value of timer cache is resetted to 1 in all the SP servers in the farm" -fore green  
    write-host ""  
}
  • Start SharePoint timer service
    Function StartSPTimerServicesInFarm([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        Write-Host ""  
        foreach($server in $farm.Servers)  
            {  
            foreach($instance in $server.ServiceInstances)  
                    {  
                            # If the server has the timer service then stop the service  
                           if($instance.TypeName -eq $timerServiceInstanceName)  
                           {  
                                [string]$serverName = $server.Name  
       
                                Write-Host "Start " $timerServiceName " service on server: " $serverName -fore yellow  
                                   
                                $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                                $serviceInternalName = $service.Name  
                                sc.exe \\$serverName start $serviceInternalName > $null  
      
                                  # Wait until this service starts running  
                      write-host "Waiting for " $timerServiceName " service on server: " $serverName " to be started" -fore yellow  
                                  do  
                          {  
                                  Start-Sleep 1  
                                  Write-Host -foregroundcolor DarkGray -NoNewLine "."  
                                  $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                          }  
                         while ($service.State -ne "Running")  
                     write-host $timerServiceName " service on server: " $serverName " started successfully" -fore green              
                                 break;  
                           }  
                    }  
            }  
       
            Write-Host ""  
    }
  • Complete Code
    $LogTime = Get-Date -Format yyyy-MM-dd_hh-mm  
    $LogFile = ".\ClearSPConfigCachePatch-$LogTime.rtf"  
    # Add SharePoint PowerShell Snapin  
    if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) {  
        Add-PSSnapin Microsoft.SharePoint.Powershell  
    }  
    $scriptBase = split-path $SCRIPT:MyInvocation.MyCommand.Path -parent  
    Set-Location $scriptBase  
    #Deleting any .rtf files in the scriptbase location  
    $FindRTFFile = Get-ChildItem $scriptBase\*.* -include *.rtf  
    if($FindRTFFile)  
    {  
        foreach($file in $FindRTFFile)  
            {  
                remove-item $file  
            }  
    }      
    start-transcript $logfile  
    Write-host "##############Following steps will be involved################" -fore green  
    write-host "Step 1 - Stop the timerservice" -fore cyan  
    write-host "Step 2 - Take the backup of config cache file" -fore cyan  
    write-host "Step 3 - Delete the XML files" -fore cyan  
    write-host "Step 4 - Reset the cache.ini file" -fore cyan  
    write-host "Step 5 - Start the SP timerservice" -fore cyan  
    Write-host "##############Above steps will be involved##################" -fore green  
      
    $global:timerServiceName = "SharePoint 2010 Timer"  
    $global:timerServiceInstanceName = "Microsoft SharePoint Foundation Timer"  
   
    # Get the local farm instance  
    [Microsoft.SharePoint.Administration.SPFarm]$farm = [Microsoft.SharePoint.Administration.SPFarm]::get_Local()  
    Function StopSPTimerServicesInFarm([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        Write-Host ""  
        foreach($server in $farm.Servers)  
            {  
            foreach($instance in $server.ServiceInstances)  
                    {  
                            # If the server has the timer service then stop the service  
                           if($instance.TypeName -eq $timerServiceInstanceName)  
                           {  
                                [string]$serverName = $server.Name  
       
                                Write-Host "Stop " $timerServiceName " service on server: " $serverName -fore yellow  
                                   
                                $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                                $serviceInternalName = $service.Name  
                                sc.exe \\$serverName stop $serviceInternalName > $null  
      
                                  # Wait until this service has actually stopped  
                      write-host "Waiting for '$timerServiceName' service on server: " $serverName " to be stopped" -fore yellow  
                                  do  
                          {  
                                  Start-Sleep 1  
                                  Write-Host -foregroundcolor DarkGray -NoNewLine "."  
                                  $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                          }  
                         while ($service.State -ne "Stopped")  
                     write-host " '$timerServiceName' service on server: " $serverName " stopped successfully" -fore green              
                                 break;  
                           }  
                    }  
            }  
       
            Write-Host ""  
    }  
    Function BackupSPConfigFiles([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        write-host ""  
        write-host "Backup SP config cache files" -fore yellow  
          
        foreach($server in $farm.servers)  
        {  
            foreach($instance in $server.ServiceInstances)  
            {  
                if($instance.TypeName -eq $timerServiceInstanceName)  
                {  
                    $ServerName = $server.name  
                    $FolderName  = $servername + "SPConfigCacheBackup"  
                    write-host "Creating a folder to hold the backup files" -fore magenta  
                    write-host "Checking whether the folder aleady exist"  
                    if(Test-path $scriptbase\$FolderName)  
                    {  
                        write-host "Folder already exists and the script is deleting it......"  
                        remove-item $scriptbase\$FolderName -recurse -confirm:$false   
                        write-host "Existing folder deleted" -fore green  
                    }  
                    else  
                    {  
                        write-host "Folder does not exist"  
                    }  
                    New-Item $scriptbase\$FolderName -type directory  
                    write-host "New folder created to hold the backup files" -fore magenta  
                    write-host "Backup of SP config files for the server " $serverName " started ...... " -fore yellow  
                    $path = "\\" + $serverName + "\c$\ProgramData\Microsoft\SharePoint\Config"  
                    Copy-Item $path -Destination $scriptbase\$FolderName -recurse  
                    write-host "SP config cache files backed up for the server " $serverName " Sucessfully..." -fore green  
                }  
            }  
        }  
        write-host "SP config caches files are backed up" -fore green  
        write-host ""  
    }  
    Function DeletingXMLFiles([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        Write-host ""  
        write-host "Deleting SP config cache XML files from each server in the farm" -fore yellow  
        $path = ""  
        foreach($server in $farm.servers)  
        {  
            foreach($instance in $server.ServiceInstances)  
            {  
                if($instance.TypeName -eq $timerServiceInstanceName)  
                {  
                    $serverName = $server.Name  
                    write-host "Deleting SP config cache files from the server " $servername -fore magenta  
                    $path = "\\" + $serverName + "\c$\ProgramData\Microsoft\SharePoint\Config\*-*\*.xml"  
                    remove-item -path $path -force  
                    write-host "SP config cache files deleted on the server " $servername -fore magenta  
                    break  
                }  
            }  
        }  
        write-host "SP config cache XML files from each server in the farm is deleted successfully......" -fore green  
        write-host ""  
    }  
    Function ResetTimerCache([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        write-host ""  
        write-host "Reseting the value of timer cache to 1" -fore yellow  
        $path = ""  
        foreach($server in $farm.servers)  
        {  
            foreach($instance in $server.ServiceInstances)  
            {  
                if($instance.TypeName -eq $timerServiceInstanceName)  
                {  
                    $serverName = $server.Name  
                    write-host "Reseting the value of timer cache file in server " $serverName -fore magenta  
                    $path = "\\" + $serverName + "\c$\ProgramData\Microsoft\SharePoint\Config\*-*\cache.ini"  
                    Set-Content -path $path -Value "1"  
                    write-host "Value of timer cache file in server " $serverName " is resetted to 1" -fore magenta  
                    break  
                }  
            }  
        }  
        write-host "The value of timer cache is resetted to 1 in all the SP servers in the farm" -fore green  
        write-host ""  
    }  
    Function StartSPTimerServicesInFarm([Microsoft.SharePoint.Administration.SPFarm]$farm)  
    {  
        Write-Host ""  
        foreach($server in $farm.Servers)  
            {  
            foreach($instance in $server.ServiceInstances)  
                    {  
                            # If the server has the timer service then stop the service  
                           if($instance.TypeName -eq $timerServiceInstanceName)  
                           {  
                                [string]$serverName = $server.Name  
       
                                Write-Host "Start " $timerServiceName " service on server: " $serverName -fore yellow  
                                   
                                $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                                $serviceInternalName = $service.Name  
                                sc.exe \\$serverName start $serviceInternalName > $null  
      
                                  # Wait until this service starts running  
                      write-host "Waiting for " $timerServiceName " service on server: " $serverName " to be started" -fore yellow  
                                  do  
                          {  
                                  Start-Sleep 1  
                                  Write-Host -foregroundcolor DarkGray -NoNewLine "."  
                                  $service = Get-WmiObject -ComputerName $serverName Win32_Service -Filter "DisplayName='$timerServiceName'"  
                          }  
                         while ($service.State -ne "Running")  
                     write-host $timerServiceName " service on server: " $serverName " started successfully" -fore green              
                                 break;  
                           }  
                    }  
            }  
       
            Write-Host ""  
    }         
    #############Calling functions################  
    StopSPTimerServicesInFarm $farm  
    BackupSPConfigFiles $farm  
    DeletingXMLFiles $farm  
    ResetTimerCache $farm  
    StartSPTimerServicesInFarm $farm  
    ##########################################    
    write-host "SCRIPT COMPLETED" -fore cyan  
    stop-transcript

Execution Procedure

  1. Step 1: Download the script and copy it to the SharePoint server.
  2. Step 2: Navigate to the script path.
  3. Step 3: Execute the script.

Best Recommended SharePoint 2013 Hosting

ASPHostPortal.com

ASPHostPortal.com is Perfect, suitable hosting plan for a starter in SharePoint. ASPHostPortal  the leading provider of Windows hosting and affordable SharePoint Hosting. ASPHostPortal proudly working to help grow the backbone of the Internet, the millions of individuals, families, micro-businesses, small business, and fledgling online businesses. ASPHostPortal has ability to support the latest Microsoft and ASP.NET technology, such as: WebMatrix, WebDeploy, Visual Studio 2015, .NET 5/ASP.NET 4.5.2, ASP.NET MVC 6.0/5.2, Silverlight 6 and Visual Studio Lightswitch, ASPHostPortal guarantees the highest quality product, top security, and unshakeable reliability, carefully chose high-quality servers, networking, and infrastructure equipment to ensure the utmost reliability

 

 

 

SharePoint 2013 Hosting with ASPHostPortal.com :: How to fix “Microsoft SharePoint is not supported with version 4.0.30319.225 of the Microsoft .Net Runtime” in PowerGUI

Introduction

banner promo-01

Today, i will tell you about fixing “Microsoft SharePoint is not supported with version 4.0.30319.225 of the Microsoft .Net Runtime” in PowerGUI. This porblem started when I attempt to run some Powershell command against Sharepoint in PowerGUI , I experience some slip message as beneath:

Remove-SPSite : Microsoft SharePoint is not supported with version 4.0.30319.225 of the Microsoft .Net Runtime.

At C:\SiteCreation.ps1:37 char:14

+ CategoryInfo : InvalidData: (Microsoft.Share…mdletRemoveSite:SPCmdletRemoveSite) [Remove-SPSite], PlatformNotSupportedException

The mistake message is really clear that Powergui attempt to run the Powershell command under .Net form 4.0 which is not backed by Sharepoint2010, Sharepoint2010 just help .Net 3.5.so in what capacity would I be able to change the settings so that Powershell does run under .Net3.5 in Powergui? The arrangement is really simple.

Solution

1. Open your windows explorer and explore to C:\program Files (x86)\powergui\ and open the configuration file Scripteditor.exe.config.

2. Change the supportedruntime form under Startup settings by deleting the version=”v4.0″ as underneath.

From :

<startup useLegacyV2RuntimeActivationPolicy=”true”>
<supportedRuntime version=”v4.0″ sku=”.NETFramework,Version=v4.0″ />
<supportedRuntime version=”v2.0.50727″ />
</startup>

To :

<startup useLegacyV2RuntimeActivationPolicy=”true”>
<supportedRuntime version=”v2.0.50727″ />
</startup>

3. Restart your PowerGUI and rerun your script. It works like a charm.

SharePoint 2013 Hosting with ASPHostPortal :: Scenario pages for SharePoint 2013

SharePoint 2013 has many great ways to help you get things done. We want to highlight a few of these, so we have created scenario pages that explain a specific scenario and provide content to help you understand, implement, and use it easily.

Scenario pages allow you to view key resources based on selected stages of evaluation or adoption. These stages are represented by colored tiles. Click a single tile for a specific stage or Ctrl-click multiple tiles for multiple stages. As you click the tiles, the scenario page lists the resources for each selected stage.

Content and resources are drawn from many Microsoft Web properties: IT content from TechNet, developer content from MSDN, and Information Worker content from Office.com are all integrated into the scenario page experience. All of the resources you need are available in one place, whether you want to understand:

  • Which features must be configured to support the scenario and how to manage them
  • What namespaces and methods to use to develop customizations for the scenario (MSDN content) Or how to accomplish a specific task in the scenario (Office content)

The following scenario pages are now available:

  • eDiscovery in SharePoint Server 2013 and Exchange Server 2013 . eDiscovery allows you to place electronic holds on documents and email for a legal case or audit. eDiscovery is a great example of a solution that benefits from a scenario page because it provides links to key resources published for SharePoint 2013, Exchange Server 2013, and Lync Server 2013.
  • Personal sites (My Sites) in SharePoint Server 2013 . My Sites technology provides profile data, activity feeds, tagging capabilities, and search results for each SharePoint user in your organization.

When you deploy My Sites, each user gets a starting place in SharePoint that brings together the sites, documents, and other information that they care about and helps them share what they know.

SharePoint 2013 Hosting with ASPHostPortal.com :: Move Your SharePoint to Cloud Server

Move Your SharePoint to Cloud Server

cloudserverSharePoint is a browser based platform that can boost the efficiency and effectiveness of your organization by enhancing communication and collaboration as well as streamlining the management of and access to your data.

SharePoint can store your documents in a central, secure location, then allow users to search it for instant access to the data they need. It also enables users to share information across your intranet, whilst ensuring users see only the data that is useful and relevant to them.

SharePoint in the cloud brings enhanced document management capabilities to ensure the integrity of documents stored on team sites: the option to require users to checkout documents before editing, the ability to view revisions to documents and restore to previous versions, and the option to set document and item-level security.

Moving your content from on-premises storage to the cloud offers many benefits. In this article, we will tell you why you should move your SharePoint to the Cloud?

Here are five tips for a successful SharePoint migration:

Clean up your content

Before beginning your SharePoint migration, determine what information to move to the cloud and what you should leave behind. Weeding out any redundant, outdated or trivial content before the migration should make the process easier, while also controlling costs and mitigating risks.

Automate cleanup processes

Deciding whether to delete, migrate or archive each piece of content is time-consuming, so look for ways to automate and streamline the process by using simple rules based on date, author and location.

Take inventory

To minimize errors and unwelcome surprises during your SharePoint migration, take inventory of the content you plan to move and acknowledge the intricacies of the source before you test or migrate to a new destination. The best way to go about this is to truly investigate your content and acknowledge the different object types involved. This inventory may be very granular, including number of versions, quantity of metadata and associated lookup columns within SharePoint or another site collection.

Test your migration before you commit

When moving from SharePoint on-premises to SharePoint Online, it’s important to address the different object types and their migration paths. Each object type is going to have a different migration path with its own challenges. In a test migration, you collect a smaller set of files from the source and move it to the destination, and then make sure all the attributes that you want come over with the files. It also gives you a chance to address any errors and complications, and test the transfer speed. Testing by object type helps you acknowledge the types of content and objects that have to move and any complexities you may run into with each of them.

Set a generous timeframe

Cloud migrations tend to take longer than migrating between two SharePoint on-premises systems. While cloud migration tools may claim to transfer a gigabyte per hour, your actual speed depends on a number of factors and network complexities. Moving data between completely separate data centers may result in low transfer rates, around 100 MB or 250 MB per hour. When you’re dealing with terabytes of data, such a slow rate could put you behind schedule. That’s why it’s important to look for ways to speed up the process.

In the end, to get the best results from your SharePoint migration, it’s important to set appropriate expectations and timeframes. For example, content cleanup may take considerable time depending on your information, cleanup goals and strategy. But considering the potential benefits of streamlining the migration and improving system performance, there’s no sense in cutting corners.

Recommended SharePoint Cloud Server

Are you looking for a recommended hosting provider for your new cloud server? ASPHostPortal.com is the answer.

Why ASPHostPortal.com?

With Windows Dedicated Cloud Server Services from ASPHostPortal.com, you’ll find the perfect Cloud Server solution for your business. Web pages will load faster for ecommerce customers, databases will get higher IOPS and applications streaming large volumes of video and media files will experience low latency when customers run their applications. With cloud servers, you have the ability to upgrade and downgrade your servers on the fly. In some cases depending on the Operating System running on the cloud server it may still require a reboot. Migrating your cloud server to a different physical server can usually be accomplished with no downtime via hot migration.