In Ax 2012 I want to fetch all user's information like name, title,department,company name, group they belong...etc irrespective to domain who belong to the different Active Directory Groups present in ax.
*This post is locked for comments
If you want to traverse active directory, you could just do it in a C# wrapper and consume it from AX. You could also implement it in X++ if you want to since you have access to the .Net namespaces, whichever is easier for you.
There are a lot of examples:
stackoverflow.com/.../get-all-users-from-a-group-in-active-directory
stackoverflow.com/.../retrieve-all-the-users-in-an-active-directory-group-using-c-sharp
Hi Chaitanya Golla,
Actually the code which you have posted is for retrieving users belonging to AX informations, I am in need of user information with respect Active Directory Groups
Thanks,
Gopinathan
Hi,
Please use the below job to get the user details.
static void userInfo(Args _args)
{
UserInfo userInfo;
RefRecId recId;
DirPersonUser personUser;
HcmWorker worker;
DirPerson dirPerson;
Name name;
UserGroupInfo userGroupInfo;
UserGroupList userGroupList;
while select firstOnly id, name, company, networkDomain from userInfo // Fetches userId, username, user AD
join userGroupList
where userGroupList.userId == userInfo.id
join userGroupInfo
where userGroupInfo.id == UserGroupList.groupId
join personUser
where personUser.User == userInfo.id
join worker
where worker.Person == personUser.PersonParty
outer join ProfessionalTitle from dirPerson // Professional title
where dirPerson.RecId == worker.Person
{
name = HcmWorker::getDepartments(recId).Name; // Department name
info(strFmt("Id: %1, Name: %2, UserGroup: %3, Network Domain: %4, CompanyName: %5, Department: %6 Title: %7",
userInfo.id, userInfo.name, userGroupInfo.id, userInfo.networkDomain, userInfo.company,name, dirPerson.ProfessionalTitle));
}
}
Thanks,
Chaitanya Golla
Hi All,
Pls tell me the possibilities...
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,836
Most Valuable Professional
nmaenpaa
101,156