Intune icon indicating copy to clipboard operation
Intune copied to clipboard

GetDecryptionInfoFromLogFile.ps1 only searches current IME log

Open SMSAgentSoftware opened this issue 2 years ago • 0 comments

The script only searches the current (latest) IME log - sometimes the download info may have aged out of the current log into a rolled over log.

The code updates below will search all IME logs:

function ExtractIntuneAppDetailsFromLogFile()
{
    $IMELogs = Get-ChildItem -Path $env:ProgramData\Microsoft\IntuneManagementExtension\Logs -Filter IntuneManagementExtension*.log -Recurse -ErrorAction SilentlyContinue
    foreach ($IMELog in $IMELogs)
    {
        $agentLogPath = $IMELog.FullName
        $stringToSearch = "<![LOG[Response from Intune = {".ToLower()

        Get-Content $agentLogPath | ForEach-Object {
        ...

SMSAgentSoftware avatar Dec 15 '23 22:12 SMSAgentSoftware