Microsoft KB Archive/829032

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

Article ID: 829032

Article Last Modified on 10/30/2006

-

APPLIES TO


 * Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)

-





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.



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.



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.  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:

http://msdn2.microsoft.com/en-us/netframework/default.aspx

 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.  Start a Web browser program such as Microsoft Internet Explorer, and then visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/netframework/default.aspx

 Click the Get the .NET Framework 1.1 SDK link, and then click the Download link. 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. </li> Change the PATH environment variable to point to the C# compiler (Csc.exe). This is typically the following folder location

%WINDIR%\Microsoft .NET\Framework\

where  is the .NET Framework 1.1 version number. To change the PATH variable, follow these steps:  Click Start, right-click My Computer, and then click Properties.</li> Click the Advanced tab, and then click Environment Variables.</li> Under System variables, click Path, and then click Edit.</li> Type the following at the end of the path statement in the Variable value box

; \Microsoft.NET\Framework\

where  is the folder where Windows is installed and where   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 &quot;Microsoft&quot; and &quot;.NET.&quot;</li> Click OK three times.</li></ol> </li> Change the PATH environment variable to point to the following folder location (where various tools are located)

\Program Files\Microsoft .NET\SDK\v1.1\Bin

where  is the drive where Windows is installed. To change the PATH variable, follow these steps:  Click Start, right-click My Computer, and then click Properties.</li> Click the Advanced tab, and then click Environment Variables.</li> Under System variables, click Path, and then click Edit.</li> Type the following at the end of the path statement in the Variable value box:

; \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 &quot;Microsoft&quot; and &quot;.NET.&quot;</li> Click OK three times.</li></ol> </li>  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(@&quot;guidconvert.snk&quot;)] namespace GUIDConvert {   [GuidAttribute(&quot;A39C5763-41CE-4ee1-A702-56D45BF589D5&quot;)] [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IConvert {       byte[] MakeGUIDByteArray(string s); }   [GuidAttribute(&quot;0F9A4464-A30C-46d2-9D35-D08E56A34CF2&quot;)] public class Convert : IConvert {       public Convert {       }        public byte[] MakeGUIDByteArray(string s)        { Guid guid = new Guid(s); return guid.ToByteArray; }   } } </li> Start a command prompt, and then change to the folder location where you stored the Convert.cs file.</li> <li>Type the following command (and then press ENTER) to produce a key pair for signing the DLL file:

Sn.exe -k GUIDConvert.snk

</li> <li>In the same folder location, type the following command to compile the C# code:

csc /t:library /out:GUIDConvert.dll /optimize convert.cs

</li> <li>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

</li> <li>In the same folder location, type the following command to register the GUIDConvert.dll file on the local computer:

regasm GUIDConvert.dll /tlb

</li> <li>Make sure that the GUIDConvert.dll file is in the same folder as the Windows Server 2003 Deployment Kit script that requires it.</li></ol>

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.

<div class="moreinformation_section">

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

http://www.microsoft.com/downloads/details.aspx?FamilyID=aaf0a7a4-71c1-4ee9-b974-66214651a23b&DisplayLang=en

Keywords: kbprb KB829032

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.