question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SPProductUpdate fails for 2 server farm when the ShutdownServices is set to True

See original GitHub issue

I am trying to automate SP update process with the SharepointDSC. One one farm scenario (like DEV machine it works ok) but for a 2 farm scenario is fails during pausing of the SSA.

The error is either Unable to connect to remote server, or ‘Connection was closed’(the latter I had only once so not sure about it) I can easily recreate the first one. After I complete installation on box 1 and try to run the code (copied form DSC) to pause the search from Box 2 I receive the first error.

  $searchSAs = Get-SPEnterpriseSearchServiceApplication
        foreach ($searchSA in $searchSAs)
        {
            $searchSA.Pause()
        }

Exception calling “Pause” with “0” argument(s): “Unable to connect to the remote server” At line:5 char:17

  •             $searchSA.Pause()
    
  •             ~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (😃 [], MethodInvocationException
    • FullyQualifiedErrorId : WebException

Is it something I am doing wrong? Should the ‘ShutdownServices’ be specified only for the server 1 and others should have it to ‘false’?

Configuration SPUpdate
{

    param(
            [Parameter(Mandatory = $true)]
            [PSCredential]$SetupAccount, 

            [Parameter(Mandatory = $true)]
            [string] $CUPath,

            [Parameter(Mandatory = $true)]
            [string] $CUFile

       )
      


    #This import is required to avoid the warrning message
    Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
    Import-DscResource -ModuleName SharePointDsc
    Import-DsCResource -ModuleName xPendingReboot
    $FullPathLocal = 'C:\Temp\'+$CUFile
    Node "localhost"
    {
         LocalConfigurationManager
    {
         RebootNodeIfNeeded = $True
    }

        File CUDirectoryCopy
        {
            Ensure = "Present"  # You can also set Ensure to "Absent"
            Type = "Directory" # Default is "File".
            Recurse = $true # Ensure presence of subdirectories, too #MS Probably not necessary in our case
            SourcePath = $CUPath  
            DestinationPath = "C:\Temp"
        }

        Log AfterCUDirectoryCopy
        {
            # The message below gets written to the Microsoft-Windows-Desired State Configuration/Analytic log
            Message = "Finished running the file resource with ID DirectoryCopy"
            DependsOn = "[File]CUDirectoryCopy" # This means run "DirectoryCopy" first.
        }


        SPProductUpdate InstallCU
            {
                SetupFile            = 'C:\Temp\'+$CUFile 
                ShutdownServices     = $true
                Ensure               = "Present"
                PsDscRunAsCredential = $SetupAccount
                DependsOn = "[File]CUDirectoryCopy"
            }

        Log AfterInstallCU
        {
            # The message below gets written to the Microsoft-Windows-Desired State Configuration/Analytic log
            Message = "Finished applying the CU on the server"
            DependsOn = "[SPProductUpdate]InstallCU" 
        }

        # Reboot if pending

        xPendingReboot RebootCheck1

        {

            Name = "RebootCheck1"

        }

        SPConfigWizard PSConfig
        {
            Ensure = "Present"
            PsDscRunAscredential = $SetupAccount
        }

        Log AfterPSCOnfig
        {
            # The message below gets written to the Microsoft-Windows-Desired State Configuration/Analytic log
            Message = "Finished applying the CU on the server"
            DependsOn = "[SPConfigWizard]PSConfig" 
        }
    }
}

Running Win2012 R2

SP16 January 2017 CU.

I am using SharepointDSC 2.2.0.0 and PS 5.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ykuijscommented, Jul 9, 2018

Fix will be included in my next Bugfix PR

0reactions
ykuijscommented, Jul 12, 2018

Closed via PR #838

Read more comments on GitHub >

github_iconTop Results From Across the Web

SPProductUpdate fails for 2 server farm when the ...
I am trying to automate SP update process with the SharepointDSC. One one farm scenario (like DEV machine it works ok) but for...
Read more >
Failed to connect to the existing server farm located at ...
Failed to connect to the existing server farm located at the specified database server and databse name. The database name is not a...
Read more >
SharePoint Database Errors
When I opened the central administration site I saw these errors: "Databases running in compatibility range, upgrade recommended." "The server ...
Read more >
Zero Data Loss Recovery Appliance - Owner's Guide
2 Site Requirements for Recovery Appliance and Oracle Exadata Storage. Expansion Rack. Ensuring That the Site is Ready. 2-1.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found