Learn More Download Free Trial Pricing & Buy

Archive for May, 2008


Remote disconnect a Terminal Services Session

Windows 2003 and 2000 server allows for the administration mode only two (OK three with /console or /admin will be explained later in text) concurrent connections to terminal services.
Do you usually have a problem when somebody from your firm leaves a disconnected session and when you try to connect to terminal server you get “You exceeded the allowed connection count” message?

We will use tsadmin.exe tool to connect to remote terminal services. You can either copy this from one of the other terminal servers  to you machine, or access hidden c$ drive on your terminal server.
Then go to Windows root/system32 and find tsadmin.exe
Running program will detect only your local XP sessions.
Now you have to connect to the server where you want to reset the session that is not in use.
Choose all listed servers and then connect to a server. It might ask for a password, type the username and password you use when you normally authenticate on your terminal server.
Now you will see the following screen:
TSAdmin
Note that there are two users on the server, both are disconnected,and because of that you are unable to access your server.
Klick them both, choose username and then reset.
This way you will be able to log on to your terminal server via RDP client.

Second way is to use /console (in Windows 2008 and Vista /admin) switch when connecting to your terminal server.
This way you will be able to connect to your terminal server directly to console. This is important because /console switch will not use terminal CAL, it will connect directly to console. This way on server in remote administration mode you can connect total three concurrent users. All you need to do is to type in your client console “mstsc.exe /console” and type username and password for connecting to console session. Please note that only administrators are allowed connecting to console session. When connected reset disconnected sessions. You will be now able to logon to your terminal server.


HOWTO taskbar clock enabling through the registry

You have setup a new server, created users, deployed the application on the users desktop but the users complain they cannot see the clock in the task bar. You can log on every user’s desktop and enable the clock by yourself. You can write HOWTO and leave it on the user desktops so users can by themselves enable the clock or you can make a little registry change that will enable the clock. I would choose the last solution.

Go to the HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2 and note key Settings

When the clock is disabled, the Settings value looks like this:
28 00 00 00 FF FF FF FF 0A 00 00 00 03 00 00 00 3F 00 00 00 1E 00 00 00 FE FF Ff FF E4 03 00 00 02 05 00 00 02 04 00 00
When the clock is enabled, the Settings value looks like this:
28 00 00 00 FF FF FF FF 02 00 00 00 03 00 00 00 3F 00 00 00 1E 00 00 00 FE FF FF FF E4 03 00 00 02 05 00 00 02 04 00 00

The ninth pair of hexadecimal values is what we need to edit. The 0A turns into a 02.
Restart server or kill explorer exe.
For multiple users export new reg key, and apply this to logon script for all your users. Use regedit.exe /q to quietly import new reg data.


Send mail from Excel without opening Outlook

I tried to send a workbook from Excel as an attachment through Outlook today.
It works if Outlook is open, but if Outlook is not open it won’t work. So if you send a workbook from Excel, as few people like me today have, and Outlook is not open all workbooks will be in the outbox folder in Outlook until you open Outlook and then all mails will be sent.
I have investigated a bit on the internet because there are users who don’t know that Outlook first needs to be open so that mail can be sent.
Unfortunately, I haven’t found the right solution, all solution are based on VBA and CDO uses. This works for me but how I can deploy all that on the terminal server?
If I come up with some solution that is easy to deploy to all users on terminal services I will share it with you.


Drawing charts on per user activity times

As we are in the process of developing a new Terminal Services Log, we have a problem how to draw charts that will represent user active idle and disconnect time summaries.
Beta user interface is available in the following picture:
TSL beta analytics
As you can see on the screen, there are 5 users available for reports.
Active time is in green color, yellow is idle and disconnected time is red. Below is detailed data of any user, when he was first logged on, last logout, activity times, and how many times the user connected to the terminal server.
If you have any propositions feel free to leave a comment or write us an e- mail. We will be glad to take into consideration opinions from users that will be using software.


Outlook cached mode use on terminal services

Microsoft disabled the use of Outlook in cached mode when connected to Exchange server on terminal services. I don’t see any reason why this is disabled by default. Microsoft should leave this option enabled like on workstation and when it is installed on terminal services when enabling this option, the application should warn you about this feature with using it on terminal services.
According to others, there are 4 valid reasons for disabling this feature.
Here are the reasons why I think it’s disabled:

1. Cached mode downloads a local OST (offline storage file) copy of the user's mailbox. This file cannot roam around so it is useless in farm installation.
2. On single server synchronizing the OST for one user can tax the machine. Imagine 20+ users doing sync at the same time.
3. Since the OST is a copy of the mailbox, would you really want to use up the TS local disk storing copies of each user's mailbox.

I think these are very poor reasons to disable this option.
I had implemented few single terminal services in the past. Terminal services included also Exchange installation. There is a single server and single exchange, I want to cache mails to a local disk, I have a powerful server and high bandwidth (1Gbit). In one server scenario Microsoft should leave it up to Administrators to choose to enable this option because it is very useful and for sure it speeds up Outlook.
Hope in future they will change their politics.


Force user Logoff @ midnight

You have to backup valuable data every nigh but some of your users stay logged on to the terminal server so if your file is open it will not be backed up. I have a problem with that.

I have found a great set of command programs for sending message to anyone whose terminal server will disconnect a session in x minutes, and a program that will actually log off  a session. Google  for tsmsg.exe and tsloggoff.exe

Here is the script so that the scheduled task will run exactly at midnight every day. It looks like this:
tsmsg * /Server:localhost" your account will be logged of in 5 minutes
sleep 300
TSLogoff usernamex /server:localhost

This little piece of code will send a message to all users on the server informing them that the server will log off their session in 5 minutes (this is in case someone is working at  night), then wait 300 seconds and log off users. There is also a switch to log off all users on the system but I have experienced that this does not work, it works just if I enter correctly the username. After that your backup program can perform the backup without any users that could be a distraction .


Remote desktop max 2 concurrent users vs terminal server role grace period

When you install Windows Server 200x, by default, it operates in remote administration mode where you get maximum of 2 active concurrent remote desktop sessions. To get more concurrent sessions, you will have to install the Terminal Server Role. Terminal Server will work because it is in a grace period. For the first 120 days after installation with Windows Server 2003, or 90 days after installation with Windows 2000, any unlicensed client can connect while the terminal server waits for you to install a licensing server. After the end of the grace period, if no licensing server is found, the terminal server will stop accepting unlicensed connections.