Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

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

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
Cisco Employee

Re: How to pass the password to the dcrcli command from a batch

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 ...

New Member

Re: How to pass the password to the dcrcli command from a batch

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.

Cisco Employee

Re: How to pass the password to the dcrcli command from a batch

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.

223
Views
0
Helpful
3
Replies