Rerun the failed Application deployment

Welcome Forums General PowerShell Q&A Rerun the failed Application deployment

This topic contains 4 replies, has 2 voices, and was last updated by

 
Participant
3 months, 4 weeks ago.

  • Author
    Posts
  • #103223

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 1
    Rank: Member
      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

      Participant
      Points: 0
      Rank: Member

      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

      Participant
      Points: 0
      Rank: Member

      Any help on this?

    • #103460

      Participant
      Points: 1
      Rank: Member

      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?

The topic ‘Rerun the failed Application deployment’ is closed to new replies.