大网数据广告活动
数据库与应用安全

Resolve gMSA Failures in a SQL Server Failover Cluster Instance

· 52CE 我爱测

Learn how to resolve SQL Server failover cluster instance (FCI) setup, add-node, startup, and failover failures when a possible owner node can't use the gMSA.

Applies to:   SQL Server on Windows

Summary

This article helps you troubleshoot SQL Server failover cluster instance (FCI) Setup, add-node, startup, and failover failures when the SQL Server service runs under a group managed service account (gMSA). It covers managed password retrieval on every possible owner node, node-specific rights and startup parameters, incomplete Setup state, and cluster resource failures.

Before you start, review the prerequisites and run the quick validation checklist in Troubleshoot SQL Server setup, startup, and authentication failures with gMSAs.

Symptoms

  • FCI Setup fails during account validation.
  • An add-node operation reports inconsistent service-account information.
  • SQL Server starts from the command line but not through the cluster.
  • Failover fails because node-specific startup parameters or configuration are missing.

Cause

FCI failures can involve password retrieval, incomplete Setup metadata, node-specific startup parameters, rights that differ by node, storage access, or Cluster Service health checks. The gMSA-specific cause is that one or more possible owner nodes aren't authorized to retrieve the managed password, so the instance works on some nodes and fails on others.

Diagnose failover cluster instance failures

  1. Run the quick validation checklist on every possible owner node and compare the results.

    Run the following commands on every possible owner node.

    Test-ADServiceAccount -Identity 'SQLgMSA'
    sc.exe qmanagedaccount MSSQLSERVER
    Get-ClusterResource | Format-Table Name, ResourceType, State, OwnerGroup -AutoSize
    
  2. Compare service identity, managed-account state, effective rights, and startup parameters across nodes.

    Expected result: Test-ADServiceAccount returns True on every possible owner node, and service configuration and startup parameters are consistent for the same FCI.

  3. Review Setup history for canceled or incomplete add-node operations.

  4. Collect the SQL Server error log and the cluster log for the same resource transition.

    Generate a cluster log by running the following command.

    Get-ClusterLog -UseLocalTime -Destination C:\Temp
    

Resolve failover cluster instance failures

Use the solution that matches the evidence from the diagnostic steps.

Authorize every possible owner node to retrieve the managed password

Authorize every possible owner node to retrieve the managed password, and then retest failover to each node. If the gMSA authorizes individual computer accounts, Set-ADServiceAccount replaces the complete authorized-principal list. Review the existing value first, and include every principal that must remain authorized.

# Review the gMSA configuration
Get-ADServiceAccount -Identity "SQLgMSA" `
    -Properties PrincipalsAllowedToRetrieveManagedPassword |
    Select-Object Name, PrincipalsAllowedToRetrieveManagedPassword

# If individual computer accounts are used, authorize each possible owner node
Set-ADServiceAccount -Identity "SQLgMSA" `
    -PrincipalsAllowedToRetrieveManagedPassword "NODE1$","NODE2$","NODE3$"

# Verify the gMSA from each possible owner node
Invoke-Command -ComputerName NODE1,NODE2,NODE3 {
    Test-ADServiceAccount -Identity "SQLgMSA"
}

If a security group authorizes the gMSA, add the possible owner nodes to that group instead of replacing the existing gMSA principals.

Add-ADGroupMember -Identity "SQL-FCI-gMSA-Nodes" `
    -Members "NODE1$","NODE2$","NODE3$"

For more information, see the following articles:

Correct node-specific rights, startup parameters, or incomplete Setup state

Correct confirmed node-specific rights, startup parameters, or incomplete Setup state. Run the following commands on each node and compare the results. Replace <InstanceID> with the instance ID, such as MSSQL16.MSSQLSERVER.

# Verify the SQL Server service account on each node
Get-CimInstance Win32_Service -Filter "Name='MSSQLSERVER'" |
    Select-Object Name, StartName, State, StartMode

# Compare SQL Server startup parameters on each node
reg query "HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\<InstanceID>\MSSQLServer\Parameters"

# Check the SQL Server Windows service configuration
sc.exe qc MSSQLSERVER

Use SQL Server Configuration Manager to correct startup-parameter differences instead of editing the registry manually. For more information, see the following articles:

Troubleshoot cluster resource failures that aren't related to the service account

If the cluster resource failure isn't related to the service account, use the following commands to review the clustered roles, cluster resources, and cluster log.

# List clustered roles and their current owner/state
Get-ClusterGroup

# List cluster resources and their current state
Get-ClusterResource |
    Format-Table Name, ResourceType, State, OwnerGroup -AutoSize

# Identify SQL Server-related cluster resources
Get-ClusterResource |
    Where-Object { $_.ResourceType -like "*SQL*" } |
    Format-Table Name, ResourceType, State, OwnerGroup -AutoSize

# Generate cluster logs
New-Item -ItemType Directory -Path "C:\ClusterLogs" -Force
Get-ClusterLog -UseLocalTime -Destination "C:\ClusterLogs"

The FailoverClusters PowerShell module provides the Get-ClusterGroup, Get-ClusterResource, and Get-ClusterLog cmdlets. For more information about these cmdlets, see the following articles:

For SQL Server-specific failures, see the following articles:

Re-create missing resource-specific registry keys

To re-create missing resource-specific registry keys, follow the steps in Manually re-create resource-specific registry keys. Before you make the documented registry changes, identify the SQL Server cluster resources and back up the cluster registry.

# Identify the SQL Server cluster resources
Get-ClusterResource |
    Where-Object { $_.ResourceType -like "*SQL*" } |
    Format-Table Name, ResourceType, State, OwnerGroup

# Back up the cluster registry before making documented registry changes
New-Item -ItemType Directory -Path "C:\Temp" -Force
reg export "HKLM\Cluster" "C:\Temp\ClusterRegistryBackup.reg" /y

Caution: Don't copy registry values between unrelated instances. Verify the instance ID, shared-storage paths, clustered role, and node before you make a change.

Collect diagnostic data

If the failure persists after you complete these steps, collect diagnostic data from every possible owner node, including the cluster log for the same resource transition. For the gMSA-specific evidence and standard SQL Server logs to gather, see Collect diagnostic data in the gMSA troubleshooting overview. Use that data to continue the investigation or to open a support case.

Related content

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 09/29/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。