Quantcast
Channel: Ivanti User Community : All Content - OS Deployment and Provisioning
Viewing all articles
Browse latest Browse all 1803

[UTILITY][OCT-26-2012] CompName.exe - Replace ComputerName in Unattend XML

$
0
0

In response to this Community thread, I have created a tool that will modify the ComputerName value in a Sysprep Unattend XML file after being injected during WinPE Provisioning.

 

The purpose of this tool is to eliminate the need to chose between automatic and manual computer naming when injecting an Unattend XML.

 

Syntax:

 

CompName.exe N "C:\Path\To\YourUnattend.xml"

 

The first command line argument is the number of seconds to wait before the tool exits and makes no modifications to the Unattend XML.

The second argument is the path to the Unattend XML you wish to modify.  You must wrap this string in quotes, even if there are no spaces in the pathname.

Both arguments are mandatory or the tool will default to 300 seconds and "C:\Unattend.xml"

 

Use:

In a Provisioning template, make a new Action of the type "Execute File" and have it execute CompName.exe.  Supply the number of seconds and the path to the newly injected XML as the command parameters.

Place this action directly after the existing Inject Script action in your template (or any other point after the Inject Script action, but before the system boots to the new image)

 

** In the ZIP file there is a _Demonstrate.bat that runs the tool against a sample Unattend XML file so you can try it out before putting it into LANDesk.

 

Warranty:

None

 

How it works:

 

1 - In WinPE, a Provisioning action launches the tool and waits a configurable number of seconds before moving on.

count.jpg

 

2 - Supply a computer name

newname.jpg

3 - Script checks the hostname length and illegal characters

err.jpg

4 - Once validated, script displays old name and new name.

confirm.jpg

Unattend XML before:

xmlb4.jpg

success.jpg

Unattend XML after!

xmlaftr.jpg

 

 

Application exit codes:

0Success
2System cannot find the file specified (Specified Unattend XML does not exist)
13The data is invalid (Failed to update Unattend XML)
1223The operation was canceled by the user
10022An invalid argument was supplied (Command line arguments missing or syntax error)

 

 

 

I look forward to your feedback!

Thanks,

Jesse McCoppin


Viewing all articles
Browse latest Browse all 1803

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>