Pages

Monday, January 4, 2016

SharePoint PowerShell Command After Update, CU, or Upgrade Required | psconfig | inplace | b2b

SharePoint PowerShell Command After Update

After running SharePoint updates, CU, or patches the following command must be run on every SharePoint server, one server at a time, to ensure the update has been fully implemented.  Until the command is run and completed successful the update is not applied to the server even though the update bits have been installed on the server.



#When running straight from the PowerShell ISE add in the reference to SharePoint
Add-PSSnapin microsoft.sharepoint.powershell

#For a small update the following basic command can be used.  It has 4 configuration steps.
PSConfig.exe -cmd upgrade -inplace b2b -wait -force


#For major releases the command below should be used.  It has 6 to 7 configuration steps.
PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures



#If errors occur or the command does not complete successfully the following script can be used.

stsadm -o setproperty -pn command-line-upgrade-running -pv Yes

iisreset

PSConfig.exe -cmd upgrade -inplace b2b -wait -force

PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures

# if the above commands still fail, open IIS on server and make sure it is started and the sites are running
# somtimes the upgrade process stops the sites and doesn't start them back up



# as a last ditch effort, if the commands continues to fail, remove Microsoft SharePoint Foundation Web Application feature in CA for the server.
# This will remove the app pools and IIS sites.  It will also delete any custom changes that you have made to your web.config files.  It may also
# retract and turn off farm solutions.  That is why this step should only be used when nothing else works.



# Example of the basic command failing. performs 4 tasks.  If the basic upgrade command fails as seen below.  You can try to track down the issue through the logs but usually running the longer command with 7 steps will succeed.

Performing configuration task 3 of 4
Upgrading SharePoint Products...

Failed to upgrade SharePoint Products.

An exception of type Microsoft.SharePoint.Administration.SPUpdatedConcurrencyException was thrown.  Additional exception information: An update conflict has occurred,
 and you must re-try this action. The object SPUpgradeSession Name=Upgrade-20160607-105424-415 was updated by USERNAME, in the PSCONFIG (27172) process, on ma
chine SERVERNAME.  View the tracing log for more information about the conflict.

Total number of configuration settings run: 3
Total number of successful configuration settings: 2
Total number of unsuccessful configuration settings: 1
Successfully stopped the configuration of SharePoint Products.
Configuration of SharePoint Products failed.


# Basic version
PSConfig.exe -cmd upgrade -inplace b2b -wait -force
# Switch to the longer version
PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures

# The upgrade configuration steps completed successfully.  I'm not sure what caused the conflict and why the 4 step process failed.  All that really matters is the longer process was successful.

Successfully completed the SharePoint Products configuration.

Total number of configuration settings run: 6
Total number of successful configuration settings: 6
Total number of unsuccessful configuration settings: 0
Successfully stopped the configuration of SharePoint Products.
Configuration of the SharePoint Products has succeeded.




No comments:

Post a Comment