Do you have a scripting-related question or problem? You can send your question or problem to winscriptsol@win2000mag.com.

My company is planning to migrate 4000 users from Windows NT to Windows 2000. I want to automate the migration of the users' Terminal Services Profile path from NT to Win2K. I plan to use a third-party utility to export the Terminal Services Profile path from NT, then use Microsoft Active Directory Service Interfaces (ADSI) to update the field in Active Directory (AD). However, I can't find where AD stores that information. Where can I find the user attributes listed on the Terminal Services Profile tab of the User Properties dialog box?

The userParameters attribute stores all the Terminal Services Profile settings for a user account. But you can't use ADSI to modify userParam-eters for two reasons. First, to achieve backward compatibility and interoperability, the SAM stores the actual userParameters settings. Second, userParameters is a binary object that doesn't expose its structure through ADSI. Thus, your options to automate the management of Terminal Services Profile are as follows:

  • Use Microsoft Visual Basic (VB) or another suitable programming language to call the native Win32 Terminal Services API functions, such as WTSQueryUserConfig and WTSSetUserConfig.
  • Use VB to create a COM object that wraps the Terminal Services API functions, then use the COM object in a script. For an example of a COM object that wraps these functions, see Thomas Eck, "Practical Usage of ADSI: Using COM Objects to Manage WTS Profile Paths," Part 1 and Part 2, April and May 2001.
  • Use a third-party tool. For example, the SystemTools Tscmd utility from SystemTools lets you manage Terminal Services Profile settings from the command line. To download this freeware, go to http:// www.system tools.com/free_frame.htm.