Tuesday, 6 December 2016

Full and Incremental Content Deployment in SharePoint 2010




While working with content deployment I came to know that we can do the full and incremental deployment but I was unable to find the option to do the same through central administration in SharePoint 2010. I came to know there was an option to do the same in central admin of SharePoint 2007.

Then I searched and got hold of an old screen from 2007 where I saw the option to do the same as shown below.The same when I did from the central admin of SharePoint 2010 I did not find any option.


SharePoint 2007 Content Deployment


SharePoint 2010 Content Deployment

These option screen shown above are available when u “create a new Job” as show in the screen below



So how do we create a specific Job of type Incremental or Full? After doing surfing I found out that it can be done using PowerShell. Yes we can create Jobs with using PowerShell rather than the step show in figure 2(Above). Note this script should be run after you have already created the content deployment Path as in my case “Local Deploy”.

New-SPContentDeploymentJob -Name " Local Deploy - Incremental" -SPContentDeploymentPath
"Local Deploy" -IncrementalEnabled:$true

Now if we create a job through UI in central admin by default it will create Incremental Only. Yes and how do we find this out?

To do that, run Get-SPContentDeploymentJob "Local Deploy - Incremental". You should notice the following line in your output:



So how do we create a Job with “Full Content Deployment”

New-SPContentDeploymentJob -Name " Local Deploy - Full" -SPContentDeploymentPath
"Local Deploy" -IncrementalEnabled:$false



Reference Take by : http://sharepointlearningcurve.blogspot.sg/2010/05/sp2010-content-deployment-jobs-missing.html 

Tuesday, 15 November 2016

SharePoint 2013 CU August 2013 – "Internet Information Services not installed"

Today it was time to update my SharePoint 2013 installation from March CU 2013 to August 2013 CU.

"Internet Information Service not installed"
After the patching I have to start the Config Wizard. I was a little surprised as it responds with a nice error –  I even tried the PowerShell command in case there is a difference, but no:



What? IIS not installed anymore? Something must be broken with the Patch.

But then I tried to reproduce my steps – of course it must be a user error. After reading the patch script (reading things sometimes helps), I noticed that the script disables the IIS Admin service… it didn't happen on other 12 machines I installed this CU only this one :)



SharePoint does not like that – set it back to Automatic start and start the service.

And then start the config wizard again... Happy Patching!!!


Tuesday, 4 October 2016

SharePoint 2013 geolocation column: a component is not installed

Today I was playing with the new geo location column. I added the Bing maps key, created a custom list and added the geo location column via code to that list. Upon submitting a new list item, I received an error, mentioning that a component was not installed, to be able to use geolocation. This is a strange error, because I was able to add the column programmatically, while adding content to the list, is not possible. After checking the Diagnostic log, I noticed the following error:

A required component for using a geolocation field is not installed: Microsoft SQL Server System CLR Types

This remembered me that I had read somewhere (this means: It’s not in the geo location MSDN documentation.It’s written in the documentation on mobile apps and geolocation) that the SQL Server System CLR Types needed to be installed on the Web Front End servers. The package that needs to be installed is called “SqlSysClrTypes.msi”, and depending on the version of SQL that is used

After the installation, I still couldn’t add any items to the list. An IIS Reset didn't work for me but a reboot did the trick.

Thursday, 1 September 2016

Content deployment failed, client response text/html expected text/xml

Content deployment job 'NonEng' failed.The remote Web service request failed with this message: 'Exception from HRESULT: 0x80131904'; Details: '<detail><errorstring xmlns="http://schemas.microsoft.com/CmsPublishing/soap/">Exception from HRESULT: 0x80131904</errorstring><errorcode xmlns="http://schemas.microsoft.com/CmsPublishing/soap/">-2146232060</errorcode></detail>'.

Content deployment job 'Eng' failed.The remote Web service request failed with this message : 'Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. '.

If you got these errors in your Content Deployment and wondering what changed, probably the target server is restarted by one of the Admins, and it might have caused this, for me at least it did.

All we have to do is to do a good old IISRESET on the target server and then run the job.

Wednesday, 3 August 2016

ProjectServer 2013 environment migration / rollover steps

This blog post will detail the PowerShell commands required to carry out an environment rollover / migration using Windows PowerShell where possible. The steps below use the 2 database approach to rollover over the Production environment to the Test / Development environment.

As a prerequisite I would recommend taking full backups of the Test / Dev farm to enable the environment to be rolled back if required. Use your usual farm backup procedures.

Test / Dev environment Prep

Firstly connect to the Test / Dev Application server and launch the SharePoint 2013 Management shell.

Type the following:

Dismount-SPProjectWebInstance -SiteCollection  <URL of Test / Dev PWA site that you want to refresh with the Production data and config>

Press Enter and then type Y and press Enter to remove the PWA instance

You can check in Central admin in the Project Server Service Application to check that the PWA site has been removed:

Using the SharePoint 2013 Management Shell remove the existing content database from the web application that hosted the PWA site collection that was removed in the previous step.

Type the following:

Dismount-SPContentDatabase “<Database name here>”

