Pass the credentails to this batch command silently

Hello Bigfixers,

we are running the following command which creates a user directory under the c:\users. The only catch here is i need to pass the password at the run time which is not silent. Is there any way to achieve this:

runas /env /profile /user:domain\username cmd.exe


the output of this command is:
C:\Users\shabirahmad.magray>runas /env /profile /user:prod\hello cmd.exe
Enter the password for prod\hello:
Attempting to start cmd.exe as user "prod\hello" ...

Any way out there ?

The ‘runas’ command will not accept the password as a command line parameter, but you could use BigFix’s native ‘override’ options for the ‘wait’ command to run as the user.

Tip - Action Override User settings has several examples. For this case I’d probably choose examples 9 or 10, where the BigFix Operator is prompted for the password when they use the Take Action button from the Console.

Example 4 might also work, but would require embedding the password into the ActionScript, which is not stored securely and might be accessible to other machines that can reach your Relay/Root.

Hi @JasonWalker ,

thanks for thr reply.

`override wait`
`runas=localuser`
`user=D\TestUser1`
`password="users-password"`
`asadmin=interactive`
`wait cmd.exe /c "cd C:\temp & c:\temp\test.cmd"`

This worked for me but the only concern i am having is the D\TestUser1 must be logged on to the server. The requirement is it should run without the logged of the user on the machine.

Right, that’s why I suggested examples 9 or 10. When ‘asadmin=interactive’ is specified, there must be a logged-on user. Examples 9 & 10 omit that override option.

1 Like