Loading ...
Sorry, an error occurred while loading the content.
 

Enable/Disable NT User using DirectoryServices

Expand Messages
  • Walter Zydhek
    I am having problems Enabling or Disabling an NT user using System.DirectoryServices. Below is a sample of the method I am using to disable a user. Imports
    Message 1 of 1 , Nov 2, 2003
      I am having problems Enabling or Disabling an NT user using
      System.DirectoryServices.

      Below is a sample of the method I am using to disable a user.

      Imports System.DirectoryEntry
      Public Sub DisableUser(byval strUsername as string)
      Dim oADUser as DirectoryEntry
      oADUser = new DirectoryEntry("WinNT://MyServer/" & strUsername)
      oADUser.Properties("AccountDisabled")(0) = True
      oADUser.CommitChanges()
      End Sub

      I did some checking and discovered that "AccountDisabled" is not a
      property returned to the DirectoryEntry.

      Any Ideas?

      -Walt Zydhek
    Your message has been successfully submitted and would be delivered to recipients shortly.