Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Cannot prestage RIS Clients in Active Directory by using the Windows Server 2003 Deployment Kit


View products that this article applies to.

Symptoms

When you try to use the scripts that are included with the Windows Server 2003 Deployment Kit to prestage Remote Installation Services (RIS) clients in the Active Directory directory service, the script does not run successfully.

↑ Back to the top


Cause

This issue occurs because the script that is provided in the Windows Server 2003 Deployment Kit to prestage RIS clients in Active Directory requires a dynamic link library (DLL) file to convert a hexadecimal string to a byte array. This procedure cannot be performed by using VBScript. This DLL file is not included in the Windows Server 2003 Deployment Kit.

↑ Back to the top


Resolution

To resolve this issue, create and compile the GUIDConvert.dll file. To do this, follow these steps. Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
  1. Install version 1.1 of the Microsoft .NET Framework if it is not already installed. You can automatically install version 1.1 of the .NET Framework from the Windows Update Web site. Or, visit the following Microsoft Web site to obtain the .NET Framework version 1.1 Redistributable Package program:
  2. Install version 1.1 of the .NET Framework Software Development Kit (SDK) if it is not already installed. To obtain version 1.1 of the .NET Framework SDK, follow these steps.

    Note If you have Microsoft Visual Studio .NET 2003 installed, you do not have to install version 1.1 of the .NET Framework SDK. Version 1.1 of the .NET Framework SDK is included with Visual Studio .NET 2003.
    1. Start a Web browser program such as Microsoft Internet Explorer, and then visit the following Microsoft Web site:
    2. Click the Get the .NET Framework 1.1 SDK link, and then click the Download link.
    3. Click Open to start the Setup.exe program.

      Note This file is more than 100 megabytes (MB). Therefore, you may want to save the file to the local computer and then double-click the executable file to run Setup.
  3. Change the PATH environment variable to point to the C# compiler (Csc.exe). This is typically the following folder location
    %WINDIR%\Microsoft .NET\Framework\version number
    where version number is the .NET Framework 1.1 version number. To change the PATH variable, follow these steps:
    1. Click Start, right-click My Computer, and then click Properties.
    2. Click the Advanced tab, and then click Environment Variables.
    3. Under System variables, click Path, and then click Edit.
    4. Type the following at the end of the path statement in the Variable value box
      ;C:\Windows\Microsoft.NET\Framework\v1.1.4322
      where C:\Windows is the folder where Windows is installed and where v1.1.4322 is the .NET Framework 1.1 version number.

      Note There is a semicolon character at the beginning of the text, and there is no space between "Microsoft" and ".NET."
    5. Click OK three times.
  4. Change the PATH environment variable to point to the following folder location (where various tools are located)
    C:\Program Files\Microsoft .NET\SDK\v1.1\Bin
    where C: is the drive where Windows is installed. To change the PATH variable, follow these steps:
    1. Click Start, right-click My Computer, and then click Properties.
    2. Click the Advanced tab, and then click Environment Variables.
    3. Under System variables, click Path, and then click Edit.
    4. Type the following at the end of the path statement in the Variable value box:
      ;C:\Program Files\Microsoft.NET\SDK\v1.1\Bin
      Note There is a semicolon character at the beginning of the text, and there is no space between "Microsoft" and ".NET."
    5. Click OK three times.
  5. Type or paste the following code into a file that is named Convert.cs, and then copy Convert.cs to a folder. For example, copy the Convert.cs file to c:\risscript.
    /* This is a code sample that shows how you might create a 
     * .dll that converts a hexadecimal string into a binary
     * array using the C# language.
     */ 
    
    using System;
    using System.Runtime.InteropServices;
    using System.Reflection;
    
    [assembly:AssemblyKeyFile(@"guidconvert.snk")]
    namespace GUIDConvert
    {
    	[GuidAttribute("A39C5763-41CE-4ee1-A702-56D45BF589D5")]
    	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    	public interface IConvert
    	{
    		byte[] MakeGUIDByteArray(string s);
    	}
    	[GuidAttribute("0F9A4464-A30C-46d2-9D35-D08E56A34CF2")]
    	public class Convert : IConvert
    	{
    		public Convert()
    		{
    		}
    		public byte[] MakeGUIDByteArray(string s)
    		{
    			Guid guid = new Guid(s);
    			return guid.ToByteArray();
    		}
    	}
    }
  6. Start a command prompt, and then change to the folder location where you stored the Convert.cs file.
  7. Type the following command (and then press ENTER) to produce a key pair for signing the DLL file:
    Sn.exe -k GUIDConvert.snk
  8. In the same folder location, type the following command to compile the C# code:
    csc /t:library /out:GUIDConvert.dll /optimize convert.cs
  9. In the same folder location, type the following command to install the GUIDConvert.dll file in the global assembly cache (GAC):
    gacutil /i GUIDConvert.dll
  10. In the same folder location, type the following command to register the GUIDConvert.dll file on the local computer:
    regasm GUIDConvert.dll /tlb
  11. Make sure that the GUIDConvert.dll file is in the same folder as the Windows Server 2003 Deployment Kit script that requires it.
You can now use the GUIDConvert.dll file (together with a script) to prestage clients in Active Directory. The PrestagRISClnt.txt sample script describes how to do this. You can find PrestagRISClnt.txt in the Windows Server 2003 Deployment Kit: Automating and Customizing Installations book.

↑ Back to the top


More information

To obtain Windows Server 2003 Deployment Kit: Automating and Customizing Installations, visit the following Microsoft Web site:

↑ Back to the top


Keywords: KB829032, kbprb

↑ Back to the top

Article Info
Article ID : 829032
Revision : 5
Created on : 10/30/2006
Published on : 10/30/2006
Exists online : False
Views : 189