Highlighted
Absent Member.
Absent Member.
2109 views

Preboot bundle & Windows 7 / 10 UEFI - Imaging script

Hi, I’m in the process of creating a preboot bundle for a Windows, 7 to begin then 10, in UEFI. Right now we are deploying our BIOS images by using the info in this link ZCM imaging megapost – part 6 (PXE boot menu). That said, in a preboot bundle is it possible to ask questions to the user using the action "Imaging Script"? By questions, I mean what is the workstation name for example. In addition, can I use bash to do it like I did before? By the way, right now we are running ZENworks 2017 Update 1. Would it be better to update to update 2 before doing anything else? Or update 3, when it comes out, maybe. On the other hand, maybe we should switch to an MDT deployment. Anyone got any suggestions on the matter?

Thanks in advance for the help!
Guillaume
Labels (1)
0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Preboot bundle & Windows 7 / 10 UEFI - Imaging script

In regards to Updates....

Update 2...Contains Significant Imaging Updates...
(Note: Update 3 is not expected to have Significant changes...those are in update 2...but tweaks are coming down the line...)
It now allows for "Native" ZCM Imaging and Native ZCM Imaging Commands to work via WinPE.
Instead of "Bash" Scripts....it would be necessary to use some form of Windows Scripts that are available in WinPE.

Some of the Key advantages here are faster and better Hardware Support.
In the long run....scripting may be easier for many...since most are more likely to be comfortable with Windows scripting....as part of their regular duties of managing desktops.


In regards to UEFI vs BIOS......The Scripting and Imaging process does not really change.




GuillaumeBDEB;2480913 wrote:
Hi, I’m in the process of creating a preboot bundle for a Windows, 7 to begin then 10, in UEFI. Right now we are deploying our BIOS images by using the info in this link ZCM imaging megapost – part 6 (PXE boot menu). That said, in a preboot bundle is it possible to ask questions to the user using the action "Imaging Script"? By questions, I mean what is the workstation name for example. In addition, can I use bash to do it like I did before? By the way, right now we are running ZENworks 2017 Update 1. Would it be better to update to update 2 before doing anything else? Or update 3, when it comes out, maybe. On the other hand, maybe we should switch to an MDT deployment. Anyone got any suggestions on the matter?

Thanks in advance for the help!
Guillaume
--
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!
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Preboot bundle & Windows 7 / 10 UEFI - Imaging script

CRAIGDWILSON;2480938 wrote:
In regards to Updates....

Update 2...Contains Significant Imaging Updates...
(Note: Update 3 is not expected to have Significant changes...those are in update 2...but tweaks are coming down the line...)
It now allows for "Native" ZCM Imaging and Native ZCM Imaging Commands to work via WinPE.
Instead of "Bash" Scripts....it would be necessary to use some form of Windows Scripts that are available in WinPE.

Some of the Key advantages here are faster and better Hardware Support.
In the long run....scripting may be easier for many...since most are more likely to be comfortable with Windows scripting....as part of their regular duties of managing desktops.


In regards to UEFI vs BIOS......The Scripting and Imaging process does not really change.


Hi Craig, first of all thanks for the info. That said I'm in the process of creating a "preboot bundle". My first step was to include an action to launch a bash script (Imaging Script). Now, when I test my script I only get a reboot on ZENworks in the PXE and I get a popup "Advanced Script work to do (/bin/zenAdvancedScript)" when I boot in ZENworks Maintenance Mode. Which is weird because this use to work when we were still with ZENworks 11. Here's my script.


#####################################################################
## CONFIGURATION

DEBUG=1

#####################################################################
# DEFINE COLOURS TO BE USED FOR SCRIPT ECHO COMMANDS
RED='\e[0;31m'
YELLOW='\e[1;33m'
NC='\e[0m'

#####################################################################
## FUNCTION

function EnterWorkstationName
{
echo
echo -e -n "${NC}Please enter the workstation name: "
read ZISNAME
}

# This function ask the user to confirm that he has entered a valid computer name before continuing with the imaging process.
# If the user say no the function EnterWorkstationName is then called.
function ConfirmWorkstationName
{
while true; do
if ( [ -z $ZISNAME ] || [ "$confirm" != "y" ] ) then
set ZISNAME=$ZISNAME | tr '[:upper:]' '[:lower:]'
echo -e "${YELLOW}The computer name is" $ZISNAME ${NC}
echo
read -s -n1 -p "Is this correct? (y/n)" confirm
echo
if [ "$confirm" = "n" ]; then
EnterWorkstationName
echo
elif [ $confirm = "y" ]; then
break
fi
fi
done
}

function DisplayTitle
{
echo -e "${RED} _ _ _ _ "
echo -e "${RED}| \ | | | | |"
echo -e "${RED}| \| | _____ _____| | |"
echo -e "${RED}| |/ _ \ \ / / _ \ | |"
echo -e "${RED} |\ | (_) \ V / __/ | |"
echo -e "${RED}|_| \_|\___/ \_/ \___|_|_|"
echo
echo -e "${NC} ZENWorks Imaging"
echo ""
echo -e "${NC}*********************************************"
echo -e "${NC}Active ZCM imaging proxy address is" $PROXYADDR
echo -e "${NC}*********************************************"
echo

ComputerProductName

echo -e "${YELLOW}This machine has been detected as a" $PRODUCT
echo
}

####################################################################
####################################################################
####################################################################

# This will reset the screen.
echo -en "\033c"

DisplayTitle

# Verification if the computer name is available in the ISD sector.
# If it is then the user is asked to confirm it or modify it and the confirm it.
ZISNAME=$(zisview ComputerName)
if test ! $ZISNAME; then
echo -e "${NC}No image-safe data found."
echo -e "${NC}Assumed to be a new workstation.\n"
while test ! $ZISNAME; do
EnterWorkstationName
done
ConfirmWorkstationName
else
ConfirmWorkstationName
fi

# The ZENworks ISD sector is then written with the new information.
zisedit -r
set ZISNAME=$ZISNAME | tr '[:upper:]' '[:lower:]'
zisedit ComputerName=$ZISNAME
zisedit WorkG="WORKGROUP"
zisedit DH="True"

echo
echo -e "${YELLOW}The validation of the identity and properties of the computer is now complete.${NC}"
echo


I know that this script works when booting in PXE but I'm not sure if this can work in a preboot bundle. Can it?

Thanks again for the help!
Guillaume
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Preboot bundle & Windows 7 / 10 UEFI - Imaging script

Were you able to get this to work?

I would like to be able to prompt our techs for computer name during the imaging process as well.
0 Likes
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.