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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Easiest way for Security Role duplication

(1) ShareShare
ReportReport
Posted on by 49,677 Super User 2026 Season 1

I was just wondering if there could be an easy way to duplicate security role, prior to I start writing script/code myself.

Any suggestion if someone has duplicated security roles with least effort. By saying least effort, I am interested to avoid manual duplication by right clicking each object (role, duty and privilege)

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    In \AOT\Security\Roles\YourSecurityRole > Right click > Duplicate is the least effort.

    You can shift+click or control+click to highlight multiple roles and duplicate them at once.

  • Suggested answer
    guk1964 Profile Picture
    10,888 on at

    This tool for moving roles between layers may help might help , because one of its tasks is  to copy a role.

    stoneridgesoftware.com/moving-security-role-objects-in-dynamics-ax-from-one-layer-to-another

  • Suggested answer
    Jonathan  Halland Profile Picture
    11,310 on at

    Hi Sohaib

    Please email/message me and I can provide you with a script to do a full deep copy of a role. I.E. Copying all the sub roles, privileges, duties etc...

  • Long.Thai Profile Picture
    130 on at

    Hi Sohaib,

    Try using this:

    static void DuplicateSecurityRole(Args _args)
    {
        #AOT
        
        TreeNode            treeNode;
        treeNode            duplicateNode;
        
        
        treeNode = TreeNode::findNode(#SecRolesPath);
        
        duplicateNode = treeNode.AOTfindChild('SecurityRole');
        
        if (duplicateNode)
        {
            duplicateNode.AOTDuplicate();
            duplicateNode = treeNode.AOTfindChild(strFmt('CopyOf%1', 'SecurityRole'));
            duplicateNode.AOTsetProperty('Name', 'NewName');
            duplicateNode.AOTsave();   
        }
    }


  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    Thank you everyone for positive contributions.

    @Jonathan

    Thank you for providing the xpo, it helped me a lot by saving my time and that was exactly what I was thinking to code. I would appreciate if you would like to make a public post about that may be posting code partially or fully (as long as you don’t have any customer agreement for distribution of that particular code). It will help all the community. Always your contributions have been helpful for others.

    Have a good weekend!

  • Suggested answer
    guk1964 Profile Picture
    10,888 on at

    One other useful (free) resource I had forgotten

    www.axpulse.com/.../user-rights-copy

  • Sohaib Cheema Profile Picture
    49,677 Super User 2026 Season 1 on at

    Hi magic1949,

    there is difference between following two  

    1) copy security(role) from one user to other

    2) copy actual role itself with all its content

    I was looking for #2

    to do #1, we can use standard ax where we ca assign same roles or duties or privileges to other users

  • Gamal Hammad Profile Picture
    on at

    Hello Jonathan,

    I am interested in your script, would you please email me your XPO file.

    Thanks

    Gamal Hammad

    email: gamal@ezz-elarab.com

  • Shahzad Sarang VZS Profile Picture
    45 on at

    Hello Jonathan,

    I am stuck in performing security role duplication, would you please help me with your XPO file.

    Thanks

    Muhammad Shahzad Sarang

    email: shahzad.sarang@vizorsol.com

  • Community Member Profile Picture
    on at

    Hi Jonathan,

    I need the script too, would you please email me the XPO file.

    Thanks

    Babar Moin

    email: babarmoin@gmail.com

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans