title: Setting Active Directory Properties
body: <p>I'm currnetly trying to set the four properties:</p>
  
  <p>"Password never expires"
  "Account is disabled"
  "User must change password at next logon"
  "User cannot change password"</p>
  
  <p>I can set the first two using the lines in C#:</p>
  
  <p>deUser.Properties["userAccountControl"].Value = val | 0x10000;
  deUser.Properties["userAccountControl"].Value = val | 0x2;</p>
  
  <p>though when I try to set the last two properties using the lines below they are not set.</p>
  
  <p>deUser.Properties["userAccountControl"].Value = val | 0x800000;
  deUser.Properties["userAccountControl"].Value = val | 0x0040;</p>
  
  <p>Am I setting these last two properties to the right hex value? or should I be setting something different other then "userAccountControl"?</p>
  
  <p>Thanks.</p>
  
  <p>Luke</p>