Managing Terminal Server with Systems Management Server

Make administration easier by using SMS with Terminal Server

Management simplification is a big factor for many administrators considering Microsoft Windows NT Server 4.0, Terminal Server Edition (formerly known as Hydra). These administrators like the fact that Terminal Server installs client software on the server, making installation on distributed client workstations unnecessary. Even so, some administrators need a more powerful management solution. Some of them have a large number of Terminal Server systems to manage, and others must distribute the same software to both Terminal Server machines and conventional PC client machines.

Such managers need a solution that will give them additional cost reduction and heightened management capabilities and control. Microsoft has developed Systems Management Server (SMS) to fill this need. SMS is a key component of Microsoft's Zero Administration for Windows (ZAW) initiative. The combination of SMS and Terminal Server provides a powerful solution platform with lower total administrative costs.

Although Microsoft did not originally design SMS to support Terminal Server, you can easily configure SMS to provide inventory, software distribution, and remote control capabilities in the Terminal Server environment. For more information about how SMS capabilities work differently in a Terminal Server environment, see the sidebar, "SMS Client Architecture in a Terminal Server Multiuser Environment," page 148. In this article, I'll describe how to configure SMS to manage a Terminal Server system and how to prepare an SMS package for execution under Terminal Server.

Changing the published SMS installation process may affect your technical support from Microsoft. If you have a Premier Support agreement, make sure you discuss the changes I'll describe with your support representatives before proceeding. Make backup copies of any files you modify during the implementation of this configuration, and remember to test all changes in a nonproduction environment.

To implement these configuration changes, you'll need SMS 1.2 with Service Pack 3 (SP3) or later, SQL Server 6.5 with SP3 or later, Terminal Server 4.0 with the Application Compatibility Scripts described in the sidebar on page 150, SMS Package Command Manager Service, and the SMS Resource Kit.

Server Configurations for Using SMS and Terminal Server
Make sure you install SMS and SQL Server on a properly configured NT computer that is separate from the machine running Terminal Server. Terminal Server is highly optimized to support foreground terminal sessions in which multiple users simultaneously run workstation-like workloads on the server while sending each screen interface to the appropriate user's device. Terminal Server is not optimized to run other BackOffice applications in the background. Therefore, if you install SMS and SQL Server on the Terminal Server system, the performance of both SMS and SQL Server will suffer.

You can configure a system running Terminal Server as an SMS distribution server to provide the share point for the Package Command Manager (PCM) to copy the package binaries (the .exe, .dll, and other files that comprise the application you want to install). This configuration will not affect the performance of terminal sessions.

Don't install a Terminal Server machine as a domain controller, because this configuration will increase the size of the domain's Security Accounts Manager (SAM) by up to 1KB per user. Also, make sure you don't configure a Terminal Server machine as an SMS logon server. If you do, you must then configure the Terminal Server machine as a domain controller.

Install SMS, SQL Server, and Terminal Server in accordance with the procedures supplied with each product. In the case of SMS, remember that the automatic configuration of logon scripts requires you to properly configure the NT Directory Replicator Service, as documented in the Microsoft manual Systems Management Server: Getting Started, Appendix D.

Tailoring SMS Site Settings for Terminal Server
To configure an SMS site to support Terminal Server, you must modify the SMS site settings. Start the SMS Administrator user interface (UI) and log on to the SMS SQL Server. Open the Sites window by selecting Open from the File menu and then selecting the Sites option. Select the desired site and select Properties from the File menu. Select Clients to reveal the dialog box Screen 1 shows. Ensure that you clear the PCM, Prgram Group Control, and Management Information Format (MIF) Entry Program options. In an SMS site dedicated to supporting Terminal Server client systems, the PCM service runs even if you have deselected the PCM option; clearing this check box does not affect the background service.

Next, select the Options button and deselect the option to Install Accelerated Video Drivers (AVDs). Using these drivers will cause blue-screen kernel dumps on the Terminal Server system.

If you share an SMS site with non-Terminal Server machines for which the above settings are inappropriate, you'll need to make some changes to the logon scripts and smsrun32.ini file. From the SMS Administrator UI, set the site configuration options windows to the settings you require for the non-Terminal Server systems, then override the smsrun32.ini file to set the necessary site settings for your Terminal Server machines.

Usually, you want to create the smsrun32.ini file consistent with the site settings in the Client window and store it in each client's C:\ms\sms\data directory. To override these settings for Terminal Server computers in the site while letting the settings govern other systems, make the following changes.

Create the following file, and save it as smsrun32.trm in the C:\nts\system32\repl\export\scripts directory of the login domain for the SMS site:

sms client



Locate the SMS logon script files in C:\sms\site.srv\\smsls.bat, and add the following lines:

REM check if client is Terminal Server and if it is copy custom smsrun32.ini.

If exist %systemroot%\system32\termsrv.exe copy z:\smsrun32.trm c:\ms\sms\data\smsrun32.ini

These changes will let the logon script detect Terminal Server and copy an smsrun32.ini file with the proper options for Terminal Server, overriding any site settings that might be different.

Install the SMS Client on Terminal Server

Terminal Server requires you to issue the change user/install command to place the server in install mode and turn off the Registry and .ini file redirection. These conditions are necessary for proper installation of the SMS Client. The normal installation process, which the logon scripts initiate, does not issue this command. Issue the following command to map the Z drive to the NETLOGON share on one of the logon servers: NET USE Z:\\pdcname\netlogon. Execute the smsls.bat batch file from the Z drive twice to install the client code and complete the inventory for the server.

To support AVD on non-Terminal Server workstations, make the following Registry change before you reboot: In Registry Editor (regedt32.exe), find the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlset\Services\rchelp. Change the Start key's value to 4. Doing so disables Accelerated Screen Transfer, which prevents the key from loading during startup. Quit Registry Editor.

Use the Rservice Command to Install the PCM Service
Microsoft provides a version of PCM that can execute as a background service on a Windows NT server or workstation. PCM as a service (pcmsvc32.exe) sends mandatory packages to the background in a Terminal Server system. You can download pcmsvc32.exe from and install it on your SMS site server. Install pcmsvc32.exe with the rservice command, as detailed in the install.doc file in the pcmservice folder.

To install pcmsvc32.exe on a Terminal Server system, configure an rservice.ini file as follows. For the domain name, type:

domain name=ntsd

For the service account, type:


For the service name, type:


For the executable file, type:


For the installation directory, type:


For the source path, type:


Tailor the domain name, user ID, and source path for your environment. If you need further information, refer to the pcmsvc32.exe installation documentation.

Once you've configured the rservice.ini file, open a command window and issue the rservice command to initiate the installation and startup of the service: rservice /install /l rservice.ini /v. Then, log on to the Terminal Server machine with a user ID that has local administrator authority and launch SMS. Select the SMS_PACKAGE_COMMAND_MANAGER_NT service, then click the Startup button. Change the startup option from manual to automatic.

From this point, SMS can manage Terminal Server. SMS will provide hardware and software inventory at the frequency set for the SMS site, remote control and software distribution to pcmsvc32.exe. Remember that all packages and jobs distributed to the Terminal Server computer must be set up as Automated Command Line and System (Background) Task.

Distributing Software to Terminal Server
Software designed to run in a multiuser environment may not function properly under Terminal Server without changes. Microsoft has tested 36 of the most popular software titles with Terminal Server, and developed a set of Application Compatibility Scripts for each title. These scripts modify the software's installation so the software will run properly under Terminal Server. See the sidebar "Terminal Server's Application Compatibility Scripts" for more information about these scripts. You can find the scripts in the C:\WTSVR\Applications Compatibility Scripts folder, and they're documented in the Terminal Server Release Notes.

When you've determined the installation software you plan to distribute, make sure you test it outside of SMS control before attempting an unattended installation. Also, make sure Terminal Server users are not logged on when you're installing and updating software on the server.

Usually, under SMS, installing a package to distribute software involves one step, using one command line. The installation of software on a Terminal Server system is a three-step process:

  1. Issue the change user /install command to enable installation into the \WTSVR directory and Registry.
  2. Execute the normal setup command.
  3. Execute the Application Compatibility Script to modify the installed application to work properly on a multiuser system.

SMS can't easily coordinate the orderly execution of the three steps. You must modify the Microsoft Application Compatibility Script to use SMS to install software on a Terminal Server system. The modification will let SMS execute all three steps in a single .bat file so that SMS has only one command line to manage.

