Cool Solutions

ZCM Adaptive Agent Deployment Script Wizard



By:

September 24, 2010 3:31 pm

Reads: 25

Comments:39

License:
Free

Download ZCMScriptWizard_1.7-20-2009

Problems with deploying the ZENworks Configuration Management Adaptive Agent?

This script wizard was designed to build a script that can be used to successfully deploy the ZCM Adaptive Agent in most situations when a standard deployment would probably fail. When an agent deployment fails, it normally causes IT over head to visit the workstation that failed to determine the cause of the failure and to manually install the agent. This script will help minimize visits to those workstation to perform a ZCM deployment.

Problems Encountered When Deploying Adaptive Agent:

  1. Simple File Sharing is enabled. In a new ZENworks environment with no Active Directory, IT would need to visit every workstation to disable Simple File Sharing to allow the ZCM server to deploy the agent to the workstation. In an existing ZENworks environment, a Group Policy would be needed (or application object) to make this change to the workstations. This means you must first wait for this change to deploy to your workstations before you can begin the Adaptive Agent deployment.
  2. ZENworks Asset Management and/or ZENworks Patch Management are installed onto a workstation as well as the ZfD agent. The ZCM Adaptive Agent will remove the ZfD agent, but it does not remove the ZAM or ZPM agents from the workstation. In environments that currently use ZfD, an application object is required to perform this installation. This also requires coordination of the agent removals prior to the ZCM Adaptive Agent deployment.
  3. Not all workstations are connected to the network when a deployment is initiated from ZCM causing IT to constantly check inventory to confirm they have gotten the agent deployed to all workstations. So if a user’s workstation is not on when the agent is deployed initially, that workstation will not get the agent when the user returns to work thus causing IT to constantly perform a discovery over a long period (typically a month) to find those workstations and get the agent deployed.
  4. Sometimes an environment can just be in chaos, some workstations’ users will have the proper rights to do the agent removals and install, others won’t. Over time, local admin passwords can be different and not documented, so IT is unsure what the password is for a particular workstation.
  5. In early versions of ZCM, the updating to the current version of the Adaptive Agent on workstation does not deploy to all workstation.
  6. A deployment of ZCM was done with out removing ZAM or ZPM leaving those agents installed and running. This causes two inventory scanners and/or two patch management scanners to run on the workstation. The fix? Uninstall the old agent and the ZCM Adaptive Agent and reinstall the Adaptive Agent.

This script wizard solves all of these problems. The script that is built is intended to run from with in a network login script. So you can be assured that if the user logs into your network, they will more than likely be running your network login script. Since it runs from the logins script the problem with Simple File Sharing do not exist. The automated removal of the previous ZENworks agents (ZfD, ZAM, ZPM) will ensure the workstation is properly prepped before the ZCM Adaptive Agent is installed with out having to coordinate the removal. This means that IT does not have to wait for the completed processing of an application object to get started on the ZCM Adaptive Agent deployment. Users whose workstations are not turned on at the time the deployment is started will get the agent the next time they log into the network. No monitoring of the network discovery needed. The script can be built with administrator credentials to install on the workstations with users who do not have local administrator rights. The script performs version checking to ensure that the workstation has the specified version installed, if it does not, it will install it. The script that is built can also remove and reinstall the ZCM agent if needed.

Currently available features in the ZCM Script Wizard:

  • The ability to enable or disable prompting of the user before beginning either the install of the uninstall.
  • The ability to enable or disable messages on the workstation showing the progress of the script.
  • Independent removal of the ZENworks For Desktops agent
  • Independent removal of the ZENworks Asset Management agent
  • Independent removal of the ZENworks Patch Management agent
  • Prompt user for reboot or do not prompt user for reboot or suppress reboot.
  • Deployment of the ZCM Adaptive Agent
  • Removal of the ZCM Adaptive Agent
  • Reinstallation of the ZCM Adaptive Agent
  • Installation of the ZCM Adaptive Agent using a registration key
  • The ability to remove or install software as a different user
  • Local administrator password detection
  • Auto Login functionality to automate beginning to end
  • Error reporting to either a log file or a Syslog server
  • Customization of messages presented to users.
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)


Categories: Uncategorized

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

