Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Run a task from command line
Topic Summary:
Created On: 06/11/2015 12:05 PM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Leonard Amabile, on Friday, June 12, 2015 6:29 AM

Answer:
Hi Ray,

AMTask and AMTaskCm are intended for AutoMate. The BPA Server equivalent is BPATask and BPATaskCm. In order to run these executables, the task (.aml) needs to reside on the hard drive and not in the database.

 06/11/2015 12:05 PM
User is offline View Users Profile Print this message

Author Icon
RayDonovan
n00b (>6 posts)

Posts: 1
Joined: 06/11/2015

Hello,

We are trying to create a task that simply perform some actions based on a parameter provided each time the task runs.


We want to run this task using command line, we're using AMExecute.exe which runs the task fine however it seems that it does not accept custom parameters.

Some googling suggets to use AMTask or AMTaskCm. however these binaries do not exists on the server.

 

How can I run a task from outside AutoMate and provide a parameter?

Thanks



 Category Survey
 06/11/2015 01:07 PM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

Answer Answer
Hi Ray,

AMTask and AMTaskCm are intended for AutoMate. The BPA Server equivalent is BPATask and BPATaskCm. In order to run these executables, the task (.aml) needs to reside on the hard drive and not in the database.



 Category Survey
AutoMate BPA Server 9 version:
Windows version:


-------------------------

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
 08/10/2016 06:40 AM
User is offline View Users Profile Print this message

Author Icon
BruceAldridge
Apprentice (20-49)

Posts: 39
Joined: 11/12/2015

When I run my batch job with my user and password.  amexecute works.

when I run with a service account my batch job just hangs.  I don't get an error or time out.

 

I am calling a shell command from vb.net. This application is used by a group so just having my user id will not work.

Batch file:

set cmd="C:\Program Files\AutoMate BPA Server 10\AMExecute"

%cmd% server=trgdatacap2 user=%1 pwd="%2" workflowid="%3" 



 Category Survey
AutoMate BPA Server 9 version: 9.0.5
Windows version: Windows 7
 08/10/2016 09:58 AM
User is offline View Users Profile Print this message

Author Icon
Alex Escalante
HelpSystems

Posts: 871
Joined: 02/26/2014

Hello Bruce,

You mentioned that you are running with a service account. Where do you set this account?

If you run this in task builder, will it work successfully? Or do you get the same result?

 Category Survey


-------------------------

Alex Escalante | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
 08/10/2016 12:01 PM
User is offline View Users Profile Print this message

Author Icon
BruceAldridge
Apprentice (20-49)

Posts: 39
Joined: 11/12/2015

The workflow runs on a schedule which has been working well.  But there are times when I want to run immediately and not wait for it's next scheduled run.  

The workflow is using the service account for scheduled runs.

I tried using the same user to run from command line but without success.

 

 



 Category Survey
AutoMate BPA Server 9 version: 9.0.5
Windows version: Windows 7
 08/11/2016 02:33 PM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hi Bruce,

Please provide the method you are using to call the execute the task.

 Category Survey


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
 08/16/2016 06:21 AM
User is offline View Users Profile Print this message

Author Icon
BruceAldridge
Apprentice (20-49)

Posts: 39
Joined: 11/12/2015

I run a batch from a dos command line:

myexec "xyz" 

 

 

 

 

 

 

 



 Category Survey
AutoMate BPA Server 9 version: 9.0.5
Windows version: Windows 7



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
 08/18/2016 07:12 AM
User is offline View Users Profile Print this message

Author Icon
Alex Escalante
HelpSystems

Posts: 871
Joined: 02/26/2014

Hello Bruce,

Under the task properties, under logon, do you have "run with highest privileges selected"?

If you do not, please turn it on. If it is on, please turn it off.

If you run the task manually from task builder, does it work successfully?

 Category Survey


-------------------------

Alex Escalante | Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700 | F: +1.213.738.7665
 08/18/2016 02:12 PM
User is offline View Users Profile Print this message

Author Icon
BruceAldridge
Apprentice (20-49)

Posts: 39
Joined: 11/12/2015

I am not running this within automate.  I am running it from a shell on my desktop.  



 Category Survey
AutoMate BPA Server 9 version: 9.0.5
Windows version: Windows 7
 08/19/2016 01:22 PM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

Bruce,

You mentioned that it worked when running the command line from your user account but fails when running from a service account, correct? What is the error message you are receiving when running the batch file from the service account? Have you tried running amexecute on its own with the service account to see if it's even able to execute it? This seems more like an accessibility issue but we won't know until we get what errors are being returned.

 Category Survey
AutoMate BPA Server 9 version:
Windows version:


-------------------------

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
 08/19/2016 01:29 PM
User is offline View Users Profile Print this message

Author Icon
BruceAldridge
Apprentice (20-49)

Posts: 39
Joined: 11/12/2015

There are not errors.  execution starts but never finishes.  I've tried letting it run for hours.  there isn't even a time out errors..

 



 Category Survey
AutoMate BPA Server 9 version: 9.0.5
Windows version: Windows 7
 08/22/2016 08:27 AM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

Hi Bruce,

Is the service account a BPA user? The defined user and password in the amexecute command line needs to be a user that autenticates against BPA Server.



 Category Survey
AutoMate BPA Server 9 version:
Windows version:


-------------------------

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
 08/30/2016 01:20 PM
User is offline View Users Profile Print this message

Author Icon
BruceAldridge
Apprentice (20-49)

Posts: 39
Joined: 11/12/2015

I found the problem with my service account. An equal sign in my password was causing problems.  I created a password without special characters and it ran fine.

 

thanks for your help.

 



 Category Survey
AutoMate BPA Server 9 version: 9.0.5
Windows version: Windows 7



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


Edited: 08/30/2016 at 01:33 PM by BruceAldridge
 08/30/2016 01:21 PM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hi Bruce,

We appreciate the update.

 Category Survey


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 2369 guests browsing this forum, which makes a total of 2369 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog