当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 如何查找 GPO 软件安装文件夹

作者:精品下载站 日期:2024-12-14 20:57:15 浏览:12 分类:玩电脑

如何查找 GPO 软件安装文件夹


[玩转系统] 如何查找 GPO 软件安装文件夹

将数据移动到新的文件结构时(例如,实现 DFS 时),您需要更新所有引用。

数据引用通常位于具有驱动器映射和软件分发设置的 GPO 中。

可能存在许多其他引用,例如 Excel 工作表引用、通用脚本引用等。

目前,我们将重点关注具有软件分发功能的 GPO

查看我们的其他文章以记录 GPO 的更多领域:

  • 如何查找 GPO 注册表设置
  • 如何查找 GPO 文件夹重定向
  • 如何查找 GPO 驱动器映射
  • 如何使用登录脚本查找 GPO

有关如何创建自己的 GPO 分析脚本的详细说明,请阅读此内容。

使用 PowerShell 识别 GPO 软件分发

查找引用您在历史悠久的旧域中移动的数据的所有策略可能很困难。

为了确保您不会错过任何事情,启动 PowerShell 是很有意义的。

使用以下脚本识别域中的所有软件分发 GPO:

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

该脚本的输出将类似于以下内容:

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

确定 GPO 后,请检查哪些 GPO 引用了您要移动的数据。

更新已发布应用程序的安装路径

您可以通过编辑 AD 中关联的 packageRegistration 键来更改安装路径。您可以使用以下 DN 找到它:

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

请参阅本文,了解有关如何更改已发布应用程序的安装路径的更详细说明。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