Terminal Services - Frequently Asked Windows Terminal Services Questions!

[12] Frequently Asked Asp Questions!
Updated: Jun 07, 2000
[188] Frequently Asked Citrix Questions!
Updated: Oct 10, 2006
[3] Frequently Asked Sco Tarentella Questions!
Updated: Aug 16, 2002
[260] Frequently Asked Windows Terminal Services Questions!
Updated: Aug 03, 2006
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 [25] 26
I just installed IE4 or 5 and it replaced my Schedule Service with the Task Scheduler and now my scheduled files that contain soon.exe will not work. How do I fix this? 
You can change the schedule service back to using the AT command by performing the following... from: http://support.microsoft.com/support/kb/articles/Q196/7/31.ASP

Application That Requires Schedule Service Fails

The information in this article applies to:
  • Microsoft Windows NT Server version 4.0
  • Microsoft Windows NT Workstation version 4.0
IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information on how to do this, view the "Restoring the Registry" online Help topic in Regedit.exe or the "Restoring a Registry Key" online Help topic in Regedt32.exe.

SYMPTOMS

Programs that require the use of the Schedule service (Atsvc.exe) provided with Windows NT may fail when you run them on a Windows NT system for which you have also installed Task Scheduler (a Microsoft Internet Explorer 4.0 optional component). You will see inconsistent results when attempting to start a program using the AT commands. An example of such a program is Soon.exe from the Windows NT Resource Kit.


CAUSE

When you install Task Scheduler on Windows NT, it replaces the Schedule service. The Schedule service no longer shows up in the Services utility in Control Panel.


RESOLUTION

To resolve this problem, do one of the following:

  • Use a different program that is compatible with the Internet Explorer 4.0 Task Scheduler.

    -or-

  • Remove Task Scheduler by using the Add/Remove Programs tool in Control Panel by selecting "Task Scheduler v1.0 (remove only)" from the Install/Uninstall tab and clicking Add/Remove.


MORE INFORMATION

If the Microsoft Task Scheduler is not automatically removed, the services portion of the registry can be manually modified as indicated below.

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys And Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it. If you are running Windows NT, you should also update your Emergency Repair Disk (ERD).

  1. Start Registry Editor.

  2. Change the registry entries for Internet Explorer 4.0 Task Scheduler service:
          Key Name:
          HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Schedule
    
          Value Names:
          DependOnGroup: REG_MULTI_SZ
          DependOnService: REG_MULTI_SZ: RpcSs
          DisplayName: REG_SZ: Task Scheduler
          ErrorControl: REG_DWORD: 0x1
          Group: REG_SZ:
          ImagePath: REG_EXPAND_SZ: C:\WINNT\System32\MSTask.exe
          ObjectName: REG_SZ: LocalSystem
          Start: REG_DWORD: 0x3
          Type: REG_DWORD: 0x120 

    to the following registry entries for Windows NT AT Schedule Service
          Key Name:
          HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Schedule
    
          Value Names:
          ErrorControl:REG_DWORD: 0x1
          ImagePath: REG_EXPAND_SZ: %SystemRoot%\System32\AtSvc.Exe
          ObjectName: REG_SZ: LocalSystem
          Start: REG_DWORD: 0x2
          Type: REG_DWORD: 0x10 
How do I stop the Usrlogon Command from running for each user or change the name of it? 
You can remove or rename the USRLOGON.CMD file by navigating to:
HKey_Local_Machine\Software\Microsoft\Windows_NT\CurrentVersion\Winlogon
Then update or remove the usrlogon.cmd from the AppSetup value.
Do not change or remove any of the other executables that may be listed in this Registry key.
I have an application taking up 100% of my CPU time...what can I do? 
A document at JSIINC.com suggests the following...
0986 » How do I tune ill-behaved apps to be good Terminal Server citizens?
If a 16 or 32 bit application uses too many cycles when idle, you can tune the performance by editing the registry. Use Regedt32 to navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\Current Version\TerminalServer\Compatibility\Applications
Add Key name YourApplicationExe (without the extension). Leave the Class blank.
Add the following 4 Value names as type REG_DWORD entries: (see the SETUP sub-key if you rather Save Key and Restore):
FirstCountMsgQPeeksSleepBadApp - The default is 0xf (15). This is the number of times the application must query the message queue before Terminal Server decides that it is ill-behaved. Decrease this value to put the application to sleep more often, so it uses less CPU time.
MsgQBadAppSleepTimeInMillisec - The default is 0x1 (1). This is the number of milliseconds the application is suspended when Terminal Server has decided that it is ill-behaved. Increase this value to use less CPU time. If this value is zero, polling detection is disabled.
NthCountMsgQPeeksSleepBadApp - The default is 0x5 (5). This is the number of times the application must query the message queue before it is suspended again. Decrease this value to use less CPU time.
Flags - The default is 0x8 (8). The possible values are:
0x4 (4) for Win16 applications only.
0x8 (8) for Win32 applications only.
0xC (12) for either Win16 or Win32 applications.
You should run performance monitor while tuning the application.
You may want to have a look at the compatibility bits utility which does this graphically for you.
Here is a document from the Citrix KB that explains how to tune your application to make it behave.


Performance Tuning CPU Usage on 16-bit and 32-bit Windows Applications

Synopsis:
Depending on how an application is written, it is possible that a 16-bit or 32-bit Windows application may use too much CPU time even when it`s idle (no keyboard or mouse events).

Details:

This technote documents the use of WinFrame`s polling detection mechanism for Windows 16-bit and 32-bit applications. Some applications constantly look for keyboard input even while they appear to be doing nothing, thereby consuming a great deal of system CPU. WinFrame has built-in logic to detect this behavior. When this type of behavior is detected, the application`s execution is suspended, allowing other applications to utilize the CPU and making multitasking much more efficient. It is necessary to instruct WinFrame to look for this behavior by adding information to the Registry that is specific to the application in question.

Modifying the Registry

1. Run REGEDT32.EXE and locate the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\Compatibility\Applications

2. Double-click the Applications subkey to reveal several application settings that are pre-defined. Select SETUP under the Applications subkey. The following values are displayed on the right side of the Registry Editor window:

FirstCountMsgQPeeksSleepBadApp:REG_DWORD:0xF
Flags:REG_DWORD:0xc
MsgQBadAppSleepTimeInMillisec:REG_DWORD:0
NthCountMsgQPeeksSleepBadApp:REG_DWORD:0x5

3. With the SETUP subkey highlighted, select Save Key from the Registry pull-down menu. The filename can be anything, such as SETUP.REG. Once the SETUP values are saved, you need to create a subkey for your application.

4. With the Applications subkey highlighted, choose Add Key on the Edit pull-down menu. Set the Key Name field to the name of the executable in question, minus the extension. For example, for the application MYAPP.EXE, type MYAPP in the Key Name field. Leave the Class field blank. Click OK.

5. To copy the values from the SETUP subkey, select your new subkey (for example, MYAPP) and choose Restore from the Registry pull-down menu. Choose the filename you created in Step 3. Click Yes when the warning dialog box is displayed. Your new application subkey now has the same values as the SETUP subkey.

6. You must now fine tune the values for your application. The values are described in the following sections.

"Bad Application" Registry Values

The default values for the bad application settings are:

FirstCountMsgQPeeksSleepBadApp = 0xF
MsgQBadAppSleepTimeInMillisec = 0x1
NthCountMsgQPeeksSleepBadApp = 0x5
Flags: 0x8

FirstCountMsgQPeeksSleepBadApp is the number of times the application must query the message queue before WinFrame decides that it is ill-behaved. Decrease this value to put the application to sleep more often so it uses less CPU time.

MsgQBadAppSleepTimeInMillisec is the number of milliseconds the application is suspended once WinFrame has decided that it is ill-behaved. Increase this value to use less CPU time. If this value is zero, polling detection is disabled.

NthCountMsgQPeeksSleepBadApp After the application is determined to be "bad," this setting is the number of times the application must query the message queue before it is suspended again. Decrease this value to use less CPU time.

Flags is set to a value corresponding to the type of Windows application. Valid values are:

0x4 for Win16 applications only
0x8 for Win32 applications only
0xC for either Win16 or Win32 applications

"Bad Application" Settings

All values are expressed in hexadecimal. When changing the values, first click
the Decimal button and input the decimal value. For instance, if you want the MsgQBadAppSleepTimeInMillisec value to be set to 200 milliseconds, perform
the following steps:

1. Double click MsgQBadAppSleepTimeInMillisec
2. Click the Decimal radio button
3. Enter 200 in the Data field
4. Click OK

The value is now converted to 0xc8, the hexadecimal equivalent of 200 decimal.

NOTES:

1. To modify polling detection for DOS applications, use the DOSKBD utility.

2. When tuning these parameters, make sure the Performance Monitor up and running. These parameters will affect the amount of CPU used by an application. These parameters usually trade off CPU usage versus application responsiveness.

What are the features in Windows 2000 Terminal Services new since Windows NT Server 4.0 Terminal Server Edition? 
There are several key enhancements to Terminal Services in Windows 2000. Terminal Services is now a configurable service and is fully integrated with the Windows 2000 Server kernel. This means they can either be installed at setup or added or removed via the "Add/Remove Programs" tool under "Add/Remove Windows Components." The need for separate Terminal Services Service Packs has also been eliminated. To ensure that the proper performance profile for the Windows 2000 Server is preserved, users can modify the server Performance Options right-clicking on "My Computer" and choosing the Advanced tab in the System Properties dialog box. Administrators can choose to prioritize either "Applications" (Terminal Server serving up applications) or "Background Services" (regular client/server applications server or file and print server) to ensure that the installation of Terminal Services does not adversely affect file and print or server background process performance. Terminal Services now includes two different install modes: Remote Administration and Application Server. Administrators can choose which mode they would like to use Terminal Services in at the time of setup. Terminal Services has also been integrated with the Network Load Balancing (formerly Windows Load Balancing) service in Windows 2000, offering customers additional built-in scalability when setting up farms of computers running Terminal Server. The 16- and 32-bit RDP clients for Windows included with Windows 2000 Server also have major enhancements: brush and persistent caching to improve performance; shadowing and remote control of one client session by another for administration and trouble-shooting; automatic loading of drivers and configuration support for local printers attached to Windows-based terminals or PC clients; improved 56-bit or 128-bit (formerly 40-bit or 128-bit) encryption between client and server; and support for cut and paste between local windows and the RDP remote session. Another important new feature is multilanguage support, which allows any RDP client to interoperate in a multilanguage fashion with any computer running Terminal Services. In the earlier version (Windows NT Server 4.0 Terminal Server Edition), localization of the Terminal Server was in individual languages and required separate servers for multiple language support. With Windows 2000 Server, any client can talk to any server. Additional changes have been made to the administrative tools for Terminal Services, the Terminal Services Connection Configuration and the Terminal Services Manager. The Terminal Services Connection Configuration tool is now a Microsoft Management Console component; therefore, its GUI is more closely integrated with the other Windows 2000 administrative tools and can be extended by third parties. Lastly, there is support in Windows 2000 Server for a small set of new Terminal Services APIs. More information is available in the white paper “Using and Understanding APIs for Terminal Server.”
What is Windows Quality of Service in Windows 2000? 
As the traffic on networks continues to increase, the strain on the network
infrastructure/resources also increases. In response to this increased demand,
Microsoft is building a set of components into Windows 2000 for network bandwidth
management - called Quality of Service. These components allow network engineers
or administrators to specify how bandwidth will be utilized on a network by defining

traffic control patterns for different types of network traffic. With the increased
interest in quality of service in networking in general, Windows 2000`s Quality of
Services will be important as Windows 2000 is implemented.
For a book on the subject from Amazon click here.
How do I set up users Home Directories in Windows Terminal Server? 
To set up the users home directory go to user manager and click on the users name and then click profile. Fill in the home directory path on this screen. You can use either the home directory path or if you want the users home directory to be on another server or share on the network use the connect to path. Run the chkroot.cmd file from the c:\wtsrc\application compatibility scripts directory. This will create a file called ROOTDRV2.CMD that you have to edit with notepad and add your drive letter you want as the root drive letter after the = sign on the line that says Set RootDrive= . Make certain this drive letter is not used by anything else on your system. The Rootdrv2.cmd file is a very important piece in the compatibility scripts and they all use it to map the users home directory.
How do I eliminate print pop up messages and print message in event viewer. How do I elimate print spooler problems? 

