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

Re: Enabling an user account with ActiveDS (WinNT provider) by Willy

Willy
Fri Oct 24 17:43:02 CDT 2003

Should work, looks like a bug in v1.1.

Willy.

"Eliseo Calderon (Verizon)" <eliseo.calderon@[nospam]verizon.net> wrote in message news:%23uNEBTnmDHA.688@TK2MSFTNGP10.phx.gbl...
> 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
>
>