Press Enter and type Y to confirm then press Enter

Test / Dev environment SQL Prep

Take a backup of the 2 databases from the Production environment and copy these over to the Test / Dev SQL server and restore the databases. The databases required are:

Content database that contains the PWA site and Project Sites
Project Web App database
Make a note of the database names used when these databases are restored as they will be required later.

Test / Dev environment configuration

Using the SharePoint Management Shell, attach the restored content database to the web application that will host the PWA site collection.

Type the following:

Mount-SPContentDatabase “<content database name restored in previous step>” -DatabaseServer “<Test / DEV SQL Server>” –WebApplication <web application URL>

Press Enter:

Using the SharePoint 2013 Management Shell mount the restored Project Web App database to the web application.

Type the following command:

Mount-SPProjectDatabase -Name “Name of the restored Project Web App database to mount” –WebApplication “Web Application ULR that the Project Web App database will mount to” –DatabaseServer “Test / Dev SQL Server where the database was restored”

Press Enter:

Now using the SharePoint 2013 Management Shell provision the PWA site collection in the web application where the database was just attached to and using the Project Web App database that was restored previously. Please note, use the same PWA path name used in Production. For example if the instance is called /PWA in Production, use /PWA in the command below on the Test / Dev environment.

Type the following command:

Mount-SPProjectWebInstance –DatabaseName “Name of the restored Project Web App database to mount” –SiteCollection “web application URL + PWA path” –DatabaseServer “Test / Dev SQL Server where the database was restored”

Press Enter:

You can check the provisioning status of the PWA site using PowerShell or in Central admin in the Project Server Service Application to check that the PWA site has been created:

Type the following:

Get-SPProjectWebInstance –URL <PWA URL> | Select ProvisioningStatus

Or in Central Admin:


Post Provisioning

The Project Sites will need to be relinked using the “Bulk Update Connected SharePoint Sites” functionality in Central Admin on the newly provisioned Test / Dev PWA site.

The Project Server Cube settings will need to be updated – update the SQL AS server / cube name.

Any Excel services reports will need to be updated to use the ODC files from the Test / Dev environment as they will currently point to the Production ODC files. This is done by opening the Excel reports in Excel, changing the ODC file then saving the file back to the library.

Wednesday, 6 July 2016

SharePoint 2013 Certificate Error Causes Performance Issues

Whilst working with a SharePoint 2013 environment I experienced slow page load times and poor search performance.  After initial page loads performance was fine for several minutes before the performance issue returned.

Opening the Application log within Event Viewer showed the following critical error with the text

“A certificate validation operation took 30015.2428 milliseconds and has exceeded the execution time threshold.  If this continues to occur, it may represent a configuration issue.  Please see http://go.microsoft.com/fwlink/?LinkId=246987 for more details.”

The fix for the problem is to export the SharePoint Root Authority certificate using PowerShell and import it into the Trusted Root Certificate store.  Open the SharePoint 2013 Management Shell as an administrator.

$SProotCert = (Get-SPCertificateAuthority).RootCertificate
$SProotCert.Export(“Cer”) | Set-Content C:\Test\SProotCert.cer –Encoding Byte

Open the Certificates MMC by opening a Run command and type MMC.  Choose File -> Add/Remove Snap-in.  Select the Certificates Snap-in and click Add.  On the next screen select Computer account and click Next followed by Local computer and Ok.



Right-click on Trusted Root Certificates and choose All Tasks -> Import



Complete the wizard by loading the certificate you exported using PowerShell.  Repeat the process on all SharePoint servers experiencing the issue.

These steps fixed the error on most of our SharePoint servers, but it remained on two.  In order to fix the error on the two remaining servers I configured proxy access through Internet Explorer, then from an elevated command prompt ran “netsh winhttp import proxy source=ie”  This configures Windows to use the IE proxy configuration as a default.  The servers were then able to access the internet and verify the certificates.

Thursday, 2 June 2016

Re-Create (Generate) SharePoint Root Authority "local" certificate

If your are looking to re-create (re-generate) your SharePoint Root Authority "local" certificate, here are the commands to do so...

I accidentally deleted mine, so I exported from other farm members

To Export:
-------------
$rootCert = (Get-SPCertificateAuthority).RootCertificate
$rootCert.Export("Cert") | Set-Content C:\Temp\FarmRoot.cer -Encoding byte

To Import:
-------------
$rootCert = Get-PfxCertificate C:\Temp\FarmRoot.cer
New-SPTrustedRootAuthority  -Certificate $rootCert

Wednesday, 11 May 2016

Delete all sites from a site collection

$url = "http://yourweb.com"
$subsites = ((Get-SPWeb $url).Site).allwebs | ?{$_.url -like $url +"/*"}

foreach($subsite in $subsites) { Remove-SPWeb $subsite.url }


Here you go, full script of deleting all subsites / webs under a site collection, you can also add your subsite to delete the childs of that subsite only.

Tuesday, 5 April 2016

SharePoint 2013: The number of Distributed Cache hosts in the farm exceeds the recommended value

  1. Verify that you have the following memberships:
    • securityadmin fixed server role on the SQL Server instance.
    • db_owner fixed database role on all databases that are to be updated.
    • Administrators group on the server on which you are running the Windows PowerShell cmdlets.
    • Farm Administrators group.
    An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint 2013 cmdlets.

  2. Start the SharePoint 2013 Management Shell.
    • For Windows Server 2008 R2:
      • On the Start menu, click All Programs, click Microsoft SharePoint 2013 Products, and then click SharePoint 2013 Management Shell.
    • For Windows Server 2012:
      1. On the Start screen, click SharePoint 2013 Management Shell.
        If SharePoint 2013 Management Shell is not on the Start screen:
      2. Right-click Computer, click All apps, and then click SharePoint 2013 Management Shell.

Tuesday, 1 March 2016

How SharePoint farm locates its configuration database

Did you ever wonder how SharePoint farm locates its configuration database. It’s not in a web.config or in any other configuration files. It’s actually a lot simpler than it probably should have been. SharePoint actually stores the connection to the configuration database in the registry (see dsn key).

SharePoint 2007: HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ConfigDB

SharePoint 2010: HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\Secure\ConfigDB

SharePoint 2013: HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0\Secure\ConfigDB (this one I have not actually checked, but I am betting it’s still there)

Scary, isn’t it?

Monday, 1 February 2016

MOSS 2007 An update conflict has occurred, and you must re-try this action

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. To do this, follow these steps:
  1. Stop the Timer service. To do this, follow these steps:
    1. Click Start, point to Administrative Tools, and then click Services.
    2. Right-click Windows SharePoint Services Timer, and then click Stop.
    3. Close the Services console.
  2. On the computer that is running Microsoft Office SharePoint Server 2007 and on which the Central Administration site is hosted, click Start, click Run, type explorer, and then press ENTER.
  3. In Windows Explorer, locate and then double-click the following folder:
    Drive:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\GUID
    Notes
    • The Drive placeholder specifies the letter of the drive on which Windows is installed. By default, Windows is installed on drive C.
    • The GUID placeholder specifies the GUID folder.
    • The Application Data folder may be hidden. To view the hidden folder, follow these steps:
      1. On the Tools menu, click Folder Options.
      2. Click the View tab.
      3. In the Advanced settings list, click Show hidden files and folders under Hidden files and folders, and then click OK.
    • In Windows Server 2008, the configuration cache is in the following location:
      Drive:\ProgramData\Microsoft\SharePoint\Config\GUID
  4. Back up the Cache.ini file.
  5. Delete all the XML configuration files in the GUID folder. Do this so that you can verify that the GUID folder is replaced by new XML configuration files when the cache is rebuilt. 

    Note When you empty the configuration cache in the GUID folder, make sure that you do not delete the GUID folder and the Cache.ini file that is located in the GUID folder.
  6. Double-click the Cache.ini file.
  7. On the Edit menu, click Select All.
  8. On the Edit menu, click Delete.
  9. Type 1, and then click Save on the File menu.
  10. On the File menu, click Exit.
  11. Start the Timer service. To do this, follow these steps:
    1. Click Start, point to Administrative Tools, and then click Services.
    2. Right-click Windows SharePoint Services Timer, and then click Start.
    3. Close the Services console.
    Note The file system cache is re-created after you perform this procedure. Make sure that you perform this procedure on all servers in the server farm.
  12.  Make sure that the Cache.ini file has been updated. For example it should no longer be 1 if the cache has been updated.
  13. Click Start, point to Programs, point to Administrative Tools, and then click SharePoint 3.0 Central Administration.
  14. Click the Operations tab, and then click Timer job status under Global Configuration.
  15. In the list of timer jobs, verify that the status of the Config Refresh entry is Succeeded.
  16. On the File menu, click Close.

Tuesday, 19 January 2016

SharePoint Offline and Manual Prerequisite Procedures

Installing the Roles and Features for SharePoint 2013 on Windows Server 2012 Offline with PowerShell

To install the Roles/Features required by SharePoint 2013 on Windows Server 2012 in an offline environment, you need to have access to the Windows Server 2012 installation media.

For the purposes of example, assume you have mounted the Windows Server 2012 installation media (ISO) to the D: drive of the server. Please note that you can also copy the files locally or specify a UNC path where the installation files are stored. You need to specify

Open an elevated PowerShell prompt (i.e. Run as Administrator) and execute the following:

Import-Module ServerManager

Add-WindowsFeature Net-Framework-Features,Web-Server,Web-WebServer,Web-Common-Http,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-App-Dev,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Security,Web-Basic-Auth,Web-Windows-Auth,Web-Filtering,Web-Digest-Auth,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,Application-Server,AS-Web-Support,AS-TCP-Port-Sharing,AS-WAS-Support, AS-HTTP-Activation,AS-TCP-Activation,AS-Named-Pipes,AS-Net-Framework,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,Web-Lgcy-Scripting,Windows-Identity-Foundation,Server-Media-Foundation,Xps-Viewer –Source D:\sources\sxs


Your server will require a reboot after running this PowerShell code.