04-05-2017 12:56 AM
Hi,
I want to make a short script to delete multiple usernames from a 1921 router.
The problem is that when you put the command I get the below message:
" no username Sally privilege 15 secret 5 $1$kf4z$8o3bB56rLRXMnvmHTYiEP.
This operation will remove all username related configurations with same name.Do you want to continue? [confirm] "
Each time I have to hit the Enter key to delete the user, it;s frustrating.
Is there a special character I can include in the notepad script to substitute this "enter key" ?
I have 5 users one after the other that I need to delete on many routers.
Many thanks,
Andrei
04-05-2017 02:20 AM
Those are known as Interactive commands. There is a special syntax for them, documented here:
http://www.cisco.com/c/en/us/td/docs/net_mgmt/prime/infrastructure/3-1/user/guide/pi_ug/config-temp.html#26075
I don't have a PI server in front of me to verify, but you should be able to use something like:
#INTERACTIVE
no username sally<IQ>This operation will remove all username related configurations with same name.Do you want to continue? [confirm]<R>y
#ENDS_INTERACTIVE
01-25-2018 08:49 AM
Old post, but in case anyone else comes across this problem in v3.1, here is the correct syntax:
#INTERACTIVE
no username sally<IQ>[confirm]<R>y
#ENDS_INTERACTIVE
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide