CA Client Automation

Expand all | Collapse all

Command Line to remove an Installed Package record from an Asset

  • 1.  Command Line to remove an Installed Package record from an Asset

    Posted Nov 23, 2016 11:12 AM

    Guys, I have a requirement to remove an item from the installed packages records of a node (not uninstall it from the node but remove the record similar to right clicking the software in the installed packages node and clicking delete)

     

    Can't seem to find a command line util at server or agent side to do this. 



  • 2.  Re: Command Line to remove an Installed Package record from an Asset
    Best Answer

    Posted Nov 23, 2016 11:15 AM

    'Sd_acmd AddUninstallRecord' from the agent side

     

     

     

     

    Steve McCormick, ITIL

    CA Technologies

    Principal Services Consultant

    Tel: +1-731-676-4223

    Stephen.McCormick@ca.com<mailto:Stephen.McCormick@ca.com>



  • 3.  Re: Command Line to remove an Installed Package record from an Asset

    Posted Nov 23, 2016 11:27 AM

    As always, thanks Stephen ;



  • 4.  Re: Command Line to remove an Installed Package record from an Asset

    Posted Nov 29, 2016 02:21 AM

    Stephen, thanks for the info above. This does remove the software from the 'Installed Packages' node but also creates a record in the Jobs list. Is it possible to the do the former only i.e. remove but not create a n uninstall job record? Basically, what I am trying to do is cleanup my agents. We have many bits of software we deploy such as Citrix Receiver. When we deploy say, the receiver version 4.3 and then subsequently deploy version 4.5 the Installed Packages node will show both version even though 4.5 would have upgraded 4.3 at the agent. Ideally, If I could create a job DM side to clean that up it would be ideal!



  • 5.  Re: Command Line to remove an Installed Package record from an Asset

    Posted Nov 29, 2016 08:55 AM

    Yes that is correct and by design. Installed packages is intended to be the record of current state while jobs is the record of what happened in terms of software installations.

     

    To your point though, I see where you have an issue. the 'AddUninstallRecord' command does allow you to specify the uninstall procedure name. As far as I know the procedure does not actually have to exist in the package so you could use something like 'removed by upgrade to Rx.xx' to I private the upgrade scenario. If I'm wrong and the procedure does have to exist it would be easy to create the procedure as an 'added procedure' which can be added even to a sealed package.

     

    If this still doesn't solve your problem I do have one other idea using a rarely used feature but it would require testing which I won't be able to do for a couple of days.

     

     

     

     

    Steve McCormick, ITIL

    CA Technologies

    Principal Services Consultant

    Stephen.McCormick@ca.com<mailto:Stephen.McCormick@ca.com>



  • 6.  Re: Command Line to remove an Installed Package record from an Asset

    Broadcom Employee
    Posted Nov 29, 2016 09:24 AM

    It does not need to exist I was working with that yesterday for another customer.

     

    Richard Lechner

    Principal Engineering Services Architect

     

    CA Technologies

    Mobile: +1 703 655 7161 | Richard.Lechner@ca.com

     

    <mailto:Richard.Lechner@ca.com>[CA]<http://www.ca.com/us/default.aspx>[Twitter]<http://twitter.com/CAInc>[Slideshare]<http://www.slideshare.net/cainc>[Facebook]<https://www.facebook.com/CATechnologies>[YouTube]<http://www.youtube.com/user/catechnologies>[LinkedIn]<http://www.linkedin.com/company/1372?goback=.cps_1244823420724_1>[Google]<https://plus.google.com/CATechnologies>[Google+]<http://www.ca.com/us/rss.aspx?intcmp=footernav>



  • 7.  Re: Command Line to remove an Installed Package record from an Asset

    Posted Dec 08, 2016 07:20 AM

    Hi Richard, for me it seems the procedure name must match a valid procedure? For example, this did not work:

    • sd_acmd AddUninstallRecord "Citrix Receiver" "4.3" "MYUninstall" "*" current current "Me" "My Comment"

    yet this did:

    • sd_acmd AddUninstallRecord "Citrix Receiver" "4.3" "Uninstall" "*" current current "Me" "My Comment"


  • 8.  Re: Command Line to remove an Installed Package record from an Asset

    Broadcom Employee
    Posted Dec 08, 2016 07:26 AM

    In my testing I have no Uninstall procedure but the install record is removed if I specify Uninstall as the procedure name

     

     

     

    Sent from my Verizon, Samsung Galaxy smartphone



  • 9.  Re: Command Line to remove an Installed Package record from an Asset

    Posted Dec 08, 2016 07:30 AM

    Hmm, then it seems like the procedure name must be Uninstall regardless



  • 10.  Re: Command Line to remove an Installed Package record from an Asset

    Posted Dec 01, 2016 03:09 PM

    I'd be interested to see this 'rarely used feature' for no other reason than curiosity



  • 11.  Re: Command Line to remove an Installed Package record from an Asset

    Posted Dec 01, 2016 03:44 PM

    Actually I already sent it to you in a post on Sep 26 in the thread: https://communities.ca.com/message/241916195?commentID=241916195&et=watches.email.thread#comment-241916195

     

    At the end of the sample detection script in the doc attached to my post, you will see the following lines:

     

     

          if_yes_do = swfound no testpackage, 1.0

     

          if_no_do = swfound no testpackage, 1.0

     

    This is used in the sample script to delete the record of having installed ‘testpackage 1.0’ which is the package which runs the script itself. As far as I can recall it does not create an associated uninstall job record, it just removes the installed package record.

     

    Steve McCormick, ITIL

    CA Technologies

    Principal Services Consultant

    Stephen.McCormick@ca.com

    <mailto:Stephen.McCormick@ca.com>