IT Management Suite

Expand all | Collapse all

How to get computername token into unattend.xml

  • 1.  How to get computername token into unattend.xml

    Posted Sep 06, 2010 01:20 AM

    Hi,

    I am trying to get the computer name token into our unattend.xml file and having a couple of difficulties.

    First I have built my unattend.xml based on this guide http://blog.brianleejackson.com/sysprep-a-windows-7-machine-%E2%80%93-start-to-finish-v2

    Second I used our previous Drivers inject script and modified it as per some of the posts on here.  The following line from what I have read should be what I need?
    .\Rdeploy\windows\firm.exe copy .\temp\%COMPNAME%.xml prod:windows\panther\unattend.xml

    The first issue I have is that after distributing the new image the automation boot reboots.  I have a sort of work around where I set the driver job to boot to automation again (loading 2xwinPE though is slow!).

    The second (and main) issue I have is that there is actually no file %compname%.xml  I have .inf files or .cfg files in that directory but no .xml files.  I must be missing something?

    Any help appreciated.

    Cheers,


  • 2.  RE: How to get computername token into unattend.xml

    Trusted Advisor
    Posted Sep 06, 2010 03:05 AM
    Hi dsr,

    I put in a blog recently which details the Win7 install process for both sysprep and scripted installations.

    It goes through creating the xml files, and ammending them to inject the computer name. Give that a read, and let me know if that clarifies things. It doesn't cover HII, but does cover your main issue of computer naming and XML files.

    Kind Regards,
    Ian./
     






  • 3.  RE: How to get computername token into unattend.xml

    Posted Sep 06, 2010 08:04 AM
    For the first issue, check the options in your imaging job, I think "Automatically perform..." should be deselected.

    For the second issue, how is the compname file created? It looks like you know that DS tokens need to be in uppercase.

    Also, in WinPE you don't need to use FIRM.EXE, copy or xcopy will do.


  • 4.  RE: How to get computername token into unattend.xml

    Posted Sep 06, 2010 09:55 PM
    Thanks for the replies so far guys,

    Ian,  I will read through you guide and compare against what I have done.  So far my HII  image works fine, joins the domain fine and has most of the customizations I want (still a few things to tweak when I find them).  It is just the computer name aspect.

    Andy, I'll check to make sure I am using %COMPNAME% but I am pretty sure I am.  From our older DOS boot installs it seems like we had an inf file created in the temp directory which was then copied to the computer as sysprep.inf.  Using winpe there seems to be some .cfg files in the temp directory, howver I don't see anything like computer_name.xml as suggested in some of the guides I have read and where I took this line from \Rdeploy\windows\firm.exe copy .\temp\%COMPNAME%.xml prod:windows\panther\unattend.xml

    Cheers,


  • 5.  RE: How to get computername token into unattend.xml

    Trusted Advisor
    Posted Sep 07, 2010 06:09 AM
    Hi dsr,

    Without knowing exactly what you are doing in your HII here's some pointers. Sorry if its stuff you already know!

    .cfg files -> If you have have check the option for Altiris to reconfigure the machine after deploying your image it creates this to

    sysprep.inf -> I would change this to sysprep.xml -in Windows 7, as they aren't actually inf files so its best to avoid confusion that suffix to avoid confusion.

    Standard practice is to use %ID%.xml rather than %COMPNAME%.xml -this ensures uniqueness avoids the possibility of spaces getting in the way when you copy these little files around. 

    The computer name can only be configured to my knowledge in the XML during the specialize pass (see my blog). If doing this manually with a FIRM copy (rather than having Altiris copy it by referencing the sysprep file in the GUI) then you'll need to use a ReplaceTokens on the XML before copying over to the client.

    When monitoring some of the files in the temp folder, Deployment server will do some cleaning up, so sometimes they are shortlived.

    Hope at least some of that helps.



  • 6.  RE: How to get computername token into unattend.xml

    Posted Sep 08, 2010 03:47 AM

    Thanks,

    Just had a chance to take a look again.  I think I have done most things fairly simliar.

    I follow http://blog.brianleejackson.com/sysprep-a-windows-7-machine-%E2%80%93-start-to-finish-v2 for creating my unattend.xml (I added some of my owns parts to it also using WAIK).

    I actually copied the unattend.xml to sysprep directory and panther directory before I sysprep the machine  There is a setupcomplete.cmd file where I remove the sysprep files on first run also. (so license keys, pwds etc don't get left behind).

    I ran sysprep /generalize /oobe /shutdown /unattend:unattend.xml from command line from the machine to be syspreped.

    I used Altiris to capture the image (I didn't click the use sysprep option ... if I'm right your method did my two steps in the one Altiris job?)

    Deploying the diskimage I also didn't tick the prepare with sysprep option.  Our dos jobs for xp used the firmcopy to copy the sysprep.inf file across so I was going for a similar solution with the .xml files.

    So mine ran the unattend.xml that I had copied over before the sysprep phase.

    Now I am trying distributing with the sysprep option ticked and using default unattend (I copied mine so the sysprep directory).  I noticed a line copying foo.xml to unattend.xml so perhaps this time it is working....  I will let you know how it goes.

    Cheers for the help.




  • 7.  RE: How to get computername token into unattend.xml

    Posted Sep 08, 2010 10:50 PM

    I may try and explain again...

    To image up a new XP machine we used to plug the PC into the network, boot into automation.  The PC would show in the console and we would click on it and give it a name.  We would then drop our HII image on it.  The sysprep.inf file would then get copied across (inside that we have the line ComputerName=%NAME%, which I beleive should take the name given in Altiris console into the sysprep.inf file).

    So I am basically trying to do the same thing using the unattend.xml file instead of the sysprep.inf.  I want to boot the computer up rename it in altiris console and have this name deploy as the computer name.

    I have adjusted the Image job to use the sysprep the unattend.xml I created using WAIK (I have the computername line set to %COMPNAME%).  It seems to copy the XML file to the computer (so I shouldn't need to script I used before) but it doesn't seem to take the name I give it in the altiris console.

    I hope that clears up what I'm trying to do.  Thanks for the help.


  • 8.  RE: How to get computername token into unattend.xml

    Trusted Advisor
    Posted Sep 10, 2010 08:17 AM
    Hi,

    Looks to me then like its a problem with the unattend file. Can you post your unattend.xml here for me? Just star out any sensitive bits... ;-)


  • 9.  RE: How to get computername token into unattend.xml

    Trusted Advisor
    Posted Sep 13, 2010 04:21 AM

    Hi dsr,

    Do you need any more help with this one?



  • 10.  RE: How to get computername token into unattend.xml

    Posted Sep 13, 2010 09:27 PM
      |   view attached

    Hi,

    Yes please :)

    I have my unattend.xml

    When I was looking at it again, I discovered I didn't have the %COMPNAME% token in it... I must have taken it out and forgot about it!!!

    Anyway I placed it back in however I get an error during system setup "Windows could not parse or process the unattend answer file for pass [specialize], the settings in the answer file could not be applied...."

    I assume this has to the with the %COMPNAME% as I only just placed this back.

    My steps to image where

    Install Win7 ent

    Enter setup mode on first run (ctrl shift f3)

    copy over my unattend.xml

    Sysprep the machine pointing to unattend.xml

    Capture the image.

    Deploy the image pointing at my sysprep unattend.

     

    Thanks again.

     

    (See attached)

    Attachment(s)

    xml
    unattend_POST.xml   6 KB 1 version


  • 11.  RE: How to get computername token into unattend.xml

    Trusted Advisor
    Posted Sep 14, 2010 02:30 AM

    Hi dsr,

    Altiris makes this easier than you think. Here is a summary of my untangling blog, 

    1. Install Windows 7
    2. Capture the image using the sysprep option
    3. Now deploy the image, selecting your answer file as the XML file to be distributed in the image

    You DO NOT need to enter setup mode on first run, and copy over the XML yourself. And by removing Altiris from the loop, there is no way it knows to replace the %COMPNAME% token with the computer's name as stored in the eXpress database.

    The error you are getting is because Windows Setup is attempting to use your raw answerfile with the %COMPNAME% value in it -and it's illegal.

    I know the untangling blog is long -but it really works for deploying Windows 7 computers!

    Kind Regards,
    Ian./

     



  • 12.  RE: How to get computername token into unattend.xml

    Posted Sep 14, 2010 02:49 AM

    Thanks Ian,

    I am going to go back and do it purely your way.  I was under the assumption that my captured image method was basically the same as what you had done but I see how it could be impacting the end result now.

    Let me have another crack, I'll post my results soon.

     

    Cheers,



  • 13.  RE: How to get computername token into unattend.xml

    Posted Sep 14, 2010 10:03 PM

    Hey,

     

    I followed these directions again from scratch,

    Installed Windows 7

    Created my altiris sysprep job / applied it

    Created image deployment job specifying my unattend file

     

    I get stuck on the specialize pass once again ... it seems it does  not like the %COMPNAME% token still.  I tried takign the xml from the guide and stripping everything back to purely the <ComputerName> in the specialize pass.  Same result.

    So does this point to something going wrong during the sysprep capture?



  • 14.  RE: How to get computername token into unattend.xml

    Posted Sep 15, 2010 01:49 AM

    Where or what file does Altiris use for its "Default answer file".  Will it just be unattend.xml in the sysprep directory?



  • 15.  RE: How to get computername token into unattend.xml

    Trusted Advisor
    Posted Sep 15, 2010 06:27 AM

    Hi dsr,

    If you use the default answer file, I think it uses the vista unattend XML file as a base with some on-the-fly modifications.  I haven't actually tested removing the default answer files and see if this impacts the process though. ;-)

    When you say it doesn't like your %COMPNAME% entry, what error does it throw up?

    Are you able to grab the unattend.xml file from C:\Windows\Panther -as this will tell us exactly what the installation is using for it's unattend.xml

    Kind Regards,
    Ian./



  • 16.  RE: How to get computername token into unattend.xml

    Posted Sep 16, 2010 09:37 PM

    Hi,

     

    Now I'm not quite sure what is happening.... I get the error

    "windows boot manager ... The boot selection failed because a required device is inaccessible"

    I tried restoring the original Sysprep directory and just using the default Sysprep capture options and default restore options.

    Also tried using my customised xml.

    Seems when using the Sysprep options to capture the image this is the result.

    Am just searching for this error in the forums now.

     

    Cheers,



  • 17.  RE: How to get computername token into unattend.xml

    Trusted Advisor
    Posted Sep 29, 2010 07:35 AM

    Hi dsr,

    Any luck on this one?

    Kind Regards,
    Ian./



  • 18.  RE: How to get computername token into unattend.xml

    Posted Sep 30, 2010 03:59 AM

    Hi,

    It sort of works I guess... just no where near how I have our XP images working.

     

    I found my self re installing 100x so I started again in vmware so I can just rollback if I want to capture again.

    First issue is still the computer name is not working how it does with XP.  For XP I plug a new PC in, press F8 for pxe boot, the computer adds to the console then I rclick and rename and this is the name it uses for imaging.

    It appears my win7 install is using the the computer name listed under the config settings for the computer but i want it to use the value where I rclick and rename the computer instead of doing the configure.

    Second issue now seems to be domain joining.  If I remove the PC from deployment console and re add it, it is not joined to the domain.  But if I connect it all then just re-image it the computer seems to be joined to the domain correctly.

    So I think it is in fact working but it is behaving differently to what I am familiar with?  If I can iron out these two issue I think I will be close to having this sorted.


    Cheers.



  • 19.  RE: How to get computername token into unattend.xml

    Posted Oct 13, 2010 12:23 AM

    Hi,

     

    I still have an issue with the computer name, I beleive it related to the CFG files in the temp directory.

    With Win7, upon dropping the image on the computer a cfg file is created.  From what I can tell the values in the cfg file are injected into the unattend.xml which is then copied to the prod system.


    The cfg file seems to have the serial number placed in the COMPUTER NAME field.  I need to work out how to get this file take the value I give it my r-clicking and renaming the computer.

    Is there a template that can be edited for these cfg files?

    Cheers,



  • 20.  RE: How to get computername token into unattend.xml

    Posted Nov 15, 2010 07:08 AM

    DSR,

     

     If you pay close attention to the Temp folder upon the delievery of your image to the target machine, the %ID%.xml is generated under the Temp folder , but for some reason it gets deleted once the copy process is over by Altiris and %ID%.cfg remains, this happens too quick (less than 5 sec).

     Am using DS6.9 SP4 , SQL 2008