Skip to main content
Post a question

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id : ttGFLaRm5cMAqfUgfAelEf
Microsoft Dynamics AX (Archived)

Sync users and user roles between AD and DAX 2012

Like (0) ShareShare
ReportReport
Posted on 8 Dec 2014 09:13:44 by 135

Hi AX people,

I have a requirement, in nutshell -

1.  user or user role will be dynamically updated in Active Directory

2. A script need to executed in scheduled interval, which will extract all the user and user roles and update/delete from DAX

Now for DAX2012 powershell only allows to add user /user roles but its very disappointing that there is no provision to remove user /user role, of course disable user won't help me to complete the automation.

Have anyone tried this? Can i write a c# code to achieve this, I don't want to touch the AX code just to make the automation reusable.

*This post is locked for comments

  • Jonathan  Halland Profile Picture
    11,306 on 09 Dec 2014 at 05:55:01
    RE: Sync users and user roles between AD and DAX 2012

    Hi Anup.

    I dont think we understand your requirement properly. What you are describing is what the AD usergroup functionality in AX is designed to do. I'm not sure why you are wanting an external interface to define these mappings. Can you maybe explain why the built in functionality is not sufficient for you?

  • Anup@DAX Profile Picture
    135 on 09 Dec 2014 at 04:22:03
    RE: Sync users and user roles between AD and DAX 2012

    Sure we can do that even, but keeping the automation approach we still want to add/delete the usergroup/roles on the fly. So we have external interface where we define the user group to role mapping, we need to have a flow which can create the user group and assign the roles to it. Similarly if any role is deleted that should be synced too.  we do have Add-AXSecurityRoleMember to add the role but i guess we are missing something like Remove-*

  • Suggested answer
    Community Member Profile Picture
    on 08 Dec 2014 at 18:16:48
    RE: Sync users and user roles between AD and DAX 2012

    This is possible out of box in AX 2012. There is no need to custom code unless you have any special requirement.

    You would have to create user of type 'AD group ' in AX.

    For example: You can create a AD group for 'AP Clerk' and use the same alias in AX when create new user of type 'AD group' and assign 'AP Clerk' role. Now when a new user is added to 'AD group', the user is automatically created and granted 'AP clerk' rights.

    There is a standard batch job 'Automatic role assignment' which synchronizes the AX user with AD.

    Please note even in this case, you would have to manually perform additional steps like 'User relations', 'EP roles', etc.

  • Suggested answer
    Jonathan  Halland Profile Picture
    11,306 on 08 Dec 2014 at 09:49:07
    RE: Sync users and user roles between AD and DAX 2012

    Hi.

    Is there any reason you do not want to use the built-in AD group functionality in Dynamics AX2012. If setup correctly users roles and enablement in AX will be automatically managed based on the AD groups that they belong to.

    dynamics-ax.blogspot.com/.../ax-2012-using-active-directory-groups.html

  • Martin Dráb Profile Picture
    232,011 Most Valuable Professional on 08 Dec 2014 at 09:24:51
    RE: Sync users and user roles between AD and DAX 2012

    And what you want to do with all fields referring to users to be deleted (included fields like CreatedBy)? Is it acceptable to let them point to non-existing users?

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,011 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading started
Loading complete