1

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

4

2 回答 2

2

我刚刚在我的博客上发布了一个旧作业,用于从 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));
            }
        }
    }
}
于 2013-04-02T09:27:37.273 回答
0

看看下面,你会从那里得到很多关于 AX 2009 的 AD 和安全结构的帮助 http://technet.microsoft.com/en-us/library/aa497043%28v=ax.50%29。 aspx

于 2013-03-30T10:50:13.950 回答