ecmastrean

Ensign
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-08-06
20:53
1029 views
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
$ZISNAME= $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?
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
$ZISNAME= $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?
2 Replies
CRAIGDWILSON

Micro Focus Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-08-07
13:19
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.
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!
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!
ecmastrean

Ensign
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-08-16
19:02
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.
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.