@tom: Thank you for your answer. Below you find parts of my postdownload-scripts.
@George: Thank you also. I use curl request for checking the installation (for security - I have modified some values for this post).
Example:http://{$fogip}/fog/service/computerinfo.php?mac=b0:0c:d1:53:e2:7b
hostdesc="b00cd153e27b"
imageosid="9"
imagepath="IMG_NAME"
hostusead="1"
hostaddomain="DOMAIN"
hostadou="OU"
hostaduser="AUTOLOGON_USER"
hostadpass="AUTOLOGON_PASS"
hostproductkey=""
primaryuser=""
othertag=""
othertag1=""
sysman="HP"
sysproduct="HP EliteDesk 800 G4 DM 35W"
sysserial="8CC9033P2X"
mbman="HP"
mbserial="PGVXV0D8JBTTZG"
mbasset=""
mbproductname="83E2"
caseman="HP"
caseserial="8CC9033P2X"
caseasset="8CC9033P2X"
First - I need the $osid, because Driverpacks are different in Windows Builds:
As an example for HP-Driverpacks see: http://ftp.hp.com/pub/caps-softpaq/cmit/HP_Driverpack_Matrix_x64.html
The Packs are different for each Windows-Build on such devices … with no declaration, I have to copy all Drivers (that costs much time! ) and have to seperate it in the FirstLogonCommand-Script.
#Get Informations from Hardware
BiosVersion=`dmidecode -s bios-version`
Manufacturer=`dmidecode -s system-manufacturer | sed 's/ /./g'`
ComputerType=`dmidecode -s system-product-name | sed 's/ /./g'`
SerialNumber=`dmidecode -s system-serial-number | sed 's/ /./g'`
BiosDate=`dmidecode -s bios-release-date`
# Copy Device-Drivers to force-install with pnputil - the image has always the newest drivers:
rsync -a --delete --exclude='@eaDir' /images/Drivers/$Manufacturer/$ComputerType/$osid/* /ntfs/Tools/Drivers > /dev/null 2>&1
#Copy newest Bios-Release:
rsync -a --delete --exclude='@eaDir' /images/BIOS/$Manufacturer/$ComputerType/* /ntfs/Tools/Bios > /dev/null 2>&1
#Copy Hotfixes for Windows Builds and install it with Powershell to have the newest hotfixes:
rsync -a --delete --exclude='@eaDir' /images/Hotfixes/$osid /ntfs/Tools/Hotfixes > /dev/null 2>&1
#Copy the SXS Folder of the Windows Build:
rsync -a --delete --exclude='@eaDir' /images/SXS/$osid/* /ntfs/Tools > /dev/null 2>&1
Also I need it for the KMS-Key in the unattend - an example for you, how I will do it:
# Update unattend
if [ $adon = 1 ]
then
unattend=/ntfs/Windows/Panther/Unattend/unattend.xml
cp /images/unattend.xml $unattend > /dev/null 2>&1
# KMS Keys: https://docs.microsoft.com/en-us/windows-server/get-started/kmsclientkeys
KMSKEY_LTSB:DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ
KMSKEY_LTSC:M7XTQ-FN8P6-TTKYV-9D4CC-J462D
KMSKEY_W10:NPPR9-FWDCX-D2C8J-H872K-2YT43
IF [[ $osid -eq 10 ]]; then kmskey=$KMSKEY_W10 fi
IF [[ $osid -eq 101 ]]; then kmskey=$KMSKEY_LTSB fi
IF [[ $osid -eq 102 ]]; then kmskey=$KMSKEY_LTSC fi
dots "Set KMS-KEY in unattend.xml"
sed -i \
-e "/ProductKey/s/*/$kmskey/g" $unattend >/dev/null 2>&1
if [[ ! $? -eq 0 ]]; then
echo "Failed"
handleError "Failed to update unattend file"
fi
echo "done"
fi
Without KMS-Key Defination in unattend, I have to activate Windows in the FirstLogonCommand, that costs also more time or have to define it for each $imgid (If new images will added, the script has to be update).
I know, Hotfixes and Drivers should be in the image, but we use more than 30 Images! The problem today is, that many vendors update the drivers once a quater (with microsoft updates).