You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[AI-Suggested] Content update request from UUF signal: Connect to SQL Server When System Administrators Are Locked Out - SQL Server | Microsoft Learn #16
Rating: 👎 Reasons: Not provided Page Views: Submitted: 2026-07-12
Suggested Fixes
Note
Suggestions are generated by AI and they may not be entirely accurate or complete. Please check impacted files scope and suggestions details before making changes.
In the Step-by-step instructions > Use PowerShell section, replace the ambiguous placeholder $service_name = "MSSQL$instancename"` with explicit guidance on how to find the actual Windows service name for both default and named instances, and provide copy/pasteable code to auto-discover it. For example, insert a short subsection immediately before step 2 titled “Find the SQL Server Database Engine service name” with text and code like:
- Default instance service name: MSSQLSERVER
- Named instance service name: MSSQL$<InstanceName> (the $ is literal in the Windows service name)
```powershell
# List SQL Server Database Engine services (default + named)
Get-Service -Name 'MSSQL*' | Select-Object Name, DisplayName, Status
# Example: set service_name for a named instance (no backtick needed)
$instanceName = 'MYINSTANCE'
$service_name = "MSSQL$$instanceName" # results in MSSQL$MYINSTANCE
# Example: set service_name for a default instance
$service_name = 'MSSQLSERVER'
```
Also mention an alternative discovery path in one sentence (e.g., “You can also find the service name in SQL Server Configuration Manager > SQL Server Services”).
In the same Use PowerShell step 2 code block, explicitly label which values are placeholders to replace and remove the backtick-based escaping that currently implies the user should type the backtick and literal $instancename. Update the snippet to use either (a) explicit example values or (b) a variable-driven construction, and add an inline comment showing what to replace. For example:
```powershell
# Replace with your SQL Server instance name (leave empty for default instance)
Then keep step 3 as net stop $service_name, but add a one-line note directly under it: “If you get ‘invalid service name’, re-run Get-Service -Name 'MSSQL*' and use the Name value exactly.”
Documentation Update: Connect to SQL Server When System Administrators Are Locked Out - SQL Server | Microsoft Learn
Customer Feedback
Page: Connect to SQL Server When System Administrators Are Locked Out - SQL Server | Microsoft Learn
Source File: https://github.com/MicrosoftDocs/sql-docs/blob/live/docs/database-engine/configure-windows/connect-to-sql-server-when-system-administrators-are-locked-out.md
Feedback:
Rating: 👎
Reasons: Not provided
Page Views:
Submitted: 2026-07-12
Suggested Fixes
Note
Suggestions are generated by AI and they may not be entirely accurate or complete. Please check impacted files scope and suggestions details before making changes.
In the Step-by-step instructions > Use PowerShell section, replace the ambiguous placeholder
$service_name = "MSSQL$instancename"` with explicit guidance on how to find the actual Windows service name for both default and named instances, and provide copy/pasteable code to auto-discover it. For example, insert a short subsection immediately before step 2 titled “Find the SQL Server Database Engine service name” with text and code like:- Default instance service name:
MSSQLSERVER- Named instance service name:
MSSQL$<InstanceName>(the $ is literal in the Windows service name)```powershell
# List SQL Server Database Engine services (default + named)
Get-Service -Name 'MSSQL*' | Select-Object Name, DisplayName, Status
# Example: set service_name for a named instance (no backtick needed)
$instanceName = 'MYINSTANCE'
# Example: set service_name for a default instance
$service_name = 'MSSQLSERVER'
```
Also mention an alternative discovery path in one sentence (e.g., “You can also find the service name in SQL Server Configuration Manager > SQL Server Services”).
In the same Use PowerShell step 2 code block, explicitly label which values are placeholders to replace and remove the backtick-based escaping that currently implies the user should type the backtick and literal
$instancename. Update the snippet to use either (a) explicit example values or (b) a variable-driven construction, and add an inline comment showing what to replace. For example:```powershell
# Replace with your SQL Server instance name (leave empty for default instance)
$instanceName = 'MYINSTANCE' # e.g., MYINSTANCE
$machineName = 'MYMACHINE' # e.g., SQL01
$sql_server_instance = if ($instanceName) { "$machineName$instanceName" } else { $machineName }
$service_name = if ($instanceName) { "MSSQL$ $instanceName" } else { 'MSSQLSERVER' }
$login_to_be_granted_access = 'CONTOSO\PatK'
```
Then keep step 3 as
net stop $service_name, but add a one-line note directly under it: “If you get ‘invalid service name’, re-runGet-Service -Name 'MSSQL*'and use the Name value exactly.”📚 To learn more about agentic content maintenance workflow, visit Agentic workflow for Learn content maintenance. Sign in using Learn Profile to access the content on this link.
💬 Share your feedback on the Learn Content Maintenance Agentic Workflow here.