Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Second, the usual practice is to set an "userAccountControl" to disabled before calling "dsSetObj". This is because you cannot set a password on an account until the after it is created. So after dsSetObj you should set a password on the account and then enable the account by removing the disable bit from "userAccountControl".
Third, "userAccountControl" is a bit mask so the usual method for changing it on an existing account is to first call dsGetProperty to get the current mask, add/remove the desired bits and then call dsSetProperty. This helps avoid attempting to set bit combination that the server finds unacceptable.
Finally, while using objUser.Put("userAccountControl", nValue) may appear to work, you will most likely find that that it did not change anything on the server. This is because calling the "put" method only changes the local cached copy of the object and not the actual sever object. You must call the "SetInfo" method to send changes to the server when using COM. If you do with the bits you describe, you will most likely get a COM exception because of an invalid "userAccountControl" bit mask.
Article ID: W16800
File Created: 2007:07:03:14:26:18
Last Updated: 2007:07:03:14:26:18