Accounts: Block Microsoft accounts: registry value NoConnectedUserComputerHKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System

Category
Security Settings › Local Policies › Security Options
Scope
Computer Configuration
Source
Windows 11 (version 26H2 · 26300.9457)

Registry

NoConnectedUser

REG_DWORDComputer
Enabled value
Depends on the option value
Element
Accounts: Block Microsoft accounts
Options
ItemStored value
This policy is disabled0
Users can't add Microsoft accounts1
Users can't add or log on with Microsoft accounts3
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System]

; Options (use only one)
; This policy is disabled
"NoConnectedUser"=dword:00000000
; Users can't add Microsoft accounts
"NoConnectedUser"=dword:00000001
; Users can't add or log on with Microsoft accounts
"NoConnectedUser"=dword:00000003
CMD
:: Options (use only one)

:: This policy is disabled
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "NoConnectedUser" /t REG_DWORD /d 0 /f
:: Users can't add Microsoft accounts
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "NoConnectedUser" /t REG_DWORD /d 1 /f
:: Users can't add or log on with Microsoft accounts
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "NoConnectedUser" /t REG_DWORD /d 3 /f
PowerShell
# Common: create the key
New-Item -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Force | Out-Null

# Options (use only one)
# This policy is disabled
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'NoConnectedUser' -PropertyType DWord -Value 0 -Force | Out-Null
# Users can't add Microsoft accounts
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'NoConnectedUser' -PropertyType DWord -Value 1 -Force | Out-Null
# Users can't add or log on with Microsoft accounts
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'NoConnectedUser' -PropertyType DWord -Value 3 -Force | Out-Null