ShoreTel Backup Method Revisited

Occasionally I’ll get a comment on the blog that says, “This post is three years old but it worked” which is really nice to hear. It also means that at least in the case of ShoreTel most stuff is fairly consistent between versions.

I was thinking about backing up ShoreTel servers today and looked at my old post on backing up your server and thought this would be a good time to post again about using a method I’ve found that works well, but that ShoreTel doesn’t seem to talk about.

I am going to disclaim this, as ShoreTel does not suggest it. However, if you poke through this blog, other forums, and talk to ShoreTel customers and partners you’ll find out that basically none of them set up a backup plan on standalone servers. If they do it’s ShoreTel’s included scripts, which almost always fail after a minor update, if they ever worked in the first place.

Backing Up Your Stand Alone Server With Windows Server Backup

You’ll need a NAS or other remote storage for this. These instructions are a little more ‘theory’ than the precise step by step instructions I’d rather give. They’re also geared for Server 2008 and Server 2012. It should work just fine with Server 2016 and forward as Server Backup hasn’t changed much since the 2003 days. If you are still using 2003 you’ll need an external hard drive and a floppy disk probably.

You will also need an installation media for Server 2008/2012 for this to restore correctly. You can usually download this from Microsoft. Someone with a volume license agreement or a Microsoft partner can usually get you the Installation Media (I’ve never had a problem getting one for free if it was an emergency). If you have an install disk from a major hardware vendor like Dell, this will work too as you aren’t actually using the install media to do the installation. I do not think you’ll need your Server Key, but you should be keeping a copy of that somewhere safe anyway.

Step 1 – Open server backup and select the option for a scheduled backup.

Step 2 – You will want to do a full back up to a remote share. The remote share is your NAS. Depending the on the version you may be able to do incremental backups to a remote share as well. Don’t do this. Just do a full, bare metal backup of everything every night or once a week or whatever you feel comfortable with.

Note: A word on the scheduling. You want this to be some crazy hour when nothing is going on. I’ve checked logs on a few servers with this set up. It does not take long, anywhere from ten minutes to an hour at most. Depends on the speed of the machine, NAS and network. It uses shadow copy snapshots so it basically is just copying an image of the machine when the backup copy job starts. I HAVE run these during the day and it doesn’t seem to mess anything up. I would not trust that to happen on a really busy server.

Note 2: This method just backs up the server once, and wipes out the previous backup. Because ShoreTel is constantly writing and deleting stuff, I am of the opinion that a full backup every time is better. This is really for disaster recovery not recovering a deleted extension or a voicemail someone accidentally got rid of.

Restoring the ShoreTel Server

This is pretty straight forward. You want to boot from the Server 2008/2012 installation media and select the “Restore my server” or advanced options instead of the “Install” button. You’ll find a restore from image option. You can usually browse for the image on a network location, sometimes you may need to put it on an external drive (May be a version thing).

You’ll need similar or the exact same hardware to use this. Some backup software will let you restore on dissimilar hardware but, I have no idea how well this works with ShoreTel. It’s probable you could make this work somehow with virtualization though. Newer versions of Server Backup make a VHD file so, it’s entirely likely you could boot it directly in HyperV, but that’s just speculation.

 

 

Editing Personal Call Handling Rules For Other Users in ShoreTel

This is one of those guides that requires some knowledge of relational databases and the confidence to edit your ShoreWare Director Database without screwing it up.

You’ll need some software on your ShoreTel Server to do this. I prefer HeidiSQL but you can use any MySQL GUI that you prefer. You can even install PHPMyAdmin if you want. The hardcore can just use the shell. The relevant database that you want to connect to is on port 4308, it’s called “shoreware”. The username is root, and the password is “shorewaredba”. You can find all this information with a quick Google Search, the ShoreTel forums, Reddit, and even on the ShoreTel server itself if you poke around enough so I’m not terribly concerned giving it away here.

The annoying thing about a vanilla ShoreTel server is there isn’t any way to do Nuisance Call Blocking except Personalized Call Handling Rules on each individual Communicator. There’s also no way to add new rules to a user’s Communicator in the Director. Outside of some third-party software I’ve heard of, or some extra software from ShoreTel you have to either walk a user through this process or do it on their computer yourself. That changes now.

Editing Someone Else’s Personalized Call Handling Rules On Your ShoreTel Server

Step 1 – Create the rule on your own ShoreTel Communicator. You do this in the Options Menu under “Personalized Call Handling”. Just make the exact rule you want on the other user’s Communicator. Please note I’m using ShoreTel version 14.2 as the example.

Step 2 – Remote into your server and fire up your mySQL editor and connect to the configuration database.

Step 3 – Look for the table ecrrules. Your rule will probably be the newest rule in there, but you can look at the tables ecractions and ecrnumbers to verify which rule is yours. The field “RuleID” is the foreign key that ties them all together.

Step 4 – Once you’ve determined which rule is yours, simply change the extension in the UserDN field from your extension to the user who needs the rule’s extension. HeidiSQL is nice enough to give you a list when you click on it.

Step 5 – Verify in Director under “Personal Options” of the user that the rule shows up.

Step 6 – The rule is in the new user’s Personal Options now. If not check to make sure you put the right extension in the ECRULES table.

If you want to edit the rules you can change the fields. Simple things like the phone number or destination number are easy to edit under the ecractions and ecrnumbers table. I would not change the parameters of the rule or anything like that. If you need to change what the rule does, I would delete it in Director, make a new one that does what you need and do steps 1-6 above. For instance, if you mistyped the caller ID the rule needs to check for you can change that in the database, if you want it to forward to an inside line not an outside line, I’d start over since doing that would require changing several things in multiple tables and it’s easy to get confused.

If you are not familiar with how relational databases work, stay away from this. It’s pretty simple but you can mess something up fairly easily if you aren’t careful.

 

ShoreTel Communicator Encountered Error While Attempting to Connect to Server

Had this problem on a few machines during a failed upgrade. I found the fix here at Read, Deploy, Enjoy!. Here’s the link. Basically it involves setting the permissions to the STClient Login object under DCOM Config in your Component Services to to “Everyone”.

What I ran into was slightly different. The object wasn’t even showing up on a few computers. I think this is related to how the Communicator is installed from GPO. Especially the old versions if you had to use a ‘trick’ to get the MSI files. This could also be a problem if you have some variation of Roaming Profiles.

Here’s how to remedy the problem.

Step 1 – Uninstall ShoreTel Communicator under the problem users profile, delete all registry keys associated with it, delete the folder under Program Files or Program Files (x86).

Step 2 – Log in as a Local Administrator, or a Domain Admin that doesn’t have any special home profile folders or anything.

Step 3 – Install ShoreTel Communicator from the ShoreWare Director Page on your Server.

Step 4 – Reboot and log back in as the problem user and it SHOULD work correctly. If not follow the instructions on Read, Deploy, Enjoy!

My suspicion is that an installation task fails during an automated install and causes the DCOM object not to be created properly. This probably happens near the end of the install and doesn’t always trigger a failure in the install. Newer versions of Communicator may not use this object at all, so it may be a symptom of a downgrade procedure as well.

 

 

Useful ShoreTel Communicator Registry Keys for Scripting

I recently did a favor for a friend of mine who wanted tie a couple of systems together that weren’t tightly integrated in his network with some scripts. Anyway, I found the idea in his case fairly novel so I adapted the idea to the ShoreTel phone system and logon scripts. I know a lot of companies out there where the user’s four digit extension is their PIN for various systems at least initially.

I’ve had similar requests before to write a program that extracted the user’s extension from the ShoreTel database and do something with it. I do have a method of doing that but it’s annoying and this is much easier since it comes from the user’s local machine with ShoreTel Communicator installed. I’m also including some other registry keys because this script is super easy to adapt to get this information too.

Script for Extracting Current User’s Extension from ShoreTel Communicator

This is a VB Script for extracting the user’s extension from their computer’s registry. It is intended to be used as a part of a logon script or just to run at any time. The plugin I use doesn’t like VB comments so I took them out, I’ve attached the fully commented script to the post.

Use this script at your own risk. It just reads a registry key, but any time you mess with the registry, ShoreTel or anything like that you assume responsibility for your own systems. Also if your environment is different for whatever reason, this is not a hard script to change to suit your needs.

Script File: extractExtension (rename this to extractExtension.vbs when you download it)


   Dim shoretelServer
   Dim objRegistry
   Dim extension

   shoretelServer = "shoretel"

   Set objSysInfo = CreateObject("ADSystemInfo")
   strUser = objSysInfo.UserName
   Set objUser = GetObject("LDAP://" & strUser)

   Set objRegistry = CreateObject("Wscript.shell")

extension = objRegistry.RegRead("HKEY_CURRENT_USER\Software\Shoreline Teleworks\CSIS Client\"& shoretelServer & "." & objUser.sAMAccountName & "\SUserID")

Wscript.Echo extension

Registry Keys

There are a few more registry keys that can be put to good use by enterprising script users that may want to automate a few things. Use this information entirely at your own risk. I’m not taking any responsibility for anything if you change these.

Also, some of these keys, just because you change them does not mean it actually does anything. Some of them are just flags to show the Communicator software that it has done something or not, such as uninstalled the Outlook Voicemail Plugin. Changing that key won’t uninstall the plugin if it’s messed up.

One potential use for this information is if your server crashes and you don’t have a backup. If Communicator is still installed everywhere you can recover all your user information with a simple script that goes through everyone’s machines to extract the information. If there is interest in such a thing I will write it and post it.

User Key

HKEY_CURRENT_USER\Software\Shoreline Teleworks\CSIS Client\servername.username\

This key has several values under it. The most useful are:

SUserID = Extension of User
FirstName = User’s First Name
LastName = User’s Last NameHasMailbox = Set to 1 if yes, 0 if no.
MailboxGUID = Haven’t seen this set on the versions I’ve worked with but maybe?

If you go up a level there are some values for the current server version and client version, some dynamic “ConnectedOnce” values if the client has connected to multiple servers.

Client Keys

There’s a lot here to look at. Some of this looks to be stuff it gets from the server. I fiddled with a few of these and they just reset when I loaded Communicator. Likely for features I don’t have access to.

HKEY_CURRENT_USER\Software\Shoreline Teleworks\ShoreWare Client

AutoStartSoftPhone = Starts the softphone automatically when you start the program. This is set to 0 when Extension Assignment is on primary phone, 1 when on Softphone.
Outlook Voice Mail = 1 if Outlook Voicemail Integration is Installed. 0 if no.
OwnedDNs = User Extension.
Server = Server the client is logged into. Might be a good key to read to get information for the above script.
UserName = User the Client was logged in with. Again, good information for above script.
VMFoldersExpanded = This shows some dynamic keys for various Voicemail boxes that the user has access to. Not sure what the numbers mean.

Layout Keys

Under the above key is the Layouts key with a bunch of subkeys. These seem to be related to how the client looks and behaves. I won’t go through all these. I just wanted to mention that possibly deleting or modifying these might clear up weird issues that occasionally crop up with older versions of Communicator or find lost windows when users drag them off the screen, rather than reinstalling the whole product, or deleting the entire Shoreline key.

HKEY_CURRENT_USER\Software\Shoreline Teleworks\ShoreWare Client\Layouts

Importing a WAVE File into a ShoreTel Voicemail Greeting

Sometimes you need to import a WAVE file into a user’s voicemail greeting. This might be because their connection to your ShoreTel server isn’t great, they’re on the road or any of a number of other reasons. Unfortunately there’s no tool to do this in ShoreWare Director. Or at least there isn’t in older versions, there might be in newer versions.

This is one of those handy tricks you should know if you don’t have access to their computer and they REALLY need a specific message recorded by themselves placed as a greeting. I would not suggest doing this unless you have no other choice, as they can call the voicemail system and do this over the phone, though it is VERY annoying to do it that way.

Importing a WAVE File into a ShoreTel Voicemail Greeting

NOTE:  They already need to have a greeting in place for this to work as you’ll be replacing a greeting. If they do not have a greeting, do not bother doing this.

Step 1 – Have the user send you a voicemail with the greeting. Personally I just have the user call me and let it go to voicemail. Alternatively you can use Audacity to record one. I just prefer using the voicemail system because it’s quicker.

Step 2– Export the voicemail to a WAVE file. This is done by right clicking on the voicemail in ShoreTel Communicator, or by saving the WAVE file attachment from Outlook.

Step 3 – Save the WAVE file to your ShoreTel Server somewhere.

Step 4 – Remote into your ShoreTel Server and navigate to the C:\Shoreline Data\VMS\SHORETEL\[User’s Extension] folder.

Step 5 – You’ll see a few WAVE files there hopefully. The files are like this: [Users Extension]Greet[A Call Handling Mode Number]_[A Number].Wav. The Call Handling Mode numbers work out like this:

01 – Standard
02 – In a Meeting
03 – Out of Office
04 – Extended Absence
05 – Custom

Step 6 – If you want to replace Extension 1900’s Out of Office greeting you’d need to copy the WAVE file you just exported to the following folder C:\Shoreline Data\Vms\SHORETEL\1900 and then rename 1900Greet03_01.wav to 1900Greet03_01x.wav or something. Rename the voicemail WAVE file you exported to 1900Greet03_01.wav. Note that the 01 at the end of the file name might be 02, 03, 04 or something else. This number seems to increment every time you record a new greeting through Communicator.

Step 7 – Test to make sure this worked in the proper call handling mode.

Again, if the file for the Call Handling mode Greeting you want to replace does not exist, this won’t work. I’m looking for a way to manually tell it what file to look for, but so far I’ve been unsuccessful. It’s probably in the database somewhere. If anyone knows how to do this let me know.

Also if anyone knows if ShoreTel has allowed you to import greetings in newer versions please let me know.