Automation of Conference booking in Cisco TMS with Powershell

The plot for the assignment 🙂

We got a question if we could automate the booking of Cisco TMS Video Conference for a customer that before this script managed about 2000 booking a month by clicking i Cisco TMS portal. One of the requirement for the automation was Powershell.

The first thing was to start talking to Cisco TMS thru API and for that we used the application Postman. In the documentation for Cisco TMS you will find some XML exemples that you send thru Postman and get responses you need to create an automated booking of Video Conference with Powershell.

The first delivery of scripts contained multiple Powershell-script and lots of XML-files that the scripts imported. And beyond the XML-files and Powershell-scripts the scripts also created and deleted multiple XML-files. In the last delivery (in this post) we have modified the script-package only to contain three files, mainscript, passwordscript and config-XML.

The result for the customer…

After the script for the first two month the script generated 4000 automated bookings saving multiple hours for the Servicedesk 🙂

The script-collection.

Like a said the script-collection consist of three files. The config.XML holds all configuration for the scripts. The passwordscripts generates crypted password for the useraccount to be used in the automation and last but not least the mainscript where all good stuff happens.

Config.XML – Notes

  • TimeAdjust – You need to check that the mail going to client who requested a Video Conference has the same time set in Cisco TMS portal.
  • DaysToSave – Numbers of days you want to save your logfiles.
  • RowInFile – This one are the tricky one. When you make a booking the Cisco TMS sends back a file where the phonenumber to call. We noticed that it didn´t match Customer Cisco TMS and our Test Cisco TMS. You need to count and find the rownumber where your phonenumber exist.

New-CryptedPasswordFile.ps1 – Notes

Your should not send your password in cleartext instead you need to create a crypted file containing the password. This script is for startup first time when you start to implement the script. Note! If you move the script from one enviroment to another you need to create a new crypted file because when you create a crypted file it use the enviroment as reference.

New-CiscoTMSConference.ps1 – Notes

Here you have the main scriptfile…

The script starts with reading the config-file for info about logfile, path to temp.

Next step the username and password are imported, be sure you give the user minimum rights to communicate with Cisco TMS.

Now it´s time to send a request to the Cisco TMS to get the default values the system has for your organisation. This values will be stored in a virtual xml-file.

After reading the configfile, getting the default values you now will start to create the xml-file with everything you need to send a request for an Video meeting.

The very first time you send for the default values you will get a session id. In the script under the section when you create a xml-file for a request the session id are “0” (zero). Here is the only place in the script where you enter a value manually…the session id you get when asking for default value. This session id will you use for every request.

There is a timeout how long you can use a session id and that is 46 minutes. The script handles that by catching the errorcode when the timeout happens then the script will request for a temporary session id. Next time the scripts run it will test your default session id and request a temporary session id until your default session id is open for business again.

Next on the list to do in the script is to catch the response and extract important info like number to call, pin-code and so on.. and then create a mail with all info to send to the requester.

Done!

The script register everything in the logfile and make sure that the logfile don´t fill up the disk.

 

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.