Python + XLRD SecureCRT Import

Reading Time: 8 minutes

First of all a disclaimer. I am NOT a programer. I promise this could probably be cleaned up considerably by someone that actually does programming. Also, It may require some tweaking to work on your system. This is tested on Mac 10.12.3 and SecureCRT 8.1*

I’ve always loved using SecureCRT. I often find myself needing to add anywhere from a small to a large number of sessions to my list. Especially in my current role. I had remembered in my past at an old roll where I used Windows as my primary OS (work issued) that I had discovered a forum that had a python and VBS script to import sessions out of a CSV. Now that I am running on Apple I sought out that old forum and grabbed the python script. Drats!!! The python script doesn’t work on my new version of SecureCRT for Mac (8.1). Then I started thinking. Most of the time clients give me a nice spreadsheet of IP addresses. This got me thinking, why not write my own that uses Excel. So here it is!


First off, you need to install XLRD into python. I used easy_install but pip may be an option for you as well.

Second, create a folder for the script and it’s template file used to import sessions. This is where you will place the below two files named and template.ini


This next part is simple. Create or modify a spreadsheet so the first four columns are as follows:

Sessions Name

Make sure the columns are in this order and then begin populating the data. Protocol may be (SSH2, SSH1 or Telnet). You may do nested folders as well. Here is an example screenshot.

Screen Shot 2017-03-07 at 2.31.48 PM

The next step is to open terminal and move to the folder you stored your scripts in and run this command


This will launch a dialog box asking you to select your .xlsx file.

Screen Shot 2017-03-07 at 2.35.24 PM

Once it reads your xlsx file it will indicate how many sessions it found and import them into SecureCRT into the folders you described.

Screen Shot 2017-03-07 at 2.36.35 PM

Now if we launch SecureCRT we will see the new sessions.

Screen Shot 2017-03-07 at 2.39.42 PM

Share this article:

Permanent link to this article: