How to avoid Forced reboots using unattended upgrades to SQL Server 2014
Hi Craig,


I may have a solution for you.

You should go to the registry and delete the registry key below:
HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations

I've created PS scripts for upgrading SQL Server Instances.

Here an example:





# Select the source path and the Instance name.
# Launch the script on a PowerShell console as Administrator.

$SourcePath = "\\MYNAS\Sources\SQL Server 2014"
$InstanceName = "MYINSTANCE1"

Set-Location $SourcePath

$exists = Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager"  -Name "PendingFileRenameOperations"  -ErrorAction SilentlyContinue
    If (($exists -ne $null) -and ($exists.Length -ne 0)) {
        Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager"  -Name "PendingFileRenameOperations"
    }

.\setup.exe /ACTION="Upgrade" /Q /INDICATEPROGRESS="True" /INSTANCENAME=$InstanceName /IACCEPTSQLSERVERLICENSETERMS

$InstanceName = "MYINSTANCE2"

Set-Location $SourcePath

$exists = Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager"  -Name "PendingFileRenameOperations"  -ErrorAction SilentlyContinue
    If (($exists -ne $null) -and ($exists.Length -ne 0)) {
        Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager"  -Name "PendingFileRenameOperations"
    }

.\setup.exe /ACTION="Upgrade" /Q /INDICATEPROGRESS="True" /INSTANCENAME=$InstanceName /IACCEPTSQLSERVERLICENSETERMS





I hope this will help.

Max.