Because the SMS package will run in the background and you won't be able to observe any errors that occur during installation, make sure you create an SMS status management information file (MIF). You can use the status MIF to notify the SMS site server of any unusual condition the package encounters during installation.

Also you'll want to avoid having to distribute two copies of the package (one for PC workstation users and one for Terminal Server machines). You can do so by modifying an existing SMS package to include the additional command lines for Terminal Server.

Modifying the Application Compatibility Scripts
The following changes will enable the Applications Compatibility Scripts to combine all three of the Terminal Server software installation steps into one step for use with SMS, but will also preserve the ability to execute the three steps outside SMS. This capability will help you later with troubleshooting.

Add the following lines to the Application Compatibility Script for the software you want to distribute via SMS:

change user /install

%1 %2 %3 %4 %5 %6 %7 %8

if %errorlevel% neq 0 goto statusmif

goto nomif


if exist c:\sms.ini ismif32 ­f packagename ­s 0 ­d "errorlevel %errorlevel%"


The modified Application Compatibility Script will issue the change user /install command and then execute any optional parameters specified on the command line that called the Application Compatibility Script.

If you get an error at a level greater than zero when you execute setup.exe, you need to test for the existence of the sms.ini file. If this file exists, SMS will call the ismif32.exe program in the resource kit and generate a status MIF. SMS will then collect the status MIF information automatically and post it to the SQL database. To create the status MIF, obtain the ismif32.exe and ismif32.dll files from the resource kit. You can download these files at

Modifying the PDF Files
Microsoft and other vendors supply Package Definition Files (PDFs) for the automated installation of most software listed in the release notes for Terminal Server with Application Compatibility Scripts. The PDF file format lets SMS create a package easily. SMS imports most of the settings, except the location of the binaries, from the PDF. A PDF usually contains more than one command line to let different versions of the installation share the same package of binaries.

You can modify the supplied PDF files to add command lines for the Terminal Server environment. For example, the PDF for Microsoft Office contains four command lines: Manual, Typical, Complete, and Uninstall. By editing the PDF with Notepad, you can make and modify copies of the Typical and Complete command line sections for Terminal Server. The resulting PDF file creates a package for Microsoft Office that you can distribute throughout a company. The package lets both Terminal Server and non-Terminal Server users share the same binaries in the distribution point.

The typical PDF comprises a definition section under the header "Package Definition." This section defines the names of the available command lines listed with the parameter Setup-Variations=. To add command lines to the PDF file, simply add section names to this parameter. In the following example, you'll add TSTypical:



\[Package Definition\]

Product=Microsoft Office 97 Professional 8.0 SR-1

Comment=Microsoft Office 97 Professional for Windows

WorkstationAccess=UserRead, UserWrite, GuestRead, GuestWrite

SetupVariations=Manual, Custom, Typical, Uninstall, TSTypical

You must also add a new section to the PDF that corresponds to the the SetupVariations= change. The TSTypical Setup section is a clone of the Typical section. Change the SystemTask= parameter to SystemTask=True, and ensure that you set the UserInputRequired= parameter to False. In the example below, you'll add the TSTypical section to create a Terminal Server command line option for a typical install of Office 97 Service Release 1.

TSTypical Setup


CommandLine=Office97.cmd setup.exe /Q1 /B1




SupportedPlatforms=Windows NT 3.1 (x86), Windows95

Modify the SMS package command line so it will call the modified Application Compatibility Script. Do so by changing the usual setup command to a command line parameter. For example, to install Microsoft Office 97, change the usual command line setup /Q1 /B1 to Office97.cmd setup.exe /Q1 /B1. Import the modified PDF file into SMS from the SMS Administrator UI Package Properties window by selecting the Import button, browsing to the location of the PDF, and specifying the location of the Microsoft Office Administrative Setup share point. For further information on the command line options for Office and how to perform an SMS installation of Office, refer to the Office 97 Resource Kit.

A Powerful and Cost-Effective System
By using SMS with Terminal Server, you can manage hardware and software configurations of large numbers of remotely installed servers. The installation modifications to support Terminal Server are straightforward, and the resulting system can be an important part of your effort to reduce the total cost of ownership.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.