---
title: Retry Installation for Approved application using PowerShell
description: I wrote a post on What&#8217;s new in application requests in Configuration Manager 1906 over at 4sysops.com https://4sysops.com/archives/whats-new-in-application-requests-in-sccm-1906/ One ...
---

[Onevinn blog ](https://www.onevinn.com/blog)

# [Retry Installation for Approved application using PowerShell](https://www.onevinn.com/blog/retry-installation-for-approved-application-using-powershell)

 Written by [Jörgen Nilsson](https://www.onevinn.com/blog/author/jörgen-nilsson) | 15 Dec 2019

I wrote a post on What’s new in application requests in Configuration Manager 1906 over at 4sysops.com [https://4sysops.com/archives/whats-new-in-application-requests-in-sccm-1906/](https://4sysops.com/archives/whats-new-in-application-requests-in-sccm-1906/) One of the things that is new i the possibility to Retry an Installation if it fails or is uninstalled manually for example.

In the post over at 4Sysops I had three sample scripts on how to Create, Approve and Deny application requests using PowerShell so it could be automated. I got a question the other day if you can do a Retry Install as well using PowerShell and of course we can. Here is a PowerShell script to achieve that.

Sample command line:** Powershell.exe -executionpolicy bypass -file RetryAppinstall.Ps1 “W101test120” “7-zip 18.06”**

The script:

```

[CmdletBinding()]
Param(
    [string]$MachineName,
    [string]$AppName
  )

Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1"
$SiteCode = (Get-WmiObject -Namespace root\sms -Query 'SELECT SiteCode FROM SMS_ProviderLocation').SiteCode
Set-Location "$($SiteCode):"
$NameSpace ="ROOT\SMS\site_$($SiteCode)"

$AppID = (Get-CMApplication -Name "$AppName").ModelName
$SMSID = (Get-CMDevice -Name "$MachineName").SMSID

$reqObj = Get-WmiObject -Namespace $NameSpace -Class SMS_UserApplicationRequest | Where {$_.ModelName -eq $AppID -and $_.RequestedMachine -eq $MachineName}
$reqObjPath = $reqObj.__PATH

Invoke-WmiMethod -Path $reqObjPath -Name RetryInstall
```

[View full post](https://www.onevinn.com/blog/retry-installation-for-approved-application-using-powershell)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Jörgen Nilsson"
  },
  "dateModified" : "2020-08-18T13:11:30.830Z",
  "datePublished" : "2019-12-15T23:26:19Z",
  "headline" : "Retry Installation for Approved application using PowerShell",
  "image" : {
    "@type" : "ImageObject",
    "url" : "https://ccmexec.com/2019/12/retry-installation-for-approved-application-using-powershell/image-9/"
  },
  "mainEntityOfPage" : "https://www.onevinn.com/blog/retry-installation-for-approved-application-using-powershell",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Onevinn blog"
  }
}
```