Idea ID: 2786915

Update ZCM Agent Update or Bundle execution on shutdown

Status : Under Consideration
over 5 years ago
It would be very useful to schedule the ZCM-Agent update on System shutdown like Windows Update behavior.
So users work is not disturbed.
It would also be nice to start Bundles when PC is shutdown to perform updates or installations of Software.
  • I've made a workarround, so that the agent update is going to be installed on computers shutdown.

    1. Create a standalone update package.
    Source: "Command Line Utilities Reference" (zen_utils.pdf) Page 113
    In my case:

    zman sucp "ZENworks 2020 Update 1" -n="Windows 64" -p=Windows -a=64

     

    2. Create a bundle which copies the standalone update package to the computers local disk.
    Relationships: The Clients
    Installation Schedule: Device Boot
    Requirements: Registry Key Value
    \HKEY_LOCAL_MACHINE\SOFTWARE\Novell\ZCM
    Version
    String Type
    <>
    20.1.0.343
    Install: Copy File(s)
    [The standalone update package]

    So the standalone update package is being copied to the Computers local disk if the agent version is old.


    3. Create a batch file:

    @ECHO off REM ECHO SET REM SET ECHO IF EXIST "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64.exe" GOTO EXTRACT IF EXIST "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64.exe" GOTO EXTRACT EXIT :EXTRACT ECHO START "ZENworksaktualisierung" /MIN /WAIT "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64.exe" -n -d "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64" START "ZENworksaktualisierung" /MIN /WAIT "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64.exe" -n -d "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64" ECHO IF EXIST "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64\StandaloneUpdater.exe" GOTO INSTALL IF EXIST "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64\StandaloneUpdater.exe" GOTO INSTALL EXIT :INSTALL ECHO INSTALL ECHO START "" /MIN /B "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64\StandaloneUpdater.exe" START "" /MIN /B "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64\StandaloneUpdater.exe" :SCHLEIFE ECHO TIMEOUT /T 1 TIMEOUT /T 1 echo IF NOT EXIST "%ProgramFiles(x86)%\Novell\ZENworks\logs\system-update\5020010000fc50000000002020060300\update_needs_reboot" GOTO SCHLEIFE IF NOT EXIST "%ProgramFiles(x86)%\Novell\ZENworks\logs\system-update\5020010000fc50000000002020060300\update_needs_reboot" GOTO SCHLEIFE ECHO IF EXIST "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64.exe" DEL "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64.exe" IF EXIST "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64.exe" DEL "%_System-Service-Depot%\Novell\ZENworks-Agent\x86_64\20.1.0.343 windows 64.exe" ECHO TIMEOUT /T 1 TIMEOUT /T 1 EXIT

     

    Now I've configured a Group Policy Object.

    • to extend the wait time for Group Policy scripts
    • to execute the shutdown script visible
    • to start the shutdown script

    4. Configure the GPO:

    4.1 Computer Configuration\Administrative Templates\System\Scripts\Specify maximum wait time for Group Policy scripts
    1800 Seconds (default 600 Seconds)

    4.2 Computer Configuration\Administrative Templates\System\Scripts\Display instructions in logoff scripts as they run
    Enabled (default not configured > not visible)

    4.3 Computer Configuration\Windows Settings\Scripts (Startup/Shutdown)\Shutdown
    Add: enter the name of the batch file
    Show files: copy the batch file to the folder


    If the tests are successful, the script execution can be made invisible via GPO and / or the output can be designed for the user with other tools.


    I hope I haven't forgotten too much.
    And sorry for my poor english.

    Regards, Chris

  • We have many mobile users that expect the device to just shutdown.. say when boarding a plane. We would also request an cancel or postpone option for them.
  • We definitely agree. We recently published a cool solution on how to do this with Patch Management policies and we are trying to see if we can somehow productize the approach. The key issue is that MS does not currently provide a supported API, so we are having to get creative. More to come as it comes.
  • I would love to have an option to apply the agent update during a shutdown, but make it obvious that an update is occurring and to not turn off the computer. My agent updates would not take me a month to roll-out if this was available. Currently, I have to schedule and coordinate with various departments and agencies. Please, please, please implement this feature.
  • No. This won't work. Packages assigned with the event "User Logout" only run on User Logout. Not on shutdown. We've tried already and the documentation describes this behaviour, too. Currently there is no option to install a bundle on shutdown.