39 Comments

  1. By:geoffc

    I have not tried it yet, but reading through the docs, looks very nice!

    Well done! Thanks for contributing such a useful tool!

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  2. By:seancane

    I just used it at a client site, and it was exactly as advertised. Really easy to use, and fixed a major problem I have been having.

    Thanks for putting in the time. Simple, but really powerful.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  3. By:shanedriggs

    We are about to do this and this is going to make life some much better.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  4. By:Provogeek

    The interface was given an over haul and a few options were moved around to more appropriate places with in the tool. This version of the script was just used to deploy to 220 workstations in a single day a couple weeks ago.

    Two new features added to this version is AutoLogin and Password Discovery.

    When the script removed old ZENworks agents from the PC, it can set the AutoLogin feature that will log the PC into automatically to begin the ZCM Agent install. Once the ZCM agent is installed, the AutoLogin is disabled.

    One of the situations I have run into in the past when a network does not employ Active Directory so users login in with local credentials, is that the local administrator password is not always the same. So the script can take 10 passwords you provide and test each one to figure out which one is the correct password.

    I have also added a couple requests made by the community. Like reboot suppression, message preview, prompt on install, and disabling of the OS checking.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  5. By:frichi

    We trying to run this utility, but we receive the error “Line -1 Error: Variable used without being declared”

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  6. By:Provogeek

    Seem the problem is a typo in the Authentication function. When I merged the customized script from my last deployment, there were some changes to the variable names used, I’ll get this fixed and tested in the next couple of days.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  7. By:egarcia

    It doesn’t seem to autologin after removing the ZfD agent. How do you set the autologin feature?

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • By:Provogeek

      There was a bug in the previous update that was related to the AutoLogin function. This has been fixed and an update was posted today.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
  8. By:Provogeek

    The tool has been updated today, you can download it at http://www.novell.com/communities/files/ZCMScriptWizard_1.0_08-03-2009.zip

    The problem folks were encountering was due to an issue in the base script. A customer request had me add the auto login function earlier than I had planned. So as to not mess up my code base, I used a customized branch for this customer. Well, not being a full time programmer and not having much of a method for tracking code changes, I goofed up when I merged the new functions into the script. There were changes in the names of variables, and I did not update those changes properly in the public code. So I have been spending the past week sifting through the code and making sure all the variable names match up and have been running various tests to ensure I post a working script this time.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  9. By:egarcia

    I just downloaded the new version. I’m getting this error when I build the script:

    Aut2Exe error

    Error changing icon: Unable to read icon or icon was of the wrong format.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  10. By:Provogeek

    Sounds like you downloaded a previous version, to get around this error you will need to delete the directory I use for script building. The directory is located in %USERPROFILE%\Application Data\ and is named ZScptWiz . Delete this whole directory and try building a script again.

    The reason this is happening, is that the EULA portion of the script only runs if it does not find the EULA text files, doesn’t look for any other file. If it finds the EULA text files, then it skips the EULA pop up windows and proceeds to the script, since it is assumed you have seen and read the EULAs already. If the script does not find the EULA text files, it will then present you with the AutoIT EULA and the KIS EULA. Once accepted, the AutoIT and the needed support files are extracted from the distribution executable. This is the only place the support files are extracted. So if you have already seen and accepted the EULA, the files are not being extracted.

    I made a minor change in the current version, and that was adding and icon graphic to the compiled script. Wanted to have something other than the default AutoIT icon. That icon file was not in the previous version. So since a previous version was run on your PC, and the script finds the EULA text files, the ico file being used when compiling is not being extracted.

    Thank you for the heads up on this, didn’t think about this problem in my testing. I’ll code in additional checks to ensure needed files are in place and are correct version in the next rev of the tool.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  11. By:Lesnikovr

    When I executed a script I received an error “Unable to remove ZENworks application ZENworks Remote Management” in a log file.
    After that uninstallation of the agent was aborted. What can I do to correct this?

    When I tried to install the agent using this script on a computer with no agent – the scirpt was not executed. I don’t understand why. Please help. The computers are in a domain, the user is an admin on that macine.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • By:Provogeek

      It sounds like the removal you are attempting is the removal of the ZCM agent, not the ZfD agents. I have recognized there to be some problems with 10.1 and 10.2 and I am currently working on getting the removal to be compatible with these versions (ZCM forums has a solution for a >BAT file execution I have not yet had the time to incorporate into my script). The current removal routine was built and tested with 10.0 only.

      On the installation problem, are any errors produced in the log file?
      Are you using the same script to install the agent on a clean PC as the one you are doing the uninstall? In order to install on a clean PC, you would need to compile a different script. Using a single script to cover both workstations you want to replace the agent and workstations you want to install new currently will not work. When a script that is setup to do a removal runs on a PC that does not have the agent, it will simply abort since it finds nothing to do and will never set the registry key needed to move to the install of the agent.

      When a script is built to do an install only, the script looks to see that no removals were chosen and auto sets the Track value to what is needed to do the install.

      Also, you can look in HKLM\Software\Novell\Distro for the key named Track. if the value is set to 1, the agent should be installed, if it is set to 2, the install will abort thinking the install already completed.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
  12. By:Lesnikovr

    Please, continue work with improving removal process for 10.1 and 10.2 agents!

    When the script aborted in my situation no errors was written to log file. Now I made the script to work and today have some wishes.

    I would like the script to save configuration settings for future use it.

    My situation is the following. I deployed the agents to workstations and then embedded database crashed. I had to re-install sever to another platform with external database and the problem was how to re-assign the workstations to a new server remotely. I wanted to unregister, update ceritificates and then register the workstations but using NDS login script without admin rights failed. Now I’m testing your solution and I hope it will help me to solve the problem/

    And the last question: If the agent already exists on the machine and assigned to the new server does the script remove and re-install it? How can I make it to uninstall only ZCM Agent on those workstations which assigned to old sever with wrong certificate and IP-address?

    Thank you for your answers

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  13. By:dpogue

    Hi, I was just curious if anyone has got this to work with 10.2 yet. We have a similar situation as above, where our server crashed and the database blew up. We’re reinstalling, but manually reinstalling on 4000 machines just is taking forever. I really like what this tool has to offer, I just am unable to get it to work with 10.2. It uninstalls everything but leaves the ZEN Pre Agent service, which then hangs the re-install of the agent.

    Thanks for your efforts.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  14. By:Provogeek

    I had some time today to address the uninstall function of my script. Since none of the MSI uninstalls remove the pre-agent, I simply remove the service after uninstall (similar to the BAT file found in the Novell forums). So the uninstall works now as expected. An update to the script has been tested to verify the uninstall/reinstall function works.

    I do need to note however, that the intention of the uninstall/reinstall routine were built for two reasons. First being the undesirable event of removing ZCM from a network with out the intention of putting it back. The second being an agent that was not install properly or had a failed install that a normal add/remove could not correct.

    The script should not be used for the purpose of changing a workstation’s zone (even thought it technically can be used this way). The process of adding a workstation to a new zone in the event of a zones primary CA server crashing should be done using the zac tools that come with the agent. TID 7000620 has excellent instructions on how to move a workstation to a new zone. The reason I suggest people use the method in the TID is that it takes 10 seconds, no reboot on the workstation, no interruption of the user (must be done in login script). Using my deployment script to accomplish this will take 15 – 30min and require a reboot.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  15. By:chrisflure

    Provogeek,

    You just saved me from pulling my last hair out! I have been trying to get my agent updated in my XP image from 10.2.0.25097 to 10.3.0.27649 for over a week now! If anyone has question if it will work for 10.2 it did a nice job. Basically after the image deploys I have two auto logins to the workstation. The first login deploys all of my OEM installs and then runs your agent script “ZCMagent.exe” to remove the old agent and reboot. Second auto login it runs your “ZCMagent.exe” script and installs the new 10.3 agent, then a reboot! Lastly I get my Novell login screen and it registers very nice in my zone and the world is a better place! :)

    The only little quirk is that on my first auto login and your “ZCMagent.exe” removes the old agent, before it reboot it gives me a dialog box that states “Mode Switch needs to be 0,1 or 2 or 3″; It’s not a game stopper, I just hit ok and it reboots. Any Idea how I change the mode since this is a compiled script?

    Anyway, very nice job!

    Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  16. By:chrisflure

    Provogeek,

    Ok, on my last comment disregard, I can now see how to edit the script. Do you know what line I need to change?

    Thanks!

    Chris

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  17. By:metheridge

    Provogeek,

    Many thanks for a great utility. However, it currently only checks the version key under [HKLM\Software\Novell\ZENworks] to see if the agent is already installed. The latest 10.3.x agents now create their registry keys under [HKLM\Software\Novell\ZCM]. Are there plans to update the utility to handle this change?

    Thanks,
    Martin

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • By:Provogeek

      In the middle of a couple of ZCM deployments, I will be posting an update to the script in the next few weeks to support the changes Novell made to the agent.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
  18. By:Provogeek

    In this update, I have added the needed support for ZCM 10.3.x as well as support for Windows 7

    As metheridge pointed out, Novell changed the registry keys of the ZCM agent. I am now looking at the appropriate key for the agent version information. Do not, I did not make this backwards compatible. So if your working with pre ZCM 10.3 agents, this script will have problems and you will need to change the base script back to the previous registry path .

    Windows 7 want to run the install script as an administrator, so the new AutoIT option to run as admin was enabled with in the script.

    The AutoIT engine and compiler has also been updated from 3.3.0 to 3.3.6.1 to allow for better Windows 7 support.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  19. By:metheridge

    Thanks Provogeek. This latest update is much appreciated.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  20. By:rcore

    Is there a copy of your script tool that references [HKLM\Software\Novell\ZENworks]? I see where to download the latest script but where I can I find an older one?

    Thanks Rob C

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • By:Provogeek

      in the about of the tool, you will find my email address. Send me an email and I will send you a copy of the last version. Just keep in mind, it does not work on Windows 7

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
  21. By:liliass

    Hi,

    This is an awesome script. However, does it script works for ZCM11 ?

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  22. By:ClemClark

    Hi,

    Can you post the original AutoIt source code you have used for this?
    Would be very handy to see certain functions you have used…

    Thanks.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • By:Provogeek

      To view and edit the sourced code for the deployment script, you would fist need to make a script for the base.au3 to be extracted from the GUI interface. You will find the base script in:

      WinXP
      %USERPROFILE%\Application Data\ZScptWiz

      Win7
      %USERPROFILE%\AppData\Roaming\ZScptWiz

      Do note, when you edit the base.au3 script, you will not have GUI control over the script anymore (and the base will get copied over the top of the original).

      I have no plans on releasing the source code for the GUI it’s self.

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
  23. By:maphinne

    Hello Provogeek,

    Awesome script, we have been deploying the Zen 11 agent with it very easy to use… but we have a small issue.

    We attempted to change the default message that appears when installing the Zen 11 adaptive agent and buil the script…
    but when we run the script the default message still appear and not the message we typed and built into the script… Any thoughts?

    Cheers and thanks

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  24. By:rajatkheria

    I am getting this error on Win 7. I am tryint to deploy Adaptice agent for Zenworks 11

    Administrator – Unable to install ZENworks application ZCM Install as a local user

    I am running the exe generated by tool from a Administrator account.

    Please help

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • By:Provogeek

      Script was written for XP deployments, not Win7 deployments. None of the ZCM deployments I have done have been to existing Win7 machines, so I have never taken the time to enable support for Win7. Currently I have only deployed ZCM to Win7 has part of the image pushed to the workstations.

      I am in the middle of writing up a new version of the script to distinguish between WinXP and Win7 and leverage the differences in the commands used to run the agent install. Since I am also adding a few new features people have asked for, and it has also been a pretty busy summer, I may not have something until late September.

      I have had some success using the script to deploy to Win7 at some small accounts. What I have seen is the little pop-up that wants you to confirm running the install. It does not always show it’s self very well and may just be a minimized pop up. You may also want to confirm proper file access to the agent installation files. Also, keep in mind that using the Administrator login functions in the script will not work. Right now the RunAs command does not pass through properly, and the use of the AutoLogin feature is 100% incompatible with Win7 (mostly because the Run registry key entry used in the process works only as the Administrator, not as any other user in Win7 … it’s a nifty feature of the OS).

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      • By:CraigArchie

        Provogeek dude, that is one awesome script. It must’ve taken you ages to write it. We also use AutoIT to script the auto installation of software (including our ZFDagent 6.5) but no where near the scale that you’ve done.

        Anyway, I wanted to know how your latest script wizard with support for Windows 7 was coming along. We are testing ZEN 11 SP1a and at the moment, deploying the agent is proving to be an absolute nightmare. Will your new script builder support the ZEN 11 agent?

        VN:F [1.9.22_1171]
        Rating: 0.0/5 (0 votes cast)
      • By:Provogeek

        The update is still a work in progree. I have had reports of success using the script when you disable the OS checking feature on win7. But you also have to run it as an admin.

        VN:F [1.9.22_1171]
        Rating: 0.0/5 (0 votes cast)
  25. By:andystewartSL

    You could try my scripted solution for Win 7 imaging, ZCM installation etc.

    http://www.novell.com/communities/node/12320/windows-7-automated-imaging-and-zcm-registration

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
  26. By:tjacksonbcg

    Any idea why I would be getting the Windows Run As prompt when launching the compiled executable on XP SP3 as a user? I specified correct non-domain admin credentials in the script builder.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)

Comment

RSS