IPB

Google Frontpage Forums Unattended CD/DVD Guide
 
Reply to this topicStart new topic
> Dynamically create the Unattend.xml
ChrisBaksa
post Jun 9 2008, 06:39 AM
Post #1


Member
**

Group: Members
Posts: 226
Joined: 5-March 04
From: New Jersey, USA
Member No.: 15376
OS: 2003 x64
Country Flag


I was wondering if anyone was dynamically creating the Unattend.xml for their Windows 2008/Vista installs.
I'm looking for information on how people are creating the unattend.xml thru scripted methods. Specifically... I'm looing to do this thru VB Script.
It seems Micosoft has made this process a nightmare. The old Unattend.txt was easy.

Aything helps.

Chris
Go to the top of the page
 
+Quote Post
Innocent Devil
post Jun 9 2008, 12:41 PM
Post #2


Senior Member
****

Group: Members
Posts: 647
Joined: 4-February 05
From: God's Own Country
Member No.: 43021
OS: XP Pro x86
Country Flag


i think "Component Platform Interface (CPI) Reference" is for that

read more abt cpi in waik der is a chm to detail abt it.
Go to the top of the page
 
+Quote Post
fizban2
post Jun 10 2008, 10:19 PM
Post #3


MSFN Addict
Group Icon

Group: Moderator
Posts: 1751
Joined: 14-April 05
From: Wisconsin
Member No.: 51914
OS: Vista Enterprise x64
Country Flag


a good way to see how it is done is to down the MDT from microsoft and dissect it and look at the scripts they use to do it smile.gif or just use the MDT since it will do it for you!
Go to the top of the page
 
+Quote Post
ChrisBaksa
post Jun 12 2008, 01:46 PM
Post #4


Member
**

Group: Members
Posts: 226
Joined: 5-March 04
From: New Jersey, USA
Member No.: 15376
OS: 2003 x64
Country Flag


QUOTE (fizban2 @ Jun 11 2008, 12:19 AM) *
a good way to see how it is done is to down the MDT from microsoft and dissect it and look at the scripts they use to do it smile.gif or just use the MDT since it will do it for you!


MDT? Please elaborate.

Chris
Go to the top of the page
 
+Quote Post
leen2
post Jun 17 2008, 03:56 PM
Post #5





Group: Members
Posts: 6
Joined: 17-June 08
Member No.: 197105
OS: Vista Ultimate x64
Country Flag


I plan to do this for our unattended installs. We currently do this for Windows 2000 and Windows Server 2003 OS versions for unattend.txt, so I plan to extend it for Windows Server 2008 as well for unattend.xml.

Simple VB code to create a FileSystemObject we use is as follows:

Set objFS = CreateObject("Scripting.FileSystemObject")
Set objNewFile = objFS.CreateTextFile("c:\unattend.xml")
objNewFile.WriteLine "<?xml version=" & chr(34) & "1.0" & chr(34) & " encoding=" & chr(34) & "utf-8" & chr(34) & "?>"
objNewFile.WriteLine "<unattend xmlns=" & chr(34) & "urn:schemas-microsoft-com:unattend" & chr(34) & ">"
objNewFile.WriteLine "< <servicing>"
etc...
objNewFile.Close

(as you can't use the double quote charater directly, you have to substitutue it for " & chr(34) & " in the code so that when it writes out the file it fills in the correct character.)

Just produce and validate your original unattend.xml file in Windows System Image manager from WAIK and then use it as the template for the VBscript to dynamically produce.
Go to the top of the page
 
+Quote Post
fizban2
post Jun 18 2008, 06:18 AM
Post #6


MSFN Addict
Group Icon

Group: Moderator
Posts: 1751
Joined: 14-April 05
From: Wisconsin
Member No.: 51914
OS: Vista Enterprise x64
Country Flag


QUOTE (ChrisBaksa @ Jun 12 2008, 02:46 PM) *
QUOTE (fizban2 @ Jun 11 2008, 12:19 AM) *
a good way to see how it is done is to down the MDT from microsoft and dissect it and look at the scripts they use to do it smile.gif or just use the MDT since it will do it for you!


MDT? Please elaborate.

Chris



http://www.microsoft.com/downloads/details...;DisplayLang=en
Go to the top of the page
 
+Quote Post
ChrisBaksa
post Aug 8 2008, 07:37 AM
Post #7


Member
**

Group: Members
Posts: 226
Joined: 5-March 04
From: New Jersey, USA
Member No.: 15376
OS: 2003 x64
Country Flag


QUOTE (leen2 @ Jun 17 2008, 05:56 PM) *
I plan to do this for our unattended installs. We currently do this for Windows 2000 and Windows Server 2003 OS versions for unattend.txt, so I plan to extend it for Windows Server 2008 as well for unattend.xml.

Simple VB code to create a FileSystemObject we use is as follows:

Set objFS = CreateObject("Scripting.FileSystemObject")
Set objNewFile = objFS.CreateTextFile("c:\unattend.xml")
objNewFile.WriteLine "<?xml version=" & chr(34) & "1.0" & chr(34) & " encoding=" & chr(34) & "utf-8" & chr(34) & "?>"
objNewFile.WriteLine "<unattend xmlns=" & chr(34) & "urn:schemas-microsoft-com:unattend" & chr(34) & ">"
objNewFile.WriteLine "< <servicing>"
etc...
objNewFile.Close

(as you can't use the double quote charater directly, you have to substitutue it for " & chr(34) & " in the code so that when it writes out the file it fills in the correct character.)

Just produce and validate your original unattend.xml file in Windows System Image manager from WAIK and then use it as the template for the VBscript to dynamically produce.


Ok.. here is the big question.
First let me describe my process.

I PXE boot to WINPE...
I Partition and format drive...
I Use ImageX to deploy a custom Image (I used the Sysprep /OOBE /Generalize /Shutdown switches and then created my image)
I Now I copy my PNP drivers to the drive (unattend.xml has the locations in it)

Now my Unattend.xml is created via scripting and has my regionalization, IP address, pnp driver paths and other information.

What do I do with the file? Does it get rename?
Where does it go so when WInPE rebots and teh host boots up it is used and builds with those settings?
I assume it has to be placed somewhere on the host's hard drive. But where?
I can't find this information anywhere.

Thanks.

Chris
Go to the top of the page
 
+Quote Post
Br4tt3
post Aug 12 2008, 06:35 AM
Post #8


World famous sausage eater...
****

Group: Members
Posts: 555
Joined: 20-April 04
From: Malmö
Member No.: 18221
Country Flag


Hi,

I am also using the MDT (Microsoft Deployment Toolkit) as a build environment, which would create "generic" images..
Works just fine for me.... and free of charge! To answer your questions listed above (all of them are addressed within the MDT framework):


Q1: PXE boot to WINPE...
A1: It is also what MS is doing within MDT

Q2: I Partition and format drive...
A2: Check

Q3: I Use ImageX to deploy a custom Image (I used the Sysprep /OOBE /Generalize /Shutdown switches and then created my image)
A3: Exactly what MS are doing within MDT

Q4: I Now I copy my PNP drivers to the drive (unattend.xml has the locations in it)
A4: I personally use a vbscript for reading the registry key that is created if booted over WDS, to determine the location container for the driver package, and apply it using the imagex.exe commando, not from within the unattend.xml even if possible. The drivers can be injected with drvinst or Package Manager using CLI/WSH. MDT also has a MS solution for it even though I find it somewhat troubblesome.

Q5: What do I do with the file?
A5: The name of the file must be unattend.xml or autounattend.xml according to MS documentation or the panther (setup engine) engine will skipp the exection of it. The panther engine, searches a predefined number of directories
to check wheather it contains an unattend.xml or autounattend.xml file. The diffrent directories, are also prioritized which are documented within the unattend.chm file that is accompinied with the WAIK tools (search for panther).
Personally, I store mine in C:\Windows\Panther....

Q6: Does it get rename?
A6: Not to my knowledge...

Q7: Where does it go so when WInPE rebots and teh host boots up it is used and builds with those settings?
A7: Once the sysprep phase has ended, the image is saved onto a network server. The image would then contain the actual files contained on the "base" machine (if not skipped by a .wim script) which MDT defaults to. Once you apply the image that you saved to the network location by for example WDS to the target machine, the panther engine would start to scan it's predefined order of directories. In my case, it would search for example the root of C:, not finding any unattend.xml file until it hits c:\Windows\Panther. Now, the setup engine would determine, if the .xml is properly formated (xml) and if it contains all the required params. We assume it does....

Q8: I assume it has to be placed somewhere on the host's hard drive. But where? I can't find this information anywhere.
A8: Listed above... however, the .chm files contained within the WAIK tools (search tag "panther" / "setup phase") should prolly provide you with the start documentation for getting on with it...

I strongly recommend the MDT as it can be highly customized for your deployment, and get you on the way pretty fast...

Hope it helps and gg!

This post has been edited by Br4tt3: Aug 12 2008, 06:59 AM
Go to the top of the page
 
+Quote Post
ChrisBaksa
post Aug 18 2008, 12:19 PM
Post #9


Member
**

Group: Members
Posts: 226
Joined: 5-March 04
From: New Jersey, USA
Member No.: 15376
OS: 2003 x64
Country Flag


Thanks Br4tt3,

I am finding that alot of people are not using any of MS's tools (like the MDT). I've been in contact with MS as well as several other individuals in my situation and the Unattend.xml is simply generated line by line and checked against the WAIK before the code is rolled into production. One company I spoke with is using a generic unattend.xml and is doing a search and replace for strings.


Chris
Go to the top of the page
 
+Quote Post

Google Frontpage Forums Unattended CD/DVD Guide

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 20th November 2008 - 10:17 AM
All trademarks mentioned on this page are the property of their respective owners
MSFN is not affiliated with Microsoft
Copyright © 2001-2008 msfn.org
Privacy Policy