9

I need to trigger a particular GPO-deployed application to reinstall. In the past I've just deleted a certain registry key that tells Windows: "this application has been installed".

But I can't for the life of me remember where those keys are located in the registry, and searching isn't turning much up.

Thanks!

Boden
  • 4,968
  • 12
  • 49
  • 70

4 Answers4

9

Look in:

HKLM\Software\Microsoft\Windows\Current Version\Group Policy\AppMgmt. Find the key that corresponds to the software you're looking for, and delete it. Then run gpupdate /force and restart.

Boden
  • 4,968
  • 12
  • 49
  • 70
2

Instead of deleting the key, you can also set the AppState value to 0. The original value should 9 or 17 (with removal option).

Get-ItemProperty `
-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\AppMgmt\*" `
| ForEach-Object {
  if ($_. "Deployment Name" -match '^<the deployment name>$') {
    $_

    $answer = Read-Host "Set value?"

    if ( $answer -match "(?i)Y") {
      New-ItemProperty $_.PSPath -Name AppState -Value 0 -Force
    }
  }
}

PS: I wanted to add a comment to the accepted answer but I do not have 50 reputations as of now, so I am adding an answer here.

puravidaso
  • 121
  • 3
2

I believe:

GPO applied to the local computer:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Group Policy\History

GPO applied to the currently logged on user:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion
  \Group Policy\History
Fergus
  • 1,313
  • 9
  • 19
  • That's not quite it. When an application is installed automatically through group policy, a registry key is created somewhere (which is what I'm looking for). If you uninstall the application, this registry key will not be removed, and the software will not automatically be installed on the next boot. Running gpupdate /force often works, but sometimes deleting the registry key is necessary to force installation. – Boden Feb 11 '10 at 18:43
  • 1
    You were close, the keys are under HKLM\Software\Microsoft\Windows\CurrentVersion\Group Policy\AppMgmt – Boden Feb 11 '10 at 18:50
  • ah, you are right. Glad I got you almost there. – Fergus Dec 25 '10 at 22:08
1

Not a direct answer, but if you go into the GPO and right click the Application object go to All Tasks -> Redeploy. That will well redeploy the application.

Zypher
  • 37,405
  • 5
  • 53
  • 95
  • 2
    One caveat is that it will redeploy to all users in the GPO scope, so make sure that's what you really want to happen before doing it! – Maximus Minimus Feb 11 '10 at 19:46