Category Archives: psconfig

Patching SharePoint Server 2013

Patching SharePoint Server 2013 step by step

Patching SharePoint Server 2013 step by step

Patching SharePoint server 2013 is one of the most difficult task that everyone want to know how to implement step by step. Watching this video, you will feel like its very easy to implement, but truly its equally risky. So careful while implementing the steps. Watch the below video for details. SharePoint 2013 patching best practices is followed here also how to run psconfig (sharepoint configuration wizard steps) after patching is shown in the video.

  • Download the KB   (sharepoint 2013 cumulative update/Patch download link)from the URL as shown in the video.
Patching SharePoint
  • Extract files after download and you will find 3 files of extension “.exe , .cab, .cab”.
Patch 1321x705
Advertisements
Advertisements
  • Copy this below code to notepad and save as in “.ps 1”
########################### 
##Ensure Patch is Present## 
########################### 
$patchfile = Get-ChildItem | where{$_.Extension -eq ".exe"}
if($patchfile -eq $null)
{
  Write-Host "Unable to retrieve the file.  Exiting Script" -ForegroundColor Red
  Return
}

######################## 
##Stop Search Services## 
######################## 
##Checking Search services##
$srchctr = 1
$srch4srvctr = 1
$srch5srvctr = 1
$srv4 = get-service "OSearch15"
$srv5 = get-service "SPSearchHostController"

If(($srv4.status -eq "Running") -or ($srv5.status-eq "Running"))
  {
    Write-Host "Choose 1 to Pause Search Service Application" -ForegroundColor Cyan
    Write-Host "Choose 2 to leave Search Service Application running" -ForegroundColor Cyan
    $searchappresult = Read-Host "Press 1 or 2 and hit enter"
    Write-Host
   
   if($searchappresult -eq 1)
    {
        $srchctr = 2
        Write-Host "Pausing the Search Service Application" -foregroundcolor yellow
        Write-Host "This could take a few minutes" -ForegroundColor Yellow
        $ssa = get-spenterprisesearchserviceapplication
        $ssa.pause()
    }

    elseif($searchappresult -eq 2)
    {
        Write-Host "Continuing without pausing the Search Service Application"
    }
    else
    {
        Write-Host "Run the script again and choose option 1 or 2" -ForegroundColor Red
        Write-Host "Exiting Script" -ForegroundColor Red
        Return
    }
  }

Write-Host "Stopping Search Services if they are running" -foregroundcolor yellow
if($srv4.status -eq "Running")
  {
    $srch4srvctr = 2
    set-service -Name "OSearch15" -startuptype Disabled
    $srv4.stop()
  }

if($srv5.status -eq "Running")
  {
    $srch5srvctr = 2
    Set-service "SPSearchHostController" -startuptype Disabled
    $srv5.stop()
  }

do
  {
    $srv6 = get-service "SPSearchHostController"
    if($srv6.status -eq "Stopped")
    {
        $yes = 1
    }
    Start-Sleep -seconds 10
  }
  until ($yes -eq 1)

Write-Host "Search Services are stopped" -foregroundcolor Green
Write-Host 

####################### 
##Stop Other Services## 
####################### 
Set-Service -Name "IISADMIN" -startuptype Disabled
Set-Service -Name "SPTimerV4" -startuptype Disabled
Write-Host "Gracefully stopping IIS W3WP Processes" -foregroundcolor yellow
Write-Host
iisreset -stop -noforce
Write-Host "Stopping Services" -foregroundcolor yellow
Write-Host
$srv2 = get-service "SPTimerV4"
  if($srv2.status -eq "Running")
  {$srv2.stop()}

Write-Host "Services are Stopped" -ForegroundColor Green
Write-Host
Write-Host 

################## 
##Start patching## 
################## 
Write-Host "Patching now keep this PowerShell window open" -ForegroundColor Magenta
Write-Host
$starttime = Get-Date
$filename = $patchfile.basename
Start-Process $filename
Start-Sleep -seconds 20 
$proc = get-process $filename
$proc.WaitForExit()
$finishtime = get-date
Write-Host
Write-Host "Patch installation complete" -foregroundcolor green
Write-Host 

################## 
##Start Services## 
################## 
Write-Host "Starting Services Backup" -foregroundcolor yellow
Set-Service -Name "SPTimerV4" -startuptype Automatic
Set-Service -Name "IISADMIN" -startuptype Automatic

##Grabbing local server and starting services##
$servername = hostname
$server = get-spserver $servername

$srv2 = get-service "SPTimerV4"
$srv2.start()
$srv3 = get-service "IISADMIN"
$srv3.start()
$srv4 = get-service "OSearch15"
$srv5 = get-service "SPSearchHostController"

###Ensuring Search Services were stopped by script before Starting"
if($srch4srvctr -eq 2)
{
    set-service -Name "OSearch15" -startuptype Automatic
    $srv4.start()
}
if($srch5srvctr -eq 2)
{
    Set-service "SPSearchHostController" -startuptype Automatic
    $srv5.start()
}

###Resuming Search Service Application if paused### 
if($srchctr -eq 2)
{
    Write-Host "Resuming the Search Service Application" -foregroundcolor yellow
    $ssa = get-spenterprisesearchserviceapplication
    $ssa.resume()
}

Write-Host "Services are Started" -foregroundcolor green
Write-Host
Write-Host
Write-Host "Script Duration" -foregroundcolor yellow
Write-Host "Started: " $starttime -foregroundcolor yellow
Write-Host "Finished: " $finishtime -foregroundcolor yellow
Write-Host "Script Complete"
  • Save all files that is of extensions “.exe , .cab, .cab, .ps 1” in one folder.
Patching SharePoint Server
  • Open “SharePoint Management Shell”.
  • Navigate to the folder in which all files are stored and run the Powershell script.
  • Next step is to run the config wizard. Please find the video in detail step by step further.

how to run sharepoint configuration wizard steps (psconfig)

Advertisements
Advertisements
Advertisements
Patching SharePoint Server 2013

Patching SharePoint Server 2013 step by step

Advertisements

Advertisements

Patching SharePoint Server 2013

Patching SharePoint server 2013 is one of the most difficult task that everyone want to know how to implement step by step. Watching this video, you will feel like its very easy to implement, but truly its equally risky. So careful while implementing the steps. Watch the below video for details.

      1. Download the KB from the URL as shown in the video.Patching SharePoint
      2. Extract files after download and you will find 3 files of extension ".exe , .cab, .cab".Patch 1321x705
      3. Copy this below code to notepad and save as ".ps 1" ###########################
        ##Ensure Patch is Present##
        ###########################
        $patchfile = Get-ChildItem | where{$_.Extension -eq ".exe"}
        if($patchfile -eq $null)
        {
        Write-Host "Unable to retrieve the file. Exiting Script" -ForegroundColor Red
        Return
        }########################
        ##Stop Search Services##
        ########################
        ##Checking Search services##
        $srchctr = 1
        $srch4srvctr = 1
        $srch5srvctr = 1$srv4 = get-service "OSearch15"
        $srv5 = get-service "SPSearchHostController"If(($srv4.status -eq "Running") -or ($srv5.status-eq "Running"))
        {
        Write-Host "Choose 1 to Pause Search Service Application" -ForegroundColor Cyan
        Write-Host "Choose 2 to leave Search Service Application running" -ForegroundColor Cyan
        $searchappresult = Read-Host "Press 1 or 2 and hit enter"
        Write-Hostif($searchappresult -eq 1)
        {
        $srchctr = 2
        Write-Host "Pausing the Search Service Application" -foregroundcolor yellow
        Write-Host "This could take a few minutes" -ForegroundColor Yellow
        $ssa = get-spenterprisesearchserviceapplication
        $ssa.pause()
        }elseif($searchappresult -eq 2)
        {
        Write-Host "Continuing without pausing the Search Service Application"
        }
        else
        {
        Write-Host "Run the script again and choose option 1 or 2" -ForegroundColor Red
        Write-Host "Exiting Script" -ForegroundColor Red
        Return
        }
        }

        Write-Host "Stopping Search Services if they are running" -foregroundcolor yellow
        if($srv4.status -eq "Running")
        {
        $srch4srvctr = 2
        set-service -Name "OSearch15" -startuptype Disabled
        $srv4.stop()
        }

        if($srv5.status -eq "Running")
        {
        $srch5srvctr = 2
        Set-service "SPSearchHostController" -startuptype Disabled
        $srv5.stop()
        }

        do
        {
        $srv6 = get-service "SPSearchHostController"
        if($srv6.status -eq "Stopped")
        {
        $yes = 1
        }
        Start-Sleep -seconds 10
        }
        until ($yes -eq 1)

        Write-Host "Search Services are stopped" -foregroundcolor Green
        Write-Host

        #######################
        ##Stop Other Services##
        #######################
        Set-Service -Name "IISADMIN" -startuptype Disabled
        Set-Service -Name "SPTimerV4" -startuptype Disabled
        Write-Host "Gracefully stopping IIS W3WP Processes" -foregroundcolor yellow
        Write-Host
        iisreset -stop -noforce
        Write-Host "Stopping Services" -foregroundcolor yellow
        Write-Host

        $srv2 = get-service "SPTimerV4"
        if($srv2.status -eq "Running")
        {$srv2.stop()}

        Write-Host "Services are Stopped" -ForegroundColor Green
        Write-Host
        Write-Host

        ##################
        ##Start patching##
        ##################
        Write-Host "Patching now keep this PowerShell window open" -ForegroundColor Magenta
        Write-Host
        $starttime = Get-Date

        $filename = $patchfile.basename

        Start-Process $filename

        Start-Sleep -seconds 20
        $proc = get-process $filename
        $proc.WaitForExit()

        $finishtime = get-date
        Write-Host
        Write-Host "Patch installation complete" -foregroundcolor green
        Write-Host

        ##################
        ##Start Services##
        ##################
        Write-Host "Starting Services Backup" -foregroundcolor yellow
        Set-Service -Name "SPTimerV4" -startuptype Automatic
        Set-Service -Name "IISADMIN" -startuptype Automatic

        ##Grabbing local server and starting services##
        $servername = hostname
        $server = get-spserver $servername

        $srv2 = get-service "SPTimerV4"
        $srv2.start()
        $srv3 = get-service "IISADMIN"
        $srv3.start()
        $srv4 = get-service "OSearch15"
        $srv5 = get-service "SPSearchHostController"

        ###Ensuring Search Services were stopped by script before Starting"
        if($srch4srvctr -eq 2)
        {
        set-service -Name "OSearch15" -startuptype Automatic
        $srv4.start()
        }
        if($srch5srvctr -eq 2)
        {
        Set-service "SPSearchHostController" -startuptype Automatic
        $srv5.start()
        }

        ###Resuming Search Service Application if paused###
        if($srchctr -eq 2)
        {
        Write-Host "Resuming the Search Service Application" -foregroundcolor yellow
        $ssa = get-spenterprisesearchserviceapplication
        $ssa.resume()
        }

        Write-Host "Services are Started" -foregroundcolor green
        Write-Host
        Write-Host
        Write-Host "Script Duration" -foregroundcolor yellow
        Write-Host "Started: " $starttime -foregroundcolor yellow
        Write-Host "Finished: " $finishtime -foregroundcolor yellow
        Write-Host "Script Complete"

      4. Save all files that is of extensions ".exe , .cab, .cab, .ps 1" in one folder.Patching SharePoint
      5. Open "SharePoint Management Shell".
      6. Navigate to the folder in which all files are stored and run the Powershell script.
      7. Next step is to run the config wizard. Please find the video in detail step by step further.

 

 

Advertisements

Advertisements

Cannot connect to database master 1920x1080

Cannot connect to database master SharePoint 2016

Advertisements

Advertisements

Cannot connect to database master

While running psconfig wizard got error as "Cannot connect to database master at SQL Server at server_name. The database might not exist, or the current user does not have permission to connect to it"

Error:

"Cannot connect to database master at SQL Server at server_name. The database might not exist, or the current user does not have permission to connect to it" 

cannot-connect-to-database-master-at-server_sharepoint2016

Solution:

Open the Windows Firewall with Advanced Services and add an inbound rule to allow traffic over port 1433.

 

Advertisements

Advertisements

api-ms-win-crt-heap-l1-1-0.dll missing 1920x1080

Program can’t start because api-ms-win-crt-heap-l1-1-0.dll is missing SharePoint2016

This program can’t start because api-ms-win-crt-heap-l1-1-0.dll is missing from your computer.” error while running SharePoint Products Configuration Wizard.

api-ms-win-crt-heap-l1-1-0

*Missing update patches “Windows 10 Universal Runtime update” for Windows Server 2012 R2.

  • Installation of Windows Server 2012 R2 patch KB299926 is required so as to resolve this issue.

But  “The update is not applicable to your computer.” error came after that as below.

kb2919355

This is because Windows 10 Universal C Runtime KB2999226 is dependent on a Windows Server 2012 R2 Cumulative Update package in KB2919355.

Check windows updates, install patch KB2919355 and “The update is not applicable to your computer.”error will be resolved and after which there will be no error in installation of  the Windows 10 Universal C Runtime.

Have a look into my previous post Install Prerequisite (prerequisiteinstaller.exe) SharePoint 2016.

Unable to install Microsoft Information Protection and control Client 2.1 error SharePoint 2016

The license state for the current server doesn't match the farm's license state

The license state for the current server doesn’t match the farm’s license state

Advertisements

Advertisements

The license state for the current server doesn't match the farm's license state

Recently I have involved in an interesting troubleshooting issue. There are many blog posts and TechNet discussions about this error "The license state for the current server doesn't match the farm's license state". Thought that to post it here about my experience.

Here is the scenario. Customer has two Windows 2008 R2 Std machines (lets call it as srvsp1 & srvsp2) installed and configured with the following products.

  1. SharePoint Server 2010 Enterprise Edition
  2. Office Web Apps

Recently we have patched those two servers , for some troubleshooting one of the servers (srvsp2) was disconnected from the farm. After completing the installation while trying to add the server back to the farm by running the PSConfig we got the below error,

The license state for the current server doesn't match the farm's license state.
System.InvalidOperationException: The current server cannot be joined to this farm because the set of installed products does not match the products installed in the farm.

The license state for the current server doesn't match the farm's license state.
at Microsoft.SharePoint.Administration.SPFarm.Join()
at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.CreateOrConnectConfigDb()
at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.Run()
at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()

Here are the troubleshooting steps.

# Step 1

Verify the configuration database has correct entries of all installed products. For that , we ran the following query against the “Objects” table of SharePoint configuration database.

Select * from Objects with (nolock) where properties like '%icrosoft.SharePoint.Administration.SPInstallState%'

From the result copy the “Properties” column value to notepad or any xml editor tool, in my case I have used Visual Studio.

2577.image_3AD92119

Values that we are interested the ones highlighted in the below screenshot. Same is given below.

beed1f75-c398-4447-aef1-e66e1f0df91e
d5595f62-449b-4061-b0b2-0cbad410bb51

4774.image_1834E29E

# Step 2

Once we get those GUIDs, next step is make sure that any difference in the actual Physical SharePoint server’s installed products and configuration database.

To do that, check the below registry location in both the SharePoint Servers (srvsp1 & srvsp2).

HKEY_LOCAL_MACHINESOFTWAREMicrosoftShared ToolsWeb Server Extensions14.0WSSInstalledProducts

6837.image_75FCD717

{90140000-1014-0000-1000-0000000FF1CE} REG_SZ BEED1F75-C398-4447-AEF1-E66E1F0DF91E
{90140000-110D-0000-1000-0000000FF1CE} REG_SZ D5595F62-449B-4061-B0B2-0CBAD410BB51
{90140000-112D-0000-1000-0000000FF1CE} REG_SZ 926E4E17-087B-47D1-8BD7-91A394BC6196

Here we can clearly see that the physical box has 3 entries whereas the configuration database has only 2 of them.

More details of the GUIDs are given below.

BEED1F75-C398-4447-AEF1-E66E1F0DF91E is for "SharePoint Foundation 2010",

D5595F62-449B-4061-B0B2-0CBAD410BB51 is for "SharePoint Server 2010 Enterprise"

926E4E17-087B-47D1-8BD7-91A394BC6196 is for “Office Web Companions 2010" (Office Web Apps)

(Just FYI, for more information all different product SKUs and it’s GUIDs please refer this article http://msdn.microsoft.com/en-us/library/ff721969.aspx )

In our case, the Configuration database should have had 3 entries to match the registry in a normal farm. For some reason it was not updated with the office web apps production installation , it may caused by an installation issue.

Resolution:

Run the following Power Shell commandlet on any working server in the farm. In our case it was srvsp1, the reason we would need to run from this server is because the problem server – srvsp2 is still not in the farm.

Set-SPFarmConfig –InstalledProductsRefresh

This will pick the entries from the server and reset the entries in the Config DB. 

To double-check, you can run the same SQL query mentioned above and confirm the values.

Hope this will helpful while troubleshooting this specific issue related to SharePoint. There are different scenarios as well, eg: configuration database may have the values but it was not there in the physical server’s registry. To fix that you may end up with uninstall and install the product to update it correctly.

Advertisements

Advertisements