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)

PowerShell to start a Batch

(0) ShareShare
ReportReport
Posted on by 65

Hi,

Is there a way to start a batch process using PowerShell command?

If yes, could anyone help me with the code?

Thanks.

*This post is locked for comments

I have the same question (0)
  • Mea_ Profile Picture
    60,284 on at

    Hi Prateep Ghosh,

    It's a vary strange requirement, why do you need this at all ?

  • Prateep Ghosh Profile Picture
    65 on at

    Hi Ievgen,

    The client wants to reconfigure all the existing batch jobs currently running on the Production environment to a new environment with a different user id.

    So instead of manually starting all the batch processes with the new id, we wanted to know if there is a way to start all the batch jobs from PowerShell directly?

  • Rudi Hansen Profile Picture
    4,075 on at

    No I do not see any way of doing this.

    AX Does not have any default way of managing Batch jobs from powershell.

  • Prateep Ghosh Profile Picture
    65 on at

    Hi Rudi,

    The current environment has several batches which are running using different user ids and not any one id in particular.

    The requirement is to create a single user account which will be used for running all batch jobs specifically.

    So once we have created a new id in the system and added the same to AX. We wanted to know if there is a way to start all the batch jobs from PowerShell directly?

  • Jie G Profile Picture
    on at

    Hi Prateep,

    Yes, it is possible to start a batch process in PowerShell. There is no existing command to be used to do that, you need to call the related methods in the .Net assemblies, just as you do this via C#.

  • Prateep Ghosh Profile Picture
    65 on at

    Okay.

    Thanks a lot Rudi.

  • Prateep Ghosh Profile Picture
    65 on at

    Hi Ada,

    It would be great help if you can help me understand how this is done with an example or any link.

    Thanks.

  • Verified answer
    Rudi Hansen Profile Picture
    4,075 on at

    [quote user=""Prateep"][/quote]

    Hi Rudi,

    The current environment has several batches which are running using different user ids and not any one id in particular.

    The requirement is to create a single user account which will be used for running all batch jobs specifically.

    So once we have created a new id in the system and added the same to AX. We wanted to know if there is a way to start all the batch jobs from PowerShell directly?

    In this case your problem would be that you might have a lot of different batch jobs you would need to create again.
    So I do not think this is the way to do this.

    I would instead change the value of the field EXECUTEDBY in the BATCH table, directly from SQL.

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    AX has it's own language using it you can solve this task easily. You can do this from SQL as well [View:https://community.dynamics.com/ax/b/briannormantechtips/archive/2017/04/19/modify-a-batch-job-39-s-created-by-user-after-it-is-saved]

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    I would agree to put batch jobs on Hold and update information from SQL server. once done reset back status to waiting. SID of users are not saved in batch tables.

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