I am trying to add a step to my existing ZENworks imaging script that will prompt for the desired workstation name before the imaging process begins. This will only occur on new workstation installations where there is no image-safe data to pull the name from. The prompt is successfully retrieving the name from input, and I can write it to the image-safe data and read it back successfully. However, when my image is copied to the machine and the machine reboots, it appears that ziswin never triggers to read and restore the workstation name from image-safe data.

If, however, I run my imaging script on an existing workstation with image-safe data intact, ziswin launches normally and restores the workstation name and other data.

My image was made with sysprep, so it undergoes a mini-setup prior to coming up. Mini-setup assigns the workstation a temporary name, and initially I thought this was preventing the name in ISD from being restored, or overwriting it, but I verified that ZEN restores the name correctly on workstations that already have full ISD intact.

I used this article as a basis for my own workstation prompt, with some adjustments to the zisedit commands since "Name" is not a valid argument anymore:
Cool Solutions: Scripted ZENworks Imaging

Here is the relevant part of my script:
MACHINENAME=`zisview DNSHostname`

if [ "$MACHINENAME" = "" ]; then
	echo "This machine appears to be new, or its name cannot be recovered."
	while test ! $WSNAME; do
		echo -n "Please enter the desired workstation name: ";
		read WSNAME;
	zisedit DNSHostname=$WSNAME
I have tried also setting the "ComputerName" field to $WSNAME and setting the Just Imaged flag to true right before rebooting, but neither seem to work. Also, I tried wiping out the area of the disk that ISD is stored by following this article, but it had no effect on my problem:

Are there other fields I need to set before ziswin will kick in and read/restore from ISD? I would prefer to avoid resorting to using compname in a login script if possible.