Pages

Tuesday, March 27, 2012

Job to export all AX 2009 security groups to files

I have been changing security a bunch lately and it's nice to have a backup of your previous settings if you make a mistake.  Here is a quick job I wrote to export your existing security settings to a folder.



static void ExportSecurityGroups(Args _args)
{
    SysSecurityUserGroup    sysSecurity = SysSecurityUserGroup::construct();
    UserGroupInfo           userGroupInfo;
    DomainInfo              domainInfo;

    #file
    Dialog                dialog  = new Dialog("@SYS14863");
    DialogField           dialogFileName;
    DialogField           dialogDomain;
    Object                formdialog;
    ;

    dialogFileName = dialog.addField(typeid(FilePath),"@SYS16423");
    dialogDomain    = dialog.addField(typeid(DomainId), "@SYS89852");
    dialog.doInit();
    formdialog = dialog.formRun();
    formdialog.filenameLookupTitle("@SYS53669");

    if (dialog.run() && WinAPI::pathExists(dialogFileName.value())  &&
        (dialogDomain.value() == ''     ||
         (select firstonly domainInfo where domainInfo.Id == dialogDomain.value()).recId != 0))
    {
        if (dialogDomain.value() == '')
            dialogDomain.value('Admin');
        
        while select userGroupInfo
        {
            sysSecurity.parmUserGroupId(userGroupInfo.id);
            sysSecurity.parmDomainId(dialogDomain.value());
            sysSecurity.load();
            sysSecurity.export(dialogFileName.value() + @'\' + dialogDomain.value() + '_' + userGroupInfo.id + '.asg');
        }
    }
    else
        warning("No action taken...");

    info("Done");
}

39 comments:

  1. Nice tool, but there is something missing: the Domain. When I tried running it, all of the groups contained empty information. Before the dialog setup (the first line of runnable code), I added:
    sysSecurity.parmDomainId([DomainId]);

    Now everything exports properly. For implementations with multiple domains, you may want to go a little bit further and add a dropdown box to select which domain to export from.

    ReplyDelete
    Replies
    1. Great comment. The environment I was working in didn't use Domains so I spaced them. I've updated the job to work with domains.

      Delete
  2. I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work. Melbourne Integriti

    ReplyDelete
  3. I got this blog site through my friends and when Home Security Companies I searched this really there were informative articles at the place.

    ReplyDelete
  4. I haven't yet met an unsuccessful job seeker who was in some way lacking in self-confidence. It is one of the reasons that I decided to in part cross the divide and become a CV Writer, because universally in most job searches the CV is a common point. Job consultancy

    ReplyDelete
  5. Most job boards do not allow for listing of emails, URL's, use of copyrighted material, defamatory remarks, false, inaccurate or misleading information, illegal or unethical content. Job postings that encourage job seekers to email for more details, are usually prohibited.How to Make cover letter

    ReplyDelete
  6. With a chronological resume, ashamed of being unemployed it requires someone to look at each job and try to ascertain or guess what skills a person has and in a competitive job market that type of extensive review may not be conducted.

    ReplyDelete
  7. Well, it’s a nice one, I have been looking for. Thanks for sharing such informative stuff.
    Continued

    ReplyDelete
  8. Thank you so much for sharing this great blog.Very inspiring and helpful too.Hope you continue to share more of your ideas.I will definitely love to read. https://paradiseeventproductions.com/surveillance-cameras-and-home-security/

    ReplyDelete
  9. I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post. vape attic olathe

    ReplyDelete
  10. I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it.. visit this page

    ReplyDelete
  11. As a seller of legal steroids, you can buy Crazy Bulk products, explore stacks and finally get the body you’ve always wanted good morning messages

    ReplyDelete
  12. I went over this web site and I think you have a lot of great information, saved to fav (:. Unique Dofollow Backlinks

    ReplyDelete
  13. Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also https://securitysingapo.livejournal.com/281.html

    ReplyDelete
  14. Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! security guard company in Singapore

    ReplyDelete
  15. All the contents you mentioned in post is too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts.Thanks security guard agency

    ReplyDelete
  16. Others need to know job area. Most job sheets guarantee that an elegantly composed job posting can accomplish a lot more qualified applications than an ineffectively composed job posting. földmunkagép szállítás Europa-Road Kft.

    ReplyDelete
  17. If you set out to make me think today; mission accomplished! I really like your writing style and how you express your ideas. Thank you. security company

    ReplyDelete
  18. I am glad you take pride in what you write. This makes you stand way out from many other writers that push poorly written content. https://medium.com/@mitia.dera/security-services-in-cambodia-464074ed3779

    ReplyDelete
  19. Great Information sharing .. I am very happy to read this article .. thanks for giving us go through info.Fantastic nice. I appreciate this post. https://penzu.com/p/3d933e4d

    ReplyDelete
  20. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. https://www.tumblr.com/blog/princesecurityservice1212

    ReplyDelete
  21. This is such a great resource that you are providing and you give it away for free. security services

    ReplyDelete
  22. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. uniform security guard

    ReplyDelete
  23. Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. get best security services

    ReplyDelete
  24. i never know the use of adobe shadow until i saw this post. thank you for this! this is very helpful. best security company in cambodia

    ReplyDelete
  25. Great post, and great website. Thanks for the information! security company sihanoukville

    ReplyDelete
  26. The content is utmost interesting! I have completely enjoyed reading your points and have come to the conclusion that you are right about many of them. You are great, and your efforts are outstanding! cambodia security company

    ReplyDelete
  27. Love to read it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. security service company in cambodia

    ReplyDelete
  28. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. https://penzu.com/p/0099f68f

    ReplyDelete
  29. Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome! best security guard sihanoukville

    ReplyDelete
  30. I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... http://783310.website2.me/

    ReplyDelete
  31. I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. https://school-security-guards-site.yolasite.com/

    ReplyDelete
  32. This comment has been removed by the author.

    ReplyDelete
  33. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. security company in cambodia

    ReplyDelete
  34. Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. https://bestsecurityguardherenow.wordpress.com/

    ReplyDelete
  35. This comment has been removed by the author.

    ReplyDelete
  36. Interesting, but not ideal. Are you going to write more? press ctrl

    ReplyDelete
  37. Some excellent secrets that can be learnt from the post. I have now come to understand that that a person can really be successful on this issue and acquire additional skills and qualities by reading a weblog like yours. Thank you for the interesting tips you’ve shared here. casinoholic

    ReplyDelete