是否可以从AX 2009中读取AD用户?

时间:2013-03-29 12:02:24

标签: active-directory axapta dynamics-ax-2009 x++

如何从AX 2009中读取AD用户?还有什么安全问题呢?

2 个答案:

答案 0 :(得分:2)

我刚刚发布了一个旧的Job on my blog来从X ++访问AD用户,这里是代码:

static void JAEE_IterateActiveDirectoryUsers(Args _args)
{
    str                 computer = new xSession().clientComputerName();
    xAxaptaUserManager  mgr = new xAxaptaUserManager();
    xAxaptaUserDetails  usr;
    container           doms;
    int                 d, u;
    str                 dom, login, name, sid, email;
    ;

    // iterate AD domains
    doms = mgr.enumerateDomains(computer);
    for (d = 1; d <= conlen(doms); d++) 
    {
        dom = conpeek(doms, d);
        setprefix(dom);

        // iterate AD domain users
        usr = mgr.enumerateDomainUsers(dom);
        for (u = 0; u < usr.getUserCount(); u++) 
        {
            if (usr.isUserEnabled(u) && !usr.isUserExternal(u))
            {
                // get information from AD
                login = usr.getUserLogin(u);
                name = usr.getUserName(u);
                sid = usr.getUserSid(u);
                email = usr.getUserMail(u);

                // stuff happens here, you can compare AD data with AX User info

                info(strfmt("%1 - %2 - %3 - %4 - %5", dom, login, name, email, sid));
            }
        }
    }
}

答案 1 :(得分:0)

看看下面的内容,您将从那里获得有关AX 2009的AD和安全结构的大量帮助 http://technet.microsoft.com/en-us/library/aa497043%28v=ax.50%29.aspx