CA Client Automation

  • 1.  How do I add install records with sd_acmd for several computers?

    Posted Dec 19, 2013 05:54 AM

    The reason for adding install records is that I had to remove install information using the DSM Explorer to be able to access and unseal a software package.

    Now I thought that the following batch file would help me achieve my goal:

    @ECHO OFF
    SETLOCAL
    CLS
    SET LISTFILE=%1
    FOR /F "" %%i in (%LISTFILE%) do CALL :AddRecord %%i
    GOTO End

    :AddRecord
    ECHO %1
    sd_acmd AddInstallRecord `"Application`" `"1.3`" `"Check and install`" current current `"SYSTEM`" `"Added by script`" TARGET`=`"%1`"
    GOTO :EOF

    :End
    ENDLOCAL

    But sadly that produces only "<4> Internal Error" messages.

    The file provided to the script only contains host names (like 99W7NB12345) and trying to run the command manually (with or without backticks to escape the quotes and eqal sign) also provokes that message.

    I try to run this batch file on our domain manager with an account that is admin on the ITCM server. Is there anything that I'm missing? The documentation refers to a description of how to provide a target, but it differs from command to command. That leaves me a bit puzzled.

    Using ITCM 12.5.1000.767 here.

    Any suggestions/help would be very much appreciated.



  • 2.  RE: How do I add install records with sd_acmd for several computers?

    Posted Dec 30, 2013 06:50 AM

    Just an FYI, you can edit the underlying package without unsealing it if you remove the package option:

    • Checksum Control of Package Consistency

    In terms of your issue, please post your exact script and I'll test it.



  • 3.  RE: How do I add install records with sd_acmd for several computers?

    Posted Jan 07, 2014 09:33 AM

    Just tested it and it's the target parameter that's causing the issue (ps: you don't need the ' charcaters at all). You could get around this by dropping it and running the command using an AM job on the affected computers if you have the am agent. The help for sd_acmd states:

    • [target="targetname"]

      The parameter is optional. If a value is present, the command will run for the specified target. If no target is specified, the current context is default if a user agent is enabled on the target computer.
      The syntax of targetname is described in Formats.

    Can someone from CA comment on this? Perhaps this is being prevented by some ITCM policy on the DM ?



  • 4.  RE: How do I add install records with sd_acmd for several computers?

    Posted Jan 07, 2014 10:02 AM

    Thank you for the reply there.

    I hoped that I wouldn't need the escape characters, but I got a bit paranoid after I got the unclear error message. :-)

    The problem is that I basically want the database to be updated and some of those clients are offline for quite some time before they contact our servers again (standard systems are not allowed to use Internet connections). With a command that I can execute on the DM to update the data records the database would be corrected much more reliably and more quickly.

    If I knew the SQL to update the database with those pieces of information I would also resort to that if it works reliably and doesn't leave broken data links. :-)

    P. S.: The removal of the integrity checkbox is something I stopped doing after we encountered some replication issues without that tick there some time ago.



  • 5.  RE: How do I add install records with sd_acmd for several computers?

    Broadcom Employee
    Posted Jan 08, 2014 03:06 AM
    Shocko:

    Just tested it and it's the target parameter that's causing the issue (ps: you don't need the ' charcaters at all). You could get around this by dropping it and running the command using an AM job on the affected computers if you have the am agent. The help for sd_acmd states:

    • [target="targetname"]

      The parameter is optional. If a value is present, the command will run for the specified target. If no target is specified, the current context is default if a user agent is enabled on the target computer.
      The syntax of targetname is described in Formats.

    Can someone from CA comment on this? Perhaps this is being prevented by some ITCM policy on the DM ?


     

    The Target parameter is used to distinguish the agent type (computer, useragent, domain useragent) rather than a specific remote machine. It needs to be run on the machine it is intended for.

     



     



  • 6.  RE: How do I add install records with sd_acmd for several computers?

    Posted Jan 08, 2014 04:19 AM

    Well in that case, it makes sense. Documentation isn't that clear though. On other cli commands it would return a descriptive error like when the filter is incorrect when using the cadsmcmd command. Alas, I guess you'll have to run this command on the agent using a software delivery/asset management job or script it using psexec.exe/logon script or the like. 



  • 7.  RE: How do I add install records with sd_acmd for several computers?

    Posted Jan 08, 2014 04:22 AM

    That's true, as it says "targetname" and not "targettype" or something similar it's not quite clear what the parameters actual purpose is. :-)



  • 8.  RE: How do I add install records with sd_acmd for several computers?

    Posted Jan 08, 2014 04:20 AM

    Ah! That explains my confusion then. As we don't use different target types I didn't have that concept in the back of my head.

    It seemed a bit odd that this would be part of the sd_acmd command and not the cadsmcmd interface.

    Is there a different way to achieve my "database update" without me having to run jobs on every target computer (besides messing directly with the database)?



  • 9.  RE: How do I add install records with sd_acmd for several computers?

    Broadcom Employee
    Posted Jan 09, 2014 05:51 AM

    Hi

    I am sorry but there is no way to do this without running a job. You either need to use addinstallrecord or you could run a swdetect job but both of these have to be run on every single agent.

    regards

    Rich