web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to update Active Directory user attributes from Dynamics AX 2012 R2 HRM tables

(0) ShareShare
ReportReport
Posted on by

Hi,

We have to implement an automatic workflow process in Dynamics AX 2012 R2 HRM such in a way that for example:

1. when a worker is retired in HRM then the user account is automatically disabled/removed in the Active Directory

2. when a worker is promoted or moved to another department, the position title or the new department is automatically updated in the corresponding user attributes in AD

I have been looking into the identity manager to connect SQL with AD but seems to me that it is not the right approach.

Any ideas,

Thanks,

Carlos Gabriel Lopez

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    There is a solution called Adaxes that we are using and it seems to do exactly what you are asking for. So it can automatically trigger to remove users from AD and trigger in once user is updated to modify everything in AD according to predefined rules http://www.adaxes.com/active-directory_provisioning.htm

    I'm pretty sure you can integrate something like this into your environment.

  • Brandon Wiese Profile Picture
    17,788 on at

    I once did a customization that integrated contacts within AX as contact objects within AD, so that they would be available to Outlook using the LDAP provider.  What you want to do is very close to that.  If you're interested in doing your own customization, I could provide some sample code that would show you how to do individual tasks in AD.  My approach was "inline" meaning that in the insert() and update() statements on the ContactPerson table, but a "batch" approach that runs once a day or whatever would work also.

  • Suggested answer
    nunomaia Profile Picture
    25 Moderator on at


    Hi,

    You can query / edit objects using .NET, for example in C# to disable a user in AD, you could use

    PrincipalContext principalContext = new PrincipalContext(ContextType.Domain);
    UserPrincipal userPrincipal = UserPrincipal.FindByIdentity(principalContext, "username");
    userPrincipal.Enabled = false;
    userPrincipal.Save();

    You can add an event in employee data to synchronize settings.

    Please, take into consideration that this can be risky, because you need to elevate securities settings of the AOS services account to write into AD.  

  • Community Member Profile Picture
    on at

    Simply disabling users in AD is generally not recommended. Especially if it's done automatically and no supervision or approval is implemented for that. If there are other systems and accounts associated with the user in AD, access could be retained even after employee leaves. And we all know what a disaster this can cause.

  • Community Member Profile Picture
    on at

    Thank you. Your recommended solution looks very comprehensive for AD automation. I will see if through its task scheduler and scripting engine it could for instance read the worker status (past worker) and changes directly from HRM SQL tables. Other way I think of might be triggering SQL record downloads into CSV files that could be read from this tool. Also agree with you that fully automated 'behind'the scenes' solutions could be risky.

  • Community Member Profile Picture
    on at

    Thank you Brandon, your sample code will be very useful to me.

  • Community Member Profile Picture
    on at

    Thank you Nuno, actually I thought of implementing something like that but prefer a more secure option.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans