ZCM 11 imaging megapost – part 4 (ZCM Agent)
April 16, 2013 2 Comments
a) avoids having to update the base image when a new version comes out
b) avoids any possibility of mistakes \ human error around clearing machine IDs etc
The commands to install the agent are quite simple but there’s a few extra tasks we need to do to make the process slick and painless (after all that’s the reason we’re scripting everything 😉 )
Disable Passive Login Mode Prompt
By default after the ZCM Agent is installed it will try to capture user authentication during login, this is fine and dandy if you’re logging in with a Novell \ Active Directory account but not so great if you’re running additional scripts during autoadminlogon.
As the autologon is basically a local admin account ZCM can’t find a user source and pops up a box asking for you to login, at which point your nice unattended install will stop… not good!
Fortunately you can disable this by setting a registry key…
Use this piece of script before the ZCM Agent installation (I put it beforehand as the Agent installer auto reboots after completion)
Md "HKLM:\SOFTWARE\Novell\ZCM" Md "HKLM:\SOFTWARE\Novell\ZCM\ZenLgn\" New-ItemProperty "HKLM:\SOFTWARE\Novell\ZCM\ZenLgn\" -Name "DisablePassiveModeLoginPrompt" -Value 1 -PropertyType "DWord" -Force
The ZCM Agent differs from the Novell Client in that the installer runs more quietly and pops up balloon notifications in the system tray as it goes along. This is great for many situations but not so much so for our imaging process as it has the unfortunate side effect of showing the Windows desktop while the installer runs.
A user glancing at the machine could easily think imaging has finished and shut it down etc so I looked for a way to put a splash screen up in a similar way to the Novell client installer. There’s nothing out the box so I turned to my trusty HTA methods.
What I’ve ended up with is a full-screen HTA that runs before the ZCM Agent installer that can’t be closed by the user. You can still see the taskbar and as such the notifications of the Agent progress although the Start button still shows. If you’re really paranoid you could run a small AutoIT (or similar) file to lock the keyboard and mouse but I think in reality the HTA will do the trick.
While making the HTA I found a neat way of embedding images into them, use the base64 generator here http://webcodertools.com/imagetobase64converter
A generic version of the HTA I used is available on SkyDrive, open it up in Notepad to see how it avoids Alt+F4 and to add any additional text \ images
The Powershell code for the HTA and Agent installation is below, note my additional variable $RegistrationKey which I’ve used to dynamically generate keys for our workstations. If you don’t need it just remove it (and the -k switch) from AgentParams section.
As always note the path to the Agent installation folder and ensure it matches whatever you’re using in your add-on image
$HTACommand = "C:\Windows\System32\mshta.exe" $HTAParams = "C:\SETUP\ZCM_splash.hta" $process = [Diagnostics.Process]::Start($HTACommand,$HTAParams) # install ZCM Agent with registration key based on workgroup name $AgentCommand = "C:\SETUP\ZCM_Agent\PreAgentPkg_AgentCompleteDotNet.exe" $AgentParams = "-q -k",$RegistrationKey $process = [Diagnostics.Process]::Start($AgentCommand,$AgentParams) $process.WaitForExit()
I’ve used Registration Keys to get machines placed into groups for software installation later on as Dynamic Groups won’t update in real-time as the imaging process is proceeding.