Rerun the failed Application deployment

This topic contains 4 replies, has 2 voices, and was last updated by  Matt Bloomfield 2 weeks, 6 days ago.

  • Author
    Posts
  • #103223

    amit aman
    Participant

    Hi Team,

    I am trying to write a code to Rerun those Applications in Software Center which are in "FAILED" status. Below the code I am using:

    foreach ($comp in $computer)
                        {
                            $software = (Get-WmiObject -ClassName CCM_Program -ComputerName $comp -Namespace "root\ccm\clientSDK" | where LastRunStatus -EQ "Failed").name
    
                            foreach ($soft in $software)
                            {
                                cmd /c $soft.InstallString()   
                            }
                        }

    I know, I am doing something wrong in installation part. Kindly Assist.

    Thanks,

  • #103259

    Matt Bloomfield
    Participant
      cmd /c $soft.InstallString()   

    This won't work. What your doing here is saying to cmd "run the InstallString() method that is a member of the object represented by $soft".

    However, $soft is a string object and string objects don't have an InstallString() method.

    As far as I can tell from the documentation the CCM_Program class doesn't have a method or property called InstallString either.

    • #103288

      amit aman
      Participant

      Thanks Matt. I knew that this is not going to work as I was getting the similar error as explained by you that such method does not exist.
      Question here is what is the alternative? Any other way to reinstall?

    • #103409

      amit aman
      Participant

      Any help on this?

    • #103460

      Matt Bloomfield
      Participant

      Sorry, been out this week and not had a chance to reply.

      In your original post you say that the applications are showing as failed status in Software Centre. In SCCM these clients should also be showing that they failed to install. Is there any reason you are not re-running the deployment from SCCM rather than trying to re-run the software installation on the client?

You must be logged in to reply to this topic.