cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
660
Views
0
Helpful
3
Replies

How to pass the password to the dcrcli command from a batch file or scipt?

philip.r.hayes
Level 1
Level 1

Think LMS 2.6 with all patches...

We found out that if you schedule an "Export to File" in Common Services, it uses wildcards that you may have entered into the device selector to create the scheduled job BUT it then keeps running the exact same report; even after devices have be deleted and added; thus rendering the export useless.

So, if we could use DCRCLI from a scripted "cron" job, we could rely on the report being dynamic. But, we can't store a device username and password on the server (system admins for the server can't see that password). We could store the password on another server and run the script from another server but all we need to do that is to be able to pass the password to the command line dcrcli command.

Anyone have any ideas?

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

You can use the DCRCLIFILE file to store the username password combination. For example:

admin admin

Then, set the environment variable DCRCLIFILE to point to the fully-qualified path to this file. For example:

env DCRCLIFILE=/usr/security/dcrpw dcrcli -u admin ...

Actually, no, we can't use that file. Due to security concerns. We need to know if there is another way such as I described in my post.

You could do this with an expect wrapper, or something that can spawn the command, wait for a prompt, then react. You cannot pass the password on the command line. This was actually done for security reasons so the password would not show up in the process table.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: