This is a good question as the format this data is stored in is not particularly easy to manipulate.
The actual documentation for the format is now available in the AD protocols documentation:
http://msdn.microsoft.com/en-us/library/cc245621(PROT.10).aspx
The DS programming part is easy as you are just reading and writing a byte array. The trick is creating the appropriate byte array to get the behavior you want.
Hopefully the protocol documentation is adequate for you to figure out how to structure the data. Unfortunately I've never worked anywhere that wanted to set this value, so I've never written the code to do it.