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)

How to Enable AX User through Powershell

(0) ShareShare
ReportReport
Posted on by 310

Can some one please let me know the command how to Enable an AX User who is already disabled with in AX2012 R3 through Powershell.

i tried through AX Management shell below command 

Enable-AXUser –AXUserId Demo –Server DemoAX

but it says

Enable-AXUser : The term 'Enable-AXUser' is not recognized as the name of a cmdlet, function, script file, or operable program.

*This post is locked for comments

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

    It is because you ran PowerShell directly without loading the AX PowerShell cmdlets, so obviously the command is not visible.

    You must run the AX Management Shell once you have installed it. Refer to the documentation:

    [View:https://technet.microsoft.com/en-us/library/hh272856.aspx:750:50]

  • Vasudev Kochuveettil Profile Picture
    310 on at

    Vilmos,

    Please find the screenshot below let me know if i am doing something wrong

    2017_2D00_08_2D00_03_5F00_170752.jpg

  • Suggested answer
    Munib Profile Picture
    2,500 on at

    Hi

    Enable-AXUser isn't supported from what I know. Have a look at this list.

    https://technet.microsoft.com/en-us/library/hh706141.aspx

    If you type the first few letters of the command and click on the Tab key on the keyboard. It will rotate through available commands.

  • Vasudev Kochuveettil Profile Picture
    310 on at

    Ya that's absolutely right Munib i couldn't get the command, so only i asked in the forum, if there is a way we can enable AX User through Powershell

    or is it that we need to go via T-SQL or AX Job

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    You can enable a user using the following ax job

    static void enableUsers(Args _args)

    {

       UserInfo userInfo;

       ;

       //xyz is the user id which we want to enable.

       while select forUpdate userInfo where userInfo.id == 'xyz'

       {

           if(userInfo)

           {

               ttsBegin;

               userInfo.enable = 1;

               userInfo.update();

               ttsCommit;

           }

       }

    }

  • Vasudev Kochuveettil Profile Picture
    310 on at

    Hi Sukrut,

    yes I am doing some automation through powershell, so one of the requirements is to enable users in AX

    I am able to disable the AX users which happens in milliseconds but I need to enable users where I am stuck currently, so figuring how to do it in powershell.

    its very strange to me that there is a direct command to disable AX user through powershell but to enable we don't have a cmdlet, there should be some reason for this by Microsoft for not providing one.

    its just through AX UI you uncheck the box and user is enabled or disabled and within SQL it reflects in userinfo table as either 0 or 1 (disabled/enabled)

  • Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    If you look at the syntax of New-AXUser cmdlet there is an option to enable the newly created user.

    Parameter: [-Disabled]

    Syntax:

    New-AXUser -AccountType <String> -AXUserId <String> -UserDomain <String>

    -UserName <String> [-ClearTextPassword <String> ] [-Company <String> ]

    [-CreateInProvider] [-Disabled] [-PartitionKey <String> ] [ <CommonParameters>]

    Refer link: technet.microsoft.com/.../jj720263.aspx

    This cmdlet allows to create a new user in AX and by default, users are enabled. Probably you can make use of this(by adjusting your automation steps sequence).

    Thanks,

    Chaitanya Golla

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    You could also call AX through Business Connector via PowerShell to update the user information and get it enabled either in the table, or through the actual functionality that the AX form is using (which does additional validations in the AD).

    [View:https://blogs.msdn.microsoft.com/axinthefield/harness-the-power-of-powershell-and-the-business-connector-too/:750:50]

    My question would be why are you bothering to create/enable users from PowerShell, when AX supports using Active Directory groups, from where users could be automatically added to AX, and get specific security roles allocated?

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