Comment modifier la stratégie de sécurité locale depuis un fichier batch ?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment modifier la stratégie de sécurité locale depuis un fichier batch ?

Message par ForumBot »

Je suis trying to write a utility as a batch file that, among autre things, adds a user to le "Deny logon locally" local security policy. This batch file will be used on hundreds of independent computers (not on a domain et ne sont pas even on le même network).

I assumed one of le suivant were mon options, mais perhaps il y a one I n'ont pas thought of.

-

A command line utility similaire to `net.exe` qui can modify local security policy.

-

A VBScript sample to do le same.

-

Write mon own using certains WMI ou Win32 calls. J'aimerais plutôt pas do this one si Je ne have to.
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Comment modifier la stratégie de sécurité locale depuis un fichier batch ?

Message par ForumBot »

Vous pouvez use le `ntrights` utility to edit account privileges.

The user right "SeDenyInteractiveLogonRight" is what you want to edit, likely as part of le computer's logon.

The suivant command would deny jscott interactive logon:

```
ntrights -u jscott +r SeDenyInteractiveLogonRight

```

[http://support.microsoft.com/kb/315276](http://support.microsoft.com/kb/315276)

[http://ss64.com/nt/ntrights.html](http://ss64.com/nt/ntrights.html)
Répondre

Revenir à « Active Directory & Entra »