0

i am using UnboundID LDAP SDK for ActiveDirectory management, and i want to create new user. I am able to create connection to ActiveDirectory and add new user with some attributes, but i dont know how to work with attribute userAccountControl. This attribute is used by ActiveDirectory to store some flags, and i don't know how to set these flags using UnboundID LDAP SDK. Thank for any help.

Some information about attribute userAccountControl http://msdn.microsoft.com/en-us/library/windows/desktop/ms680832(v=vs.85).aspx

user1453857
  • 207
  • 1
  • 3
  • 13

2 Answers2

1

I found out that i had some path wrong, here is code for modification userAccountControl

Modification mod = new Modification(ModificationType.REPLACE, "userAccountControl", usr.getUAC().toString());
ModifyRequest req = new ModifyRequest(userCN + userOU, mod);
LDAPResult modResult = connection.modify(req);
user1453857
  • 207
  • 1
  • 3
  • 13
0

The userAccountControl is a bit mask so it is necessary to set is as an integer.

We have some of the values and information documented here: http://ldapwiki.willeke.com/wiki/User-Account-Control%20Attribute%20Values

Might help if you said what you were trying to set in userAccountControl and provided the code you are using.

Edenshaw
  • 1,692
  • 18
  • 27
jwilleke
  • 10,467
  • 1
  • 30
  • 51