Disable Microsoft Login from windows and all apps

Dharmesh Patt 0 Reputation points
2024-10-18T13:15:36.45+00:00

Hello,

I am using windows machines for cyber cafe, this machine is used by multiple users.

I don't want any user to login with their personal/work or school microsoft account in windows or any of the apps like edge or office.

I have already made some changes in registry to block microsoft login as below:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

Set NoConnectedUser as 3

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount

Set DisableUserAuth as 1

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\Settings*AllowSignInOptions*

Set value as 0

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\default\Settings*AllowYourAccount*

Set value as 0

Still when I open edge for the first time it will allow microsoft account to login, same it allows microsoft login from excel, word etc.

Is there a way I can completely block microsoft account login?

I need to do this programatically using c#

Please suggest or provide me with some solution, I have already invested much of my time to resolve this.

Thanks

Windows for business | Windows Client for IT Pros | Directory services | Active Directory
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Windows for business | Windows Client for IT Pros | User experience | Other
Microsoft Security | Microsoft Entra | Other
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2024-10-22T21:33:51.8233333+00:00

    Hi @Dharmesh Patt , to completely block Microsoft account login, you can use Azure Policy guest configuration baseline for Windows. This policy setting prevents users from adding new Microsoft accounts on the computer. The recommended state for this setting is: Users can't add or log on with Microsoft accounts: https://learn.microsoft.com/en-us/azure/governance/policy/samples/guest-configuration-baseline-windows

    You can also use Group Policies to enforce these settings across all machines. This can be done by creating a Group Policy Object (GPO) that includes the necessary registry changes and applying it to all machines.

    I would also look into Local Security Policies to enforce these settings on individual machines.

    You can use these samples as a starting point for the code, if you choose to take that route: https://github.com/microsoft/Windows-universal-samples

    Please let me know if you have any questions and I can help you further.

    If this answer helps you please mark "Accept Answer" so other users can reference it.

    Thank you,

    James

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.