Logging in to a remote terminal sessions when you have reached the maximum number of connections.

by Joe Havelick 16. March 2009 09:50

Windows XP only allows for a single (console) instance of an interactive logon. Windows Server 2003, without terminal services licensed and enabled, will allow for an additional two remote connections. Occasionally, usually because users forget to logout from remote desktop, but occasionally because remote desktop doesn't reuse preexisting connections, you may be prompted with:

The terminal server has exceeded the maximum number of allowed connections.

In order to connect, you may logout users from existing connections.  To do so, there are a couple of command prompt commands you must know:

qwinsta /server:servername 

This will list all active connections (including via the console). You can identify who has the open connection via the username column. Find the ID of the connection you wish to terminate, and pass it into the following command:

rwinsta /server:servername ID


Tech Tips

Automatically setting compilation debug to false in production

by Joe Havelick 15. March 2009 12:24

When running an ASP.NET configuration in production, it is important to assure that a couple of things are in place.

First, you don't want to publish in debug compilation mode.  See the first reference below for a more detailed explanation, but long story short, you're wasting a lot of processor time and memory if you do.  The way to go about doing this is to set <compilation debug="false"> in the web.config.  Unfortunately, there is no simple way to automate this (although you can make it part of the build process, see second link below), and it becomes something that is easily overlooked in deployment.

Second, you want to preclude users from receiving the ASP.NET errors, which although very helpful, can contain sensitive information such as connection strings (possibly with passwords) or stack traces which can give hackers an edge on cracking your system.  You can preclude this using the <customErrors mode="RemoteOnly" ...> or <customErrors mode="True" ...> settings in the web.config, which should be done regardless of the fix below, because you will want to be presenting users witha  "friendly" error page.

As an administrator, you should deploy the following key into the machine.config file (located at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG):



          <deployment retail=”true”/>



This will override the compilation debug mode to be false for all web applications on that machine, as well as preclude the ASP.NET error pages from occurring.  Of course this means you will need to build appropriate error handling into your application, but you already did that anyway, right?







Tech Tips

Deleting Folders with Names Ending Periods

by Joe Havelick 8. February 2009 19:17

Although it is not possible to create NTFS folders ending in periods through Explorer, there are a few ways in which you may end up with such a folder on your hard drive.  If you do, you will find that folder difficult to read, update, or delete.  Windows will allow you to move it to the recycling bin, but not delete it.  You will be presented with an error indicateing that it "Could not find..." when trying to navigate via Explorer or the command prompt.

This folder is likely valid, so running checkdisk will not resolve the issue.  

Certain command line tools support a special syntax ("\\?\") which allows you to reference these folders.  In this example, I will describe how to delete a folder "C:\Folder\Misc.." which contains files and folders at a lower level.  First, we must remove those files and folders:

 del "\\?\C:\Folder\Misc.." /s

Next, I can remove the folder itself

 rmdir "\\?\C:\Folder\Misc.."



Tags: ,

Tech Tips

Mind Performance Hacks - Ron-Hale Evans

by Joe Havelick 3. January 2009 18:52

Rating: 4/5

Overall: A very enjoyable book with some real work techniques to walk away with.  A worth-while purchase for yourself, or as a gift.


  • Interesting and useful techniques and tips for thinking more effectively.  If you were ever curious about ther methodoliges behind Arthur Benjamin's Mathmagic, you'll find many of them here.  Although it would take a tremendous amount of practice and talent to do it as gracfully as him, you may be able to apply some of the techniques in more standard day-to-day scenarios effectively.
  • Broken down into individual "tips" of 3-8 pages, making it an easy book to pick up and put down based on available time, or look for a particular item of interest.


  • Ron Hale-Evans is definately a programmer.  Many of the tips have a programming slant on them, and several go as far as to include Perl scripts to demonstrate the tips.  This may be an pro to some, but I find it a bit off topic.
  • Some of the examples used in the book are a bit obscure.  I found myself wishing some items were better or more completely explained.



Batteries. It's All About Batteries.

by Joe Havelick 3. December 2008 18:03

...or in a more abstract form, energy storage devices.  The United States has a big problem.  As do some other nations, but I'm speaking to ours in particular.  We have such a terrible dependency on oil, that those who possess it are able exercise some control over our actions in order for us to obtain it.  We're even able to ignore the increasingly clear negative side affects of our use of this stuff, ala global warming, because we don't seem to have any viable alternative.  But let's not just talk about the problem, let's talk about the solution.

In our current pursuit of alternatives, we speak regularly about the collection of energy via alternative sources including solar, wind, hydro, the aggregation in solar arrays, dams, and wind farms, and the transmission.  However, we have pretty much maxed out the potential of those methods and need to focus on the current weakest link, storage.

One of the major problems with these alternative energy sources, particular those based on solar or wind, is the variability in the rate of production.  A cloud or calm sky can vary a energy production rate by up to 95% percent, unpredictably to boot.  A redundant system is not enough to assure a reliable supply of energy, so we must depend on a reliable backup supply of energy.

Additionally, current implementations of batteries within hybrid vehicles prove to be heavy,of low capacity, volatile, and even harmful to then environment.  The weight and size of these devices severely limit the performance and range of the vehicles.  The chemical composition of them make them prone to fires and explosions.  They are typically made of either lithium-ion or nickel-metal hydride type cells.  You may be familiar with lithium-ion batteries as those that had a stent of exploding and creating uncontrollable fires in laptop and cellphone batteries.  Nickel-metal hydride batteries present their own volatilities.  Both types also present a major environmental impact in terms of their production and disposal, although much less so than other types of batteries.

We must develop a more practical means for the storage of energy.  This will have major applications to both vehicle and utility industries.  Rather than spending money to "bail out" our automotive industry... rather than spend money on a war to preserve our oil interests int he middle East... rather than worry about Mr. Putin being able to proactive war games in our back-yard via the funds he has been able to marshal via oil interests in his country... we should be allocating money towards research of energy storage devices.  Once developed (and yes, this is thinking optimistically), not only will we have eliminated a major hurdle, but we will have the option to sell the products or license the technology to other nations.  That, or we can sit on the sidelines and wait for another country to develop and license it to us...

McCain had the right idea, in proposing to implement a $300 billion battery challenge. Let's hope Obama can implement something similar.



What's new in SQL 2008

by Joe Havelick 1. November 2008 21:16

The following represents a summary of major features available with Microsoft SQL Server 2008 that weren't part of Microsoft SQL Server 2005:

  • New data type, including:
    • Date, Time, and DateTimeOffset (a date time with a timezone "awareness")
    • Geographic, or spatial data type.  Used to represent points or areas on a map or the earth.
    • Hierarchical data types, used to more efficiently represent hierarchical information.
    • Filestreams, used to store large files directly on an NTFS file system, such that you can reap the benefits of storing files such as PDF, JPEG, TIFF, AVI, etc. in your databases, without the growth issues.
  • Enhanced Encryption - Advertised as transparent, it promises to allow for field to database level encryption without any application logic required.  
  • Resource Governor - Allows rule based throttling of resources to more important transactions, so that your day to day operations don't get tanked by a one time report or update.
  • Better control over query plans - Although it's possible to store and force the reuse of query plans in 2005, 2008 is supposed to make it much easier.  The Optimizer in SQL does excellent work 99.9% of the time... but it can be a bear for that last bit.
  • Auditing - Built in support for column or table based tracking of Additions, Updates and Deletions.  From what I've seem, it's simple to setup, but requires some TSQL skills to utilize.  It's appeal is that it will work without much additional overhead, or the need to implement new tables and triggers.
  • Better LINQ support - This is inline with Microsoft's overall strategy of enabling developers to more close build standard object models for datasources, regardless of the actual provider.  Expect Visual Studio 2009 to capitalize on this further. 
  • Elimination of Notification Services - The functionality that was built into SQL appears to still be available via Reporting Services, however, using Notification Services as a framework for delivering notifications from standard queries appears to be unavailable.
  • Policy Based Management - I'm really not to hot about this myself, but it allows you to apply policies to databases and periodically run "health checks" of those policies against your databases.  What I'm not clear on is why you would ever need to check the health of your database.  I f apolicy has been applied to prevent something from occurring, why would it ever be allowed, and thereby put it in an unhealthy state.  I remain curious.

For additional information, please check the following sites:





About Me

Joe Havelick is a reasonable facsimile of this photo.

profile for Joe on Stack Exchange, a network of free, community-driven Q&A sites