这是我的代码:
public String addPerson(String userID, String surName, String givenName,String
password,String email){
//create user state
String state = "0";
String userName;
String userPrincipalName;
userName = String.format("%s%s", surName, givenName);
userPrincipalName = String.format("%s@%s", userID, domainName);
Attribute objectClass = new BasicAttribute("objectClass");
objectClass.add("top");
objectClass.add("person");
objectClass.add("organizationalPerson");
objectClass.add("user");
Attributes attributes = new BasicAttributes();
attributes.put(objectClass);
attributes.put(new BasicAttribute("sn",surName));
attributes.put(new BasicAttribute("cn",userID));
attributes.put(new BasicAttribute("displayName",userName));
attributes.put(new BasicAttribute("givenName",givenName));
attributes.put(new BasicAttribute("mail",email));
attributes.put(new BasicAttribute("description",userName));
attributes.put(new BasicAttribute("userPassword",password));
attributes.put(new BasicAttribute("userPrincipalName", userPrincipalName));
attributes.put(new BasicAttribute("sAMAccountName", userID));
attributes.put(new BasicAttribute("msRTCSIP-InternetAccessEnabled", true));
attributes.put(new BasicAttribute("userAccountControl", 65536));
try
{
currentContextName = "CN=" + userID + "," + currentContextName;
System.out.println("addPerson-currentContextName:" + currentContextName);
currentCtx = ctx.createSubcontext(currentContextName, attributes);
}
catch (NamingException e)
{
state = "-1";
e.printStackTrace();
}
return state;
}
属性“msRTCSIP-InternetAccessEnabled
”和“userAccountControl
”无效,我该如何解决?
答案 0 :(得分:0)
对于“userAccountControl”,此属性包含标志,如this Microsoft article中所述,您需要将其与其他标志联系起来(例如:NORMAL_ACCOUNT)
“msRTCSIP-InternetAccessEnabled”来自Live Communications Server 2005或更高版本,您是否已安装此产品?看看你的架构。