VMware Cloud Community
fredoenglish
Contributor
Contributor
Jump to solution

Execute file on VCO using specific credentials

Hello,

I am executing a batch on the VCO Server using the following code :
     com = new Command("test/Run.cmd");
     com.execute(true);
This works fine => I've followed the admin guide in order to allow access to Command Class.
My problem is that I would like this batch to be executed using specific credentials. I can see that the local user SYSTEM executes the command.
I've tried to :
     - start workflow as ..
     - change credential during workflow
     - run the "VMware vCenter Orchestrator Server" windows service using the specified account (Log On As).
I would like to use the Credential API but I don't really know how to deal with it (runas for example).
Any idea would be very helpful... ?
In advance, thank you very much
Fred
0 Kudos
1 Solution

Accepted Solutions
tschoergez
Leadership
Leadership
Jump to solution

Hi Fred!

AFAIK it's not possible to change the credentials for local command :-(.

For me, it worked to run vCO-Service as another user (make sure to change it for vCO, not for the vCO Configuration Service 😉 )

Some reference:

http://communities.vmware.com/thread/292083

http://communities.vmware.com/thread/271425?start=0&tstart=0 (later in the thread)

http://communities.vmware.com/thread/280865?tstart=60

Maybe you can change the user somehow inside your external batch-file?

Regards,

Joerg

View solution in original post

0 Kudos
2 Replies
tschoergez
Leadership
Leadership
Jump to solution

Hi Fred!

AFAIK it's not possible to change the credentials for local command :-(.

For me, it worked to run vCO-Service as another user (make sure to change it for vCO, not for the vCO Configuration Service 😉 )

Some reference:

http://communities.vmware.com/thread/292083

http://communities.vmware.com/thread/271425?start=0&tstart=0 (later in the thread)

http://communities.vmware.com/thread/280865?tstart=60

Maybe you can change the user somehow inside your external batch-file?

Regards,

Joerg

0 Kudos
fredoenglish
Contributor
Contributor
Jump to solution

Thank you, you were right Joerg, It's working if you change service account.

Firstly, I've tried with a batch file and script %username%, in the log I saw SYSTEM. After your post, I've tried with a VBScript and I could see it was launched by my service account.

Regards,

Fred

0 Kudos