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)

Unable to export the users & security roles from powershell script

(0) ShareShare
ReportReport
Posted on by

Hi All,

I'm using the below powershell script to export the users and their related security roles which I got it from the below link.

https://vgrandhi.wordpress.com/2014/04/22/ax-2012-powershell-script-to-export-users-and-roles/

But I couldn't get the users list exported.

Can any body help on this?

Regards,

Aravind Reddy.

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at

    What output did you get from the script?

  • Community Member Profile Picture
    on at

    its creating a file ExportedUsers.ps1 in the temp folder but no content in the file, its creating a 0 KB file.

  • Community Member Profile Picture
    on at

    But where as in my AX I have plenty of users are available, could you please help us in the issue whats going wrong here?

  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at

    If you run a shell script, please don't ignore messages it writes into console - both errors and information messages. Otherwise you end up where you are - with no idea what happened. In addition, you can change the level of verbosity and you can use a Powershell debugger to run the script step by step and easily observe all variables.

    If the file was created but not written into, then something failed after the line with New-Item $filePath -ItemType file -Force.

  • Community Member Profile Picture
    on at

    Hi Martin,

    Thanks for the reply.

    After using the Debugger,i got it.

    Its working as expected.

    Now, i got a different problem.

    When i try to add SYSADMIN role to a existing user through powershell commands in AX management shell, sysadmin role is not getting added to the user.

    Add-AXSecurityRoleMember -AOTName -SYSADMIN- -AxUserID aravind.

    Can you please adivse on this?

    Regards,

    Aravind

  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at

    Please share the solution with us, so other people with a similar problem will find not only your question, but an answer as well. Also please mark it as the verified answer, to make clear that the question's been answered and which replies contains the answer.

    Regarding your new topic not belonging to this thread ("Unable to export the users & security roles"), simply create a new thread with appropriate title, tags and explanation.

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