Comprehensive comparison of data fields collected by the remote and local PowerShell scripts, including collection methods and API mapping.
Both the remote and local collection scripts are designed to collect the same data fields for shopfloor PCs. This document provides a comprehensive reference for what data is collected, how it's collected, and any differences between the two approaches.
Goal: Any field collected by one script should also be collected by the other (where technically feasible).
| Aspect | Remote Script | Local Script |
|---|---|---|
| Name | Update-ShopfloorPCs-Remote.ps1 | Update-PC-CompleteAsset.ps1 |
| Location | S:\dt\shopfloor\scripts\remote-execution\ |
S:\dt\shopfloor\scripts\complete-asset\ |
| Execution | From admin workstation via WinRM | Directly on target PC |
| Context | SYSTEM via WinRM | Local user or SYSTEM |
| Batch Support | Yes (many PCs) | No (one PC at a time) |
| WinRM Required | Yes | No |
| Category | Field | Remote | Local | Parity |
|---|---|---|---|---|
| System | Hostname | ✓ | ✓ | ✓ |
| Serial Number | ✓ | ✓ | ✓ | |
| Service Tag | ✓ | ✓ | ✓ | |
| Manufacturer | ✓ | ✓ | ✓ | |
| Model | ✓ | ✓ | ✓ | |
| Total Physical Memory | ✓ | ✓ | ✓ | |
| Domain Role | ✓ | ✓ | ✓ | |
| OS Version | ✓ | ✓ | ✓ | |
| Last Boot Time | ✓ | ✓ | ✓ | |
| Current Time Zone | ✓ | ✓ | ✓ | |
| Logged In User | ✓ | ✓ | ✓ | |
| PC Type | ✓ | ✓ | ✓ | |
| Machine No | ✓ | ✓ | ✓ | |
| DNC | Site | ✓ | ✓ | ✓ |
| CNC | ✓ | ✓ | ✓ | |
| NcIF | ✓ | ✓ | ✓ | |
| Host Type | ✓ | ✓ | ✓ | |
| FTP Primary | ✓ | ✓ | ✓ | |
| FTP Secondary | ✓ | ✓ | ✓ | |
| GE Registry | 32-bit Present | ✓ | ✓ | ✓ |
| 64-bit Present | ✓ | ✓ | ✓ | |
| Dual Path Enabled | ✓ | ✓ | ✓ | |
| Path 1 Name | ✓ | ✓ | ✓ | |
| Path 2 Name | ✓ | ✓ | ✓ | |
| Network | Interface Name | ✓ | ✓ | ✓ |
| IP Address | ✓ | ✓ | ✓ | |
| Subnet Mask | ✓ | ✓ | ✓ | |
| Default Gateway | ✓ | ✓ | ✓ | |
| MAC Address | ✓ | ✓ | ✓ | |
| Is DHCP | ✓ | ✓ | ✓ | |
| Is Active | ✓ | ✓ | ✓ | |
| Is Machine Network | ✓ | ✓ | ✓ | |
| Is Primary | ✓ | ✓ | ✓ | |
| Apps | Serial Ports | ✓ | ✓ | ✓ |
| Has VNC | ✓ | ✓ | ✓ | |
| All Installed Apps | ✓ | ✓ | ✓ | |
| Tracked Applications | ✓ | ✓ | ✓ | |
| UDC Running | ✓ | ✓ | ✓ | |
| CLM Running | ✓ | ✓ | ✓ | |
| Printer | Default Printer FQDN | ✓ | ✓ | ✓ |
| Local Only | V-Drive Access | ✗ | ✓ | N/A |
| C:\Apps Folder | ✗ | ✓ | N/A |
Legend: ✓ = Collected, ✗ = Not collected, N/A = Not applicable
$env:COMPUTERNAME inside Invoke-Command scriptblock$env:COMPUTERNAMEhostnameSHOPFLOOR-PC01(Get-CimInstance -Class CIM_BIOSElement).SerialNumber(Get-CimInstance -Class CIM_BIOSElement).SerialNumberserialNumberABC1234567serviceTagABC1234567[Math]::Round($computerSystem.TotalPhysicalMemory / 1GB, 2)[Math]::Round($computerSystem.TotalPhysicalMemory / 1GB, 2)totalPhysicalMemory16.0$computerSystem.DomainRole$computerSystem.DomainRoledomainRole(Get-TimeZone).Id(Get-TimeZone).IdcurrentTimeZoneEastern Standard TimeGet-PCType functionpcTypeHKLM:\SOFTWARE\[WOW6432Node\]GE Aircraft Engines\DNC\GeneralGet-DNCConfigdncConfig (JSON object)DNC Config Fields:
| Field | Registry Key | API Key |
|---|---|---|
| Site | Site | dncConfig.Site |
| CNC | Cnc | dncConfig.CNC |
| NcIF | NcIF | dncConfig.NcIF |
| Machine No | MachineNo | dncConfig.MachineNo |
| Host Type | HostType | dncConfig.HostType |
| FTP Primary | FtpHostPrimary | dncConfig.FtpHostPrimary |
| FTP Secondary | FtpHostSecondary | dncConfig.FtpHostSecondary |
HKLM:\SOFTWARE\GE Aircraft EnginesHKLM:\SOFTWARE\WOW6432Node\GE Aircraft EnginesdncGeRegistry32Bit (1 or 0)dncGeRegistry64Bit (1 or 0)...\DNC\eFocasdncDualPathEnabled (1, 0, or null)dncPath1Name (string)dncPath2Name (string)Both scripts collect all active network interfaces with these fields:
| Field | Description | API Key |
|---|---|---|
| InterfaceName | Adapter name | interfaceName |
| IPAddress | IPv4 address | ipAddress |
| SubnetMask | CIDR prefix length | subnetMask |
| DefaultGateway | Gateway address | defaultGateway |
| MACAddress | Physical address | macAddress |
| IsDHCP | DHCP enabled | isDhcp |
| IsActive | Interface is up | isActive |
| IsMachineNetwork | 192.168.. or 100.0.0.* address | isMachineNetwork |
| IsPrimary | 10.134.. address | isPrimary |
Network Classification:
^10\.134\. (corporate network)^192\.168\. or ^100\.0\.0\. (machine network, includes CMM cases)Get-CimInstance -ClassName Win32_SerialPortserialPorts (JSON array) [
{"PortName": "COM1", "Description": "Communications Port"},
{"PortName": "COM3", "Description": "USB Serial Port"}
]
vncserver* serviceshasVnc (1 or 0)HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*Registry::HKU\<SID>\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*allInstalledApps (pipe-delimited string)allInstalledAppsCount (integer)applications.csvinstalledApplications (JSON array) [
{"appid": 2, "appname": "UDC", "version": "2.1.0", "isactive": 1},
{"appid": 15, "appname": "Tanium", "version": "7.4.2", "isactive": 1}
]
Get-WmiObject -Query "SELECT * FROM Win32_Printer WHERE Default=$true"10.80.92.53_2 → 10.80.92.53)defaultPrinterFQDNAdmin Workstation Target PC
│ │
│ Invoke-Command (WinRM) │
├───────────────────────────────→│
│ │ ┌─────────────────────┐
│ │ │ Collect data: │
│ │ │ - CIM instances │
│ │ │ - Registry │
│ │ │ - Processes │
│ │ │ - Network config │
│ │ └─────────────────────┘
│ │
│ Return $result hashtable │
│←───────────────────────────────┤
│ │
│ ┌──────────────────────────┐ │
│ │ Send-PCDataToApi │ │
│ │ POST to ShopDB API │ │
│ └──────────────────────────┘ │
│ │
│ HTTP POST to API │
├───────────────────────────────→│ ShopDB Server
Target PC
│
│ ┌────────────────────────────────┐
│ │ Collect-SystemInfo │
│ │ - CIM instances │
│ │ - Registry │
│ │ - Processes │
│ └────────────────────────────────┘
│
│ ┌────────────────────────────────┐
│ │ Get-ShopfloorConfigurations │
│ │ - Network interfaces │
│ │ - DNC config │
│ │ - GE Registry │
│ └────────────────────────────────┘
│
│ ┌────────────────────────────────┐
│ │ Send-CompleteDataToDashboard │
│ │ POST to ShopDB API │
│ └────────────────────────────────┘
│
│ HTTP POST to API
├───────────────────────────────────→ ShopDB Server
| Category | API Parameter | Remote Source | Local Source |
|---|---|---|---|
| Basic | hostname | $result.Hostname | $systemInfo.Hostname |
| serialNumber | $result.SerialNumber | $systemInfo.SerialNumber | |
| serviceTag | $result.ServiceTag | $systemInfo.ServiceTag | |
| manufacturer | $result.Manufacturer | $systemInfo.Manufacturer | |
| model | $result.Model | $systemInfo.Model | |
| pcType | $result.PCType | $systemInfo.PCType | |
| loggedInUser | $result.LoggedInUser | $systemInfo.LoggedInUser | |
| machineNo | $result.MachineNo | $systemInfo.MachineNo | |
| osVersion | $result.OSVersion | $systemInfo.OSVersion | |
| lastBootUpTime | $result.LastBootUpTime | $systemInfo.LastBootUpTime | |
| totalPhysicalMemory | $result.TotalPhysicalMemory | $systemInfo.TotalPhysicalMemory | |
| domainRole | $result.DomainRole | $systemInfo.DomainRole | |
| currentTimeZone | $result.CurrentTimeZone | $systemInfo.CurrentTimeZone | |
| VNC | hasVnc | $result.HasVnc | $systemInfo.HasVnc |
| Serial | serialPorts | $result.SerialPorts (JSON) | $systemInfo.SerialPorts (JSON) |
| Apps | allInstalledApps | $result.AllInstalledApps | $systemInfo.AllInstalledApps |
| allInstalledAppsCount | $result.AllInstalledAppsCount | $systemInfo.AllInstalledAppsCount | |
| Printer | defaultPrinterFQDN | $result.DefaultPrinterFQDN | Get-DefaultPrinterFQDN |
| Network | networkInterfaces | $result.NetworkInterfaces (JSON) | $shopfloorInfo.NetworkInterfaces (JSON) |
| Comm | commConfigs | $result.CommConfigs (JSON) | $shopfloorInfo.CommConfigs (JSON) |
| DNC | dncConfig | $result.DNCConfig (JSON) | $shopfloorInfo.DNCConfig (JSON) |
| dncGeRegistry32Bit | $result.GERegistryInfo.Registry32Bit | $shopfloorInfo.GERegistryInfo.Registry32Bit | |
| dncGeRegistry64Bit | $result.GERegistryInfo.Registry64Bit | $shopfloorInfo.GERegistryInfo.Registry64Bit | |
| dncDualPathEnabled | $result.GERegistryInfo.DualPathEnabled | $shopfloorInfo.GERegistryInfo.DualPathEnabled | |
| dncPath1Name | $result.GERegistryInfo.Path1Name | $shopfloorInfo.GERegistryInfo.Path1Name | |
| dncPath2Name | $result.GERegistryInfo.Path2Name | $shopfloorInfo.GERegistryInfo.Path2Name |
Run both scripts on the same PC and compare results:
Step 1: Run Local Script
# On target PC
.\Update-PC-CompleteAsset.ps1 -DashboardURL "http://dev-server/api.asp" > local-output.txt
Step 2: Run Remote Script
# From admin workstation
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName "TARGET-PC" -ApiUrl "http://dev-server/api.asp" > remote-output.txt
Step 3: Compare Database Records
-- Check if both created/updated the same record
SELECT * FROM machines WHERE hostname = 'TARGET-PC' ORDER BY lastupdated DESC LIMIT 2;
-- Compare specific fields
SELECT hostname, serialnumber, pctype, totalphysicalmemory, domainrole
FROM machines WHERE hostname = 'TARGET-PC';
# parity-test.ps1
param(
[Parameter(Mandatory)]
[string]$ComputerName,
[PSCredential]$Credential
)
# Run remote collection
$remoteData = .\Update-ShopfloorPCs-Remote.ps1 -ComputerName $ComputerName -Credential $Credential -WhatIf
# Fields to compare
$fields = @(
'Hostname', 'SerialNumber', 'ServiceTag', 'Manufacturer', 'Model',
'TotalPhysicalMemory', 'DomainRole', 'CurrentTimeZone', 'PCType',
'HasVnc', 'AllInstalledAppsCount'
)
# Output comparison
foreach ($field in $fields) {
Write-Host "$field : $($remoteData.$field)"
}
These fields can only be collected by the local script:
| Field | Reason |
|---|---|
| V-Drive Access | Requires user's mapped network drives |
| C:\Apps Folder Access | Network permissions differ in WinRM context |
| Aspect | Remote | Local |
|---|---|---|
| User context | SYSTEM (via WinRM) | Logged-in user or SYSTEM |
| Network drives | Not accessible | Accessible |
| User registry (HKCU) | SYSTEM's HKCU | User's HKCU |
| Per-user apps | Via HKU enumeration | Via HKU + HKCU |
Both scripts use the same detection priority:
Additional local-only types: