Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to change the logonHours attribute in Active Directory over LDAP, eg. using ldapmodify. The attribute is of type byte string.

Is this possible?

share|improve this question
Are you asking if ldapmodify can modify the attribute? If you have ldapmodify, you can easily try and modify an account. – David Yu Mar 15 '12 at 16:43
up vote 3 down vote accepted

Use base64 encoding of the binary string in your LDAP change. The :: specifies that the value is base64 encoded.

So, here's the base64 encoded version of 21 bytes of 11111111, to allow login always:

logonHours:: ////////////////////////////

And here's 00000000, for never:


And, say, 9 to 5 on Monday through Friday:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.