Recast Agent Issues

Identify Devices Failing Client Validation

To identify agent devices that are failing client validation against a Recast Management Server, you can run the following PowerShell script, which creates a CSV file in C:\Recast\ClientValidationFailures\DevicesToReEnroll.csv.

# Get the current date and time, subtract 24 hours to get the start time 
$startTime = (Get-Date).AddDays(-1)
 
# Find all the entries with the matching event ID from the last 24 hours 
$events = Get-WinEvent -FilterHashtable @{Logname='Application'; ID=1000; StartTime=$startTime}
 
# Initialize an array to store the computer names 
$cn_values = @()
 
foreach ($event in $events) {
    # Find 'cn=' and everything after it until a space or end of line
    if ($event.Message -match 'cn=([^\s]*)') {
        # Add the matched string to the array
        $cn_values += $Matches[1]
    }
}

# Remove duplicate values 
$unique_cn_values = $cn_values | Sort-Object | Get-Unique
 
# Create directory if it doesn't already exist
$directory = "C:\Recast\ClientValidationFailures" 
if (!(Test-Path $directory)) {
    New-Item -ItemType Directory -Force -Path $directory
}

# Export the unique values to a CSV file with the column name "Computer Name" 
$unique_cn_values | ForEach-Object { [PSCustomObject]@{"Computer Name"=$_} } | Export-Csv -Path
'C:\Recast\ClientValidationFailures\DevicesToReEnroll.csv'  -NoTypeInformation




Recast Agent not Connecting

There are times when a Recast Agent attempts to connect to a Recast Management Server, but is unable. You'll see a warning in the Recast Management Server telling you that there is an Agent that is trying to connect, but it is not approved. This most often occurs if you delete the Agent from the Recast Management Server manually. Because the Agent information is deleted, there is no way to approve this Agent.

Error: A Recast Agent is trying to connect, but is not approved.

Resolution

Forcing the Agent to re-enroll gives you a way to approve an Agent, allowing it to connect again.

To re-enroll an Agent:

1. Log onto the computer where the Agent is not connecting.

2. Navigate to the agent.sqlite file location:

Version 5.X Recast Agent: C:\ProgramData\Recast Software\Recast Agent

Version 4.X Recast Agent: C:\Windows\System32\config\systemprofile\AppData\Roaming\Recast Software\Recast Agent

3. Delete the agent.sqlite file in that folder.

4. Restart the Recast Agent Service.Restarting the Recast Agent Service

The Agent Computer should appear on the Recast Agents page in the Remote Software Center and in the Recast Management Server interface. The Agent will be auto-approved or available to be approved depending on the settings in your Recast Management Server.Recast Agent is Back!

Recast Builder Action

You can also re-enroll a Recast Agent using a Builder Action available in Right Click Tools. See Recast Builder Actions.

PowerShell Script

$agent4Sqlite = "$env:windir\System32\Config\Systemprofile\Appdata\Roaming\Recast Software\Recast Agent\agent.sqlite"
$agent5Sqlite ="$env:ProgramData\Recast Software\Recast Agent\RecastAgent.sqlite"
# Stops the Recast Agent Service and deletes 4.x and 5.x enrollment SQLites if they exist.

try {
    Write-Output "Attempting to stop the Recast Agent Service..."
    Stop-Service -DisplayName "Recast Agent Service" -ErrorAction Stop
    Write-Output 'The Recast Agent Service was stopped successfully!'
}  catch { 
    "Unable to stop Recast Agent Service due to: $($_.Exception.Message)"
}
If (test-path $agent4Sqlite)
{ 
try {
    Write-Output 'Found v4.x SQLite...'
    Remove-Item $agent4Sqlite -Force -ErrorAction Stop
    Write-Output '4.x SQLite successfully removed!' 
} catch {  
    "Unable to delete 4.x SQLite due to: $($_.Exception.Message)"  
} 
} 
else
{ 
    Write-Output 'No 4.x SQLite file was found.'
}
If (test-path $agent5Sqlite) { 
    try{
    Write-host 'Found v5.x SQLite...'
    Remove-Item $agent5Sqlite -Force -ErrorAction Stop
    Write-Output '5.x SQLite successfully removed!'
} catch {
    "Unable to delete 5.x SQLite due to: $($_.Exception.Message)"
}
} 
else
{ 
    Write-Output 'No 5.x SQLite file was found.'
} 
try{ 
    Write-Output 'Attempting to start Recast Agent Service...'
    Start-Service -DisplayName "Recast Agent Service" -ErrorAction Stop
    Write-Output 'Recast Agent service started successfully!'
} catch {
    "Unable to start Recast Agent Service due to: $($_.Exception.Message)"
 }





Recast Agents Missing After Deployment

Indications

  • Deployed Recast Agents are not displayed on the Agents page in your Recast Management Server.
  • When you install an Agent, you get an error that the server certificate isn't trusted.

Troubleshooting Steps

1. Check that devices with Agents deployed have the certificate in their Trusted Root Certificate Authorities store.

2. Within the IIS Manager, update the binding for your Recast Management Server to the certificate that matches the RMS server name.

3. Update the ServerUri registry key to include https://servername:444 on the same devices with deployed Agents and remove any Recast Management Server URI registry entries.

When the issue is resolved, the deployed Agents should automatically begin connecting to the server and appearing on the Agents page in RMS. You can also force Agents to connect manually by restarting the Agent service from the System Information - Services tab in Right Click Tools. 

Copyright © 2024 Recast Software Inc. All rights reserved.