Enable/Disable NT User using DirectoryServices
- I am having problems Enabling or Disabling an NT user using
Below is a sample of the method I am using to disable a user.
Public Sub DisableUser(byval strUsername as string)
Dim oADUser as DirectoryEntry
oADUser = new DirectoryEntry("WinNT://MyServer/" & strUsername)
oADUser.Properties("AccountDisabled")(0) = True
I did some checking and discovered that "AccountDisabled" is not a
property returned to the DirectoryEntry.