Search This Blog

Thursday, February 16, 2012

Get AX AOS Server running username and Domain

The code must be executed on the server tier.

public static krishh_getAOSUserAndDomain(Args args)
    InteropPermission   permission;
    str                 userName;
    str                 userDomain;
    permission = new InteropPermission(InteropKind::ClrInterop);
    userDomain  = System.Environment::get_UserDomainName();
    userName    = System.Environment::get_UserName();
    info(strFmt(@"%1\%2", userDomain, userName));

No comments:

Post a Comment

Thanks for visiting my blog,
I will reply for your comment within 48 hours.