In my C# client I am getting the directory entry of the user in the following way :
DirectoryEntry userDE = new DirectoryEntry("WinNT://machinename/User12", "MachineName\\Administrator", "Password");
I want to add a userflag to this user.
I tried the following :
userDE.Properties["UserFlags"].Add(65536);
But the issue is that it is updating the user with new user flag instead of adding it to the userflag.(for example the user already had the flag 'User cannot change Password' and i tried adding 'Password never Expires'.But after the operation the user only had the flag 'Password Never Expires')