Q. How can I use Microsoft Active Directory Service Interfaces (ADSI) to disable a user account?

A. Assuming that you've already defined an objUser variable in a VBScript script that points to the user you want to disable, you can disable a user account by adding the following code to your script:

objUser.AccountDisabled = True
objUser.SetInfo
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish