fix(Hermmes): ChBcLogpfad in Get-RemoteCCMLog reparieren
- entfernt leeren LogRoot-Parameter - baut Pfad zu \CLIENT\C$\Windows\CCM\Logs jetzt direkt in der Funktion - bleibt rein ChBcbasiert ohne WinRM/CIM
This commit is contained in:
parent
36dda3a308
commit
d05b5979c6
@ -123,12 +123,9 @@ function Get-RemoteCCMLog {
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$ComputerName,
|
||||
[string]$LogName,
|
||||
[string]$LogRoot,
|
||||
[string]$CredUser,
|
||||
[string]$CredPass
|
||||
[string]$LogName
|
||||
)
|
||||
$path = Join-Path $LogRoot "CCM\Logs\$LogName"
|
||||
$path = "\\$ComputerName\C$\Windows\CCM\Logs\$LogName"
|
||||
if (-not (Test-Path $path)) {
|
||||
Write-Warning "Log nicht vorhanden: $path"
|
||||
return @()
|
||||
@ -149,6 +146,7 @@ function Get-RemoteCCMLog {
|
||||
catch {
|
||||
Write-Warning "Konnte $LogName nicht ueber C$ laden: $_"
|
||||
try {
|
||||
$net = New-Object -ComObject WScript.Network
|
||||
if ($CredUser -and $CredPass) {
|
||||
$net.MapNetworkDrive("Z:", "\\$ComputerName\C$", $false, $CredUser, $CredPass)
|
||||
}
|
||||
@ -195,9 +193,9 @@ else {
|
||||
|
||||
#region Logs laden ------------------------------------------------------------
|
||||
|
||||
$appAll = Get-RemoteCCMLog -ComputerName $ComputerName -LogName 'AppDiscovery.log' -LogRoot '' -CredUser $credUser -CredPass $credPass
|
||||
$appEnfAll = Get-RemoteCCMLog -ComputerName $ComputerName -LogName 'AppEnforce.log' -LogRoot '' -CredUser $credUser -CredPass $credPass
|
||||
$casAll = Get-RemoteCCMLog -ComputerName $ComputerName -LogName 'CAS.log' -LogRoot '' -CredUser $credUser -CredPass $credPass
|
||||
$appAll = Get-RemoteCCMLog -ComputerName $ComputerName -LogName 'AppDiscovery.log' -CredUser $credUser -CredPass $credPass
|
||||
$appEnfAll = Get-RemoteCCMLog -ComputerName $ComputerName -LogName 'AppEnforce.log' -CredUser $credUser -CredPass $credPass
|
||||
$casAll = Get-RemoteCCMLog -ComputerName $ComputerName -LogName 'CAS.log' -CredUser $credUser -CredPass $credPass
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user