One of the most annoying things about Windows NT Server is that out of the box it gives you a print popup message everytime a user prints..sometimes the message goes to everyone connected to the server. The second most annoying thing is by default all print events get logged to the Event log. Here is how to solve both problems. These solutions require editing the registry be sure and do and rdisk /s before doing any registry changes and if you dont know what you are doing in the registry dont mess with it. All disclaimers app

1.Run Regedt32.exe
2. From the Hkey_local_machine subtree go to the following key
3. System-CurrentControlSet-Control-Print-Providers
4.From the edit menu click on Add Value
5.In the value name field type the following this is case sensitive!: NetPopup
6.Select REG_DWORD for the data type
7. Click on OK
8. In the dword editor box type 0 (zero) in the data field
9. Click OK
Now print Popup notifications will be disabled to re-enable change this value back to 1.

To stop print notifications from being written to the event log perform the above up to step 3.
Click on the value that says Eventlog in the right window. It should already be there but if this value does not exist you will have to create it performing the same steps as in 4-5 above only change the word NetPopup to read Eventlog.
After clicking on Eventlog you will get a dword editor box. Change the value from a 1 to a 0 (zero).
Click on OK
Print events will no longer be written to event log.

If you are registry shy, using WTS and know how to use policies, the WTSADM policy file on thethin.net downloads page has these settings built into it. Check it out on the downloads page.
Another way to turn off these settings is to go to the printer control panel and choosing server properties from the first drop down menu and clicking on the advanced tab. Unchecking all the boxes and rebooting your server will clear the event messages.

Here is another printing suggestion:
Change The Print Spool Directory

By default, Windows NT uses the system disk for all print spooling directories. If you`re running out of space or fire off a large number of print jobs, this can soon become a performance bottleneck. You can change the spool directory by adding a new REG_SZ value named HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\[Printe rName]\SpoolDirectory and setting it to a local path. You should replace [PrinterName] with the name you gave the printer when you created it. Note: You can`t use a UNC path for the printer spool. You must use a fully qualified local path that exists before you make the changes. You must stop and restart the Spooler service after making these changes to the Registry.

Here is the url at Microsoft that explains more in depth on how to move the spool directory to another drive

If you need to add Print Screen Functionality back to your Print Screen Key in NT I reccomend you try the freeware utility Print Now. You can download it from here.

Another Freeware program to add Print Screen Functionality back to your Print Screen Key in NT is called Printkey. It has many more robust features than Print now and allows editing of the screen before printing. You can download the latest version from here. You can check out the authors homepage at http://www.geocities.com/~gigaman/

Sometimes the spooler gets hung, especially on WF/MF Servers you can use the below batch file script I wrote (that I have recently heard CITRIX tech support is reccomending)that reschedules itself to automatically reset the spooler every 2 hours and clear out hung jobs. This prevents a reboot. The 7200 is seconds and is changeable. Also for Terminal Server change the word winframe to wtsrv. Don`t worry about lost print jobs...the likelyhood that a job will be running the few seconds that this script takes to run is low. Even if a job or two is lost the user can just resend it and it beats having to reboot and kick off all users because of a hung job. Just run it once or use the autostart.zip file in the tip on how to run a batch file at system startup (http://thethin.net/autoexnt.cfm)
Note: In order for this batch file to run you will need soon.exe and timeout.exe from the resource kit(put them in your path)and the schedule service must be running.. You can download soon.exe from here with a sample of the batch file.

soon 7200 "%0"
net stop spooler
Timeout.exe 5
echo y | del c:\winframe\system32\spool\printers\*.*
net start spooler

The soon 7200 command schedules the job to run in 7200 seconds(2 hours). Change your timeout as necessary. The %0 reschedules the soon command to run again. The net stop spooler stops the spooler and the next line clears out all the hung print jobs. The timeout.exe file pauses the batch for a second or two so that the spooler has time to stop. Then the net start spooler restarts the spooler.

Click here to learn how to copy printers across your servers.

Disclaimer: This information is supplied as is and is intended for information purposes only.
Use this information at your own risk. The internet can often contain false or misleading information. While this is generally not the case with my personal documents I have to put this text here for legal purposes.

What is Windows Terminal Services? 
Terminal Services is An extension of Windows 2000 that allows multiple users to run an application on a server using a fat or a thin client.
What is Terminal Server? 
Terminal Server- An extension of Windows NT that allows multiple users to run an application on a server using a fat or a thin client.
How does the Microsoft RDP in Windows 2000 compare to Citrix Independent Computing Architecture? 

Terminal Services for Windows 2000 Server will continue to support both RDP and Citrix ICA (using MetaFrame) as Terminal Server 4.0 does today. Both RDP and Citrix ICA are high-performance display protocols that pass the display output from the application running at the server, down to the client device. RDP and ICA have similar performance characteristics. With Windows 2000, RDP adds some of the most requested features ICA already had; however, Citrix will continue to add value to Terminal Services with a new version of MetaFrame.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 [25] 26

Featured Links