0

这是我的代码:

    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”不起作用,我该如何解决?

4

1 回答 1

0

对于“userAccountControl”,此属性包含标志,如Microsoft 文章中所述,您需要将其与其他标志结合使用(例如:NORMAL_ACCOUNT)

"msRTCSIP-InternetAccessEnabled" 来自 Live Communications Server 2005 或更高版本,您安装了这个产品吗?看看你的架构。

于 2013-01-15T04:51:28.270 回答