How to Find GPO Software Installation Folders

Data gpo software

When moving data to a new file structure, e.g. when implementing DFS, you need to update all references.

Data references are typically found in drive mapping GPO’s and Software Distribution GPO’s.

Many other references may exist such as Excel sheet references, generic script references, etc.

For now we’ll be focusing on:

  • GPO’s with software distribution

Check this article for information on how to find and edit GPO’s with drive mapping.

For detailed instructions on how you can create your own GPO analysis scripts read this.

Using PowerShell to Identify GPO Software Distribution

In an old domain with a long history it may be difficult to find all policies that reference the data you’re moving.

To make sure you don’t miss anything it makes good sense to fire up PowerShell.

Use the following script to identify all software distribution GPO’s in your domain:

Function Get-AppSettings ($ExtData, $Gpo, $Scope){
  $ArrResult = @()
  ForEach ($ExtensionData In $ExtData) {
    If ($ExtensionData.Name -eq "Software Installation") {
      $Apps = $ExtensionData.Extension.msiApplication
      ForEach ($App In $Apps) {
          $AppInstaller = New-Object PSObject -Property @{
          GPO = $GPO.Name
          LinkCount = $LinkCount
          Enabled = $Enabled
          Name = $App.name
          Path = $App.Path
          Scope = $Scope
          Type = $App.DeploymentType
          OutOfScope = $App.LossOfScopeAction
        }
        $ArrResult += $AppInstaller
      }
    }
  }
  Write-Output $ArrResult
}

$Reports = Get-GPO -All | Get-GPOReport -ReportType Xml
$AppInstallers = @()
ForEach ($Report In $Reports) {
  $GPO = ([xml]$Report).GPO
  $LinkCount = ([string[]]([xml]$Report).GPO.LinksTo).Count
  $Enabled = $GPO.Computer.Enabled
  $ExtData = $GPO.Computer.ExtensionData
  $AppInstallers += Get-AppSettings $ExtData $GPO "Computer"
  $Enabled = $GPO.User.Enabled
  $ExtData = $GPO.User.ExtensionData
  $AppInstallers += Get-AppSettings $ExtData $GPO "User"
}
Write-Output $AppInstallers | ft GPO,LinkCount,Enabled,Name,Path,Type,OutOfScope

The output from the script will look similar to this:

GPO LinkCount Enabled Name Path Type OutOfScope --- --------- ------- ---- ---- ---- ---------- AccountingApp 1 true Acc Application \\fileserver-1\Software\AcctClient.msi Assign Unmanage CRM-client 2 true CRM Software \\fileserver-2\Software\CRM\crm_v4.5.msi Assign Unmanage AV Agent 1 false Antivirus Agent \\fileserver-1\Software\Symantec\ep_v7.8.msi Assign Unmanage

Once the GPO’s are identified, review which ones are referencing the data you’re moving.

Update the Installation Path of Published Applications

You can change the installation path by editing the associated packageRegistration key in AD. You can find it using the following DN:

CN={some guid},CN=Packages,CN=Class Store,CN=User,CN={GPO Guid},CN=Policies,CN=System,DC=domain-name,DC=domain-extension

Have a look at this article for a more detailed explanation on how to change the installation path of your published applications.

Did you like this post? Maybe your friends will too!