Dragon: Gracefully Closing Network Edition

Dragon Network Edition–Nuance’s ubiquitous dictation software–is powerful, to be sure. But, like any powerful tool in IT, it’s full of quirks and secrets, and a few of them can ruin your day if you’re not careful.

Dragon comes with the ability to maintain user profiles on the network, and this has some inherent advantages. For example, a user’s dictionary modifications and personal preferences will follow them from machine to machine. That’s essential for a person who touches multiple computers every day. Unfortunately though, Dragon does not do the best job of handling this workflow natively. By which I mean, if a doctor logs into Dragon on Computer A, fails to log out, and then attempts to log in again on Computer B… some weird stuff can happen. Profiles can become inaccessible, or even corrupted.


The first step to this workflow is to ensure a session, left alone, is closed. So, using your tool of choice, you simply establish an idle lockdown and kill the process, right? But of course, there’s a catch–and if you’re using Imprivata on a kiosk, you may have already seen the consequences.

If you simply kill the Network Edition process, you’re gonna have a bad time. When a user logs in, Dragon fully expects them to log out. Should the process close with a user logged in, the cached profile on the local machine can become corrupted and unusable. I’ve even seen it prevent new users from logging in afterwards. The next step, therefore, is to ensure a user gracefully logs out before the process is killed. You have the option of automating the keystrokes to log out the user from the menu, but Dragon will thwart you yet again.

If a user makes a change to their profile and logs out, Dragon will throw a window asking whether they want to save their changes. This window prevents all other interaction with the process, and it does not appear if no profile changes are made. However, if you do not account for it, any person with access to the PC can simply cancel the dialog and have full access to the last user’s Dragon session. But of course, you can’t predict when or if this window will even appear, so what can you do?

The Resolution:

Every installation of Dragon Network Edition includes a file called Interop.DNSSDK.dll. This library allows us to interact directly with the process, circumventing the need for blind keystroke automation. Among the functions available are the ability to save changes to a profile and log a user out.


The original design for this script is not my own. However, the version linked here applies to Version 10 of Network Edition, and it will not work for versions 12 and later (I am unsure about 11). What follows is my modification for these newer versions.

Step 1:

You will need to save the following PowerShell script as a .ps1 file. It can safely be run either locally or from a network share. In either case: be aware that this script automatically saves any changes a user makes to their profile. Unfortunately, the only method of preventing the dialog described above (which asks if the user would like to save changes) is to save those changes proactively:

# Change the path below:
add-type -Path “C:\Program Files (x86)\Nuance\NaturallySpeakingXX\Program\Interop.DNSSDK.dll”

$dragon = new-object Interop.DNSSDK.DgnEngineControlClass
$dragon.SpeakerSave() # Save profile proactively.
$dragon.SpeakerClose() # Log user out.

# Retrieve (then close) all Dragon processes:
$natspeakList = get-process natspeak

ForEach ($process in $natspeakList) {
$process | stop-process

Be sure to modify this script to reflect the actual path to the DLL on your machines. This will vary slightly by version, and will never actually be XX as above.

Step 2:

After that, configure that .ps1 file to run when the computer is locked. You will definitely want to configure a means to lock the machine after some idle time if you haven’t already–but that’s basic security, regardless.

As an aside: if you are using an Imprivata extension object, you may want to add a trigger for Desktop Unlocked. This ensures users “tapping over” each other do not see the previous user’s session.

As a final note, if you get an RPC error when you try to run this script, grab the IID from the error message. Then modify the following value to reflect that same string:


Step 3 then becomes making that same registry change on any other machines that will use this script. Otherwise, you’re all set!

Top of Page
Go Back

Leave a Reply

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