Blog Post Title One
# Define the Pool FQDN and the list of Front End Servers in the pool
$PoolFqdn = "<Your Pool FQDN>"
$FrontEndServers = @("<FrontEndServer1>", "<FrontEndServer2>", "<FrontEndServer3>") # Add all your Front End Servers here
# Define the path to the update installer
$UpdateInstaller = "C:\Path\To\SkypeServerUpdateInstaller.exe"
# Define the log file path
$LogFile = "C:\Path\To\Install-Update.log"
foreach ($Server in $FrontEndServers) {
try {
Write-Host "Starting update process for $Server"
# Check the pool fabric state
$FabricState = Get-CsPoolFabricState -PoolFqdn $PoolFqdn
# Check for missing replicas and reset pool registrar state if needed
if ($FabricState.MissingReplica.Count -gt 0) {
Write-Host "Missing replicas detected. Running Quorum Loss Recovery."
Reset-CsPoolRegistrarState -PoolFqdn $PoolFqdn -ResetType QuorumLossRecovery
} else {
Write-Host "No missing replicas detected."
}
# Invoke computer failover
Invoke-CsComputerFailOver -ComputerName $Server -Force
# Stop the services on the Front End server
Invoke-Command -ComputerName $Server -ScriptBlock {
Stop-CsWindowsService -Force
}
# Install the update
Invoke-Command -ComputerName $Server -ScriptBlock {
param($UpdateInstaller, $LogFile)
msiexec.exe /p $UpdateInstaller /l*v $LogFile
} -ArgumentList $UpdateInstaller, $LogFile
# Start the services on the Front End server
Invoke-Command -ComputerName $Server -ScriptBlock {
Start-CsWindowsService
}
Write-Host "Update process completed for $Server"
}
catch {
Write-Error "An error occurred on $Server: $_"
}
}
Write-Host "Update process completed for all servers in the pool."