Objective
To explain why device CSV reports exported directly from the Automox Console display only Public IP addresses, and to provide a PowerShell API script that exports internal Private IP addresses, MAC addresses, and extended hardware details.
Overview
Standard device CSV reports exported from the Automox Console UI intentionally display only the endpoint's external Public IP address.
If your organization requires internal network details—such as Private IP addresses, NIC vendor information, or MAC addresses—for asset management or audit reporting, you can retrieve this data using a PowerShell script that queries the Automox GetDevices (GET /api/servers) API endpoint.
PowerShell API Export Script
This script queries your Automox organization, paginates through device inventory records, extracts internal IP address arrays from device NIC details, and exports the data to a local CSV file.
PowerShell
# Automox API Export: Extract Private IP Addresses & Hardware Inventory
# Configure Output Path
$logFilePath = 'C:\temp\DeviceInventory_With_PrivateIPs.csv'
# Set Automox Authentication Parameters
$orgID = 'YOUR_ORG_ID'
$apiKey = 'YOUR_API_KEY'
# Ensure output directory exists
$logDir = Split-Path -Path $logFilePath
if (-not (Test-Path -Path $logDir)) {
New-Item -ItemType Directory -Path $logDir -Force | Out-Null
}
$Output = @()
$page = 0
Write-Host "Fetching device inventory from Automox API..." -ForegroundColor Cyan
while ($true) {
$uri = "https://console.automox.com/api/servers?o=$orgID&limit=500&page=$page"
# Request data using Bearer Token authorization header
$headers = @{
"Authorization" = "Bearer $apiKey"
}
try {
$resp = Invoke-RestMethod -Uri $uri -Headers $headers -Method Get -ContentType "application/json"
} catch {
Write-Error "Failed to retrieve device data on page $page : $_"
break
}
if (-not $resp) { break }
$Output += $resp | Select-Object Name, last_scan_failed, pending_patches, connected, last_disconnect_time, needs_attention, last_logged_in_user -ExpandProperty detail |
Select-Object Name, MODEL, VENDOR, SERIAL, SERVICETAG, RAM, CPU, last_scan_failed, pending_patches, connected, last_disconnect_time, needs_attention, last_logged_in_user,
@{
Name = 'WSUS_Server'
Expression = { ($_.WSUS_CONFIG | Select-Object -ExpandProperty WSUS_SERVER -ErrorAction SilentlyContinue) }
},
@{
Name = 'WSUS_Reachable'
Expression = { ($_.WSUS_CONFIG | Select-Object -ExpandProperty WSUS_REACHABLE -ErrorAction SilentlyContinue) }
},
@{
Name = 'Update_Source_Connected'
Expression = { ($_.UPDATE_SOURCE_CHECK | Select-Object -ExpandProperty CONNECTED -ErrorAction SilentlyContinue) }
},
@{
Name = 'Disk_Size'
Expression = { (($_.DISKS | Select-Object -ExpandProperty SIZE -ErrorAction SilentlyContinue) -join " | ") }
},
@{
Name = 'Private_IP_Addresses'
Expression = { (($_.NICS | Select-Object -ExpandProperty IPS -ErrorAction SilentlyContinue) -join " | ") }
},
@{
Name = 'MAC_Addresses'
Expression = { (($_.NICS | Select-Object -ExpandProperty MAC -ErrorAction SilentlyContinue) -join " | ") }
},
@{
Name = 'NIC_Vendor'
Expression = { (($_.NICS | Select-Object -ExpandProperty VENDOR -ErrorAction SilentlyContinue) -join " | ") }
}
# Stop pagination if the current page contains fewer than the maximum batch size
if ($resp.Count -lt 500) {
break
}
$page++
}
# Export results to CSV
$Output | Export-Csv -Path $logFilePath -NoTypeInformation -Force
Write-Host "Export completed successfully. File saved to: $logFilePath" -ForegroundColor GreenScript Execution Steps
1.Obtain Automox Credentials:
- Log in to the Automox console and navigate to Keys > API Keys.
- Generate or copy an active API Key.
- Note your Organization ID from the URL bar (
o=YOUR_ORG_ID).
2.Update Script Variables:
Replace 'YOUR_ORG_ID' and 'YOUR_API_KEY' in the script with your actual API key and organization ID values.
3.Execute in PowerShell:
Run the script in an elevated PowerShell session.
4.Verify Output File:
Navigate to C:\temp\DeviceInventory_With_PrivateIPs.csv and inspect the Private_IP_Addresses and MAC_Addresses columns. Multiple internal network interface cards will be listed separated by | delimiters.