WinPE Image Safe Data Rewrite After Boot

We are using ZENworks 2017 Update 2a and I am rewriting the imaging script from Linux to Powershell so we can take advantage of WinPE imaging. I am able to set the following values (blue font) in image safe data then apply the image:
Write-Host "Computer Name: $ZISNAME"
Write-Host ""
$WSNAME = Read-Host -Prompt "Change Name (Enter Name to change,press Enter to keep existing)"
Get-Variable WSNAME -ValueOnly
if ($WSNAME)
Write-Host "Name Changed to $WSNAME"
Write-Host ""
zisedit ScriptedImage=True
zisedit ComputerName=$WSNAME
zisedit dnsHostname=$WSNAME


After the image is copied to the hard drive but before the imaging script exits I check $ZISNAME and the value is set correctly. Without allowing the computer to boot into Windows to run sysprep, I can restart the computer and boot into WinPE maintenance mode and the values for the ComputerName, and dnsHostname are set correctly. So I know the script writes the values and they are stored in image safe data. When the computer boots and sysprep starts, the computer gets a name of USER-XXXXX. This is the same behavior as the Linux imaging environment. However with WinPE, after sysprep completes, the name USER-XXXXX is written to image safe data and that is also the name of the computer. With Liniux, when the computer would reboot after sysprep, it would get the computer name set in image safe data. For example with Lunix, if the name was set to 12345-LT in image safe data then after sysprep the computer name would be 12345-LT. With WinPE the name is USER-XXXXX after sysprep.

Has anyone else had this issue or know how to correct it?
Labels (1)
Tags (4)
2 Replies
Micro Focus Expert
Micro Focus Expert

Sounds as if JustImaged <> True....

When True....The ZISD Service will restore the data from the ZISD to the PC.
When False...The ZISD Service will update the ZISD from the PC.
Please give a hearty thumbs up to any post you find helpful!
To find articles by Craig Wilson simply follow the link: Craig Wilson's Tips!

Thanks Craig, once I added JustImaged= True the name set in image safe data applied to the computer.

Some of our computers use static IP's so the "Uses DHCP" is set to "No" and the IP, netmask and default gateway were populated in image safe data. So I imaged a computer using WinPE and then set it to a static IP, ran zac ref bypasscache, restarted a few times and ran an inventory scan. ISD is still showing "Uses DHCP" is set to "Yes" and none of the IP information is populated. Does it take a while for this information to get copied to ISD or do I need to run a command to update ISD? This information automatically was populated when using Linux to image so I wanted to see if it was the same behavior with WinPE.
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.