Enabling an user account with ActiveDS (WinNT provider)

  • Thread starter Thread starter Eliseo Calderon \(Verizon\)
  • Start date Start date
E

Eliseo Calderon \(Verizon\)

I am resubmitting this again:

I have this code:

DirectoryEntry usr = new DirectoryEntry("WinNT://./guest");
int val = (int) usr.Properties["UserFlags"].Value;
usr.Properties["UserFlags"].Value = val & ~0x0002; <=== this fails
usr.CommitChanges();

I am trying to enable a usera account with the DirectoryServices class.

When the code executes, I get this error.

Error: Unspecified error at System.DirectoryServices.Interop.IAds.PutEx(...


Any ideas what I am missing? The user account I am using to execute this
program has Adminsitrator rights for the local machine.

Thanks
Eliseo
 
Back
Top