Disable Interactive Login

I need to create a user for my application during deployment. I want to prevent other users from logging in with this user. How to disable interactive login for this user using C #?

In other words, how to set SeDenyInteractiveLogonRight for this user?

+4
source share
2 answers

The function you are looking for is LsaAddAccountRights .

+1
source

If your account belongs to a Windows domain:

  • Create a new unit.
  • Put this service account in this organizational unit.
  • Now create a new group policy for this organizational unit, in the section "Security Settings" → "Localize Local Login", add these service accounts.
-1
source

Source: https://habr.com/ru/post/1411926/


All Articles