Files
powershell-scripts/docs/DATA_COLLECTION_PARITY.md
cproudlock 7d3519f613 Add comprehensive documentation and update deployment paths
Documentation:
- Add ShopDB-API.md with full API reference (all GET/POST endpoints)
- Add detailed docs for Update-ShopfloorPCs-Remote, Invoke-RemoteMaintenance, Update-PC-CompleteAsset
- Add DATA_COLLECTION_PARITY.md comparing local vs remote data collection
- Add HTML versions of all documentation with styled code blocks
- Document software deployment mechanism and how to add new apps
- Document deprecated scripts (Invoke-RemoteAssetCollection, Install-KioskApp)

Script Updates:
- Update deployment source paths to network share (tsgwp00525.wjs.geaerospace.net)
  - InstallDashboard: \\...\scripts\Dashboard\GEAerospaceDashboardSetup.exe
  - InstallLobbyDisplay: \\...\scripts\LobbyDisplay\GEAerospaceLobbyDisplaySetup.exe
  - UpdateEMxAuthToken: \\...\scripts\eMx\eMxInfo.txt
  - DeployUDCWebServerConfig: \\...\scripts\UDC\udc_webserver_settings.json
- Update machine network detection to include 100.0.0.* for CMM cases
- Rename PC Type #9 from "Part Marker" to "Inspection"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 11:45:00 -05:00

460 lines
17 KiB
Markdown

# Data Collection Parity Reference
Comprehensive comparison of data fields collected by the remote and local PowerShell scripts, including collection methods and API mapping.
## Table of Contents
- [Overview](#overview)
- [Scripts Compared](#scripts-compared)
- [Quick Reference Tables](#quick-reference-tables)
- [Detailed Field Reference](#detailed-field-reference)
- [Collection Methods](#collection-methods)
- [API Parameter Mapping](#api-parameter-mapping)
- [Testing Parity](#testing-parity)
- [Known Differences](#known-differences)
---
## Overview
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).
---
## Scripts Compared
| 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 |
---
## Quick Reference Tables
### Complete Field Parity Status
| 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
---
## Detailed Field Reference
### Basic System Information
#### Hostname
- **Description:** Computer name of the target PC
- **Remote:** `$env:COMPUTERNAME` inside Invoke-Command scriptblock
- **Local:** `$env:COMPUTERNAME`
- **API Parameter:** `hostname`
- **Example:** `SHOPFLOOR-PC01`
#### Serial Number
- **Description:** BIOS serial number (Dell service tag)
- **Remote:** `(Get-CimInstance -Class CIM_BIOSElement).SerialNumber`
- **Local:** `(Get-CimInstance -Class CIM_BIOSElement).SerialNumber`
- **API Parameter:** `serialNumber`
- **Example:** `ABC1234567`
#### Service Tag
- **Description:** Dell service tag (same as serial for Dell systems)
- **Remote:** Same as SerialNumber
- **Local:** Same as SerialNumber
- **API Parameter:** `serviceTag`
- **Example:** `ABC1234567`
#### Total Physical Memory
- **Description:** Total RAM in gigabytes
- **Remote:** `[Math]::Round($computerSystem.TotalPhysicalMemory / 1GB, 2)`
- **Local:** `[Math]::Round($computerSystem.TotalPhysicalMemory / 1GB, 2)`
- **API Parameter:** `totalPhysicalMemory`
- **Example:** `16.0`
#### Domain Role
- **Description:** Domain membership type
- **Remote:** `$computerSystem.DomainRole`
- **Local:** `$computerSystem.DomainRole`
- **API Parameter:** `domainRole`
- **Values:**
- 0 = Standalone Workstation
- 1 = Member Workstation
- 2 = Standalone Server
- 3 = Member Server
- 4 = Backup Domain Controller
- 5 = Primary Domain Controller
#### Current Time Zone
- **Description:** System timezone setting
- **Remote:** `(Get-TimeZone).Id`
- **Local:** `(Get-TimeZone).Id`
- **API Parameter:** `currentTimeZone`
- **Example:** `Eastern Standard Time`
#### PC Type
- **Description:** Classification based on installed software
- **Remote:** Detection function in scriptblock
- **Local:** `Get-PCType` function
- **API Parameter:** `pcType`
- **Values:** Dashboard, Lobby Display, CMM, Wax Trace, Keyence, EAS1000, Genspect, Heat Treat, Inspection, Shopfloor, Engineer, Standard
---
### DNC Configuration
#### DNC General Settings
- **Description:** Machine DNC settings from GE Aircraft Engines registry
- **Remote:** Read from `HKLM:\SOFTWARE\[WOW6432Node\]GE Aircraft Engines\DNC\General`
- **Local:** Read from same registry path via `Get-DNCConfig`
- **API Parameter:** `dncConfig` (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 |
---
### GE Registry Information
#### Registry Presence
- **Description:** Whether GE Aircraft Engines registry exists
- **32-bit Path:** `HKLM:\SOFTWARE\GE Aircraft Engines`
- **64-bit Path:** `HKLM:\SOFTWARE\WOW6432Node\GE Aircraft Engines`
- **API Parameters:**
- `dncGeRegistry32Bit` (1 or 0)
- `dncGeRegistry64Bit` (1 or 0)
#### Dual Path Configuration
- **Description:** eFocas dual-path settings for redundant machine connections
- **Registry Path:** `...\DNC\eFocas`
- **API Parameters:**
- `dncDualPathEnabled` (1, 0, or null)
- `dncPath1Name` (string)
- `dncPath2Name` (string)
---
### Network Interfaces
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:**
- **IsPrimary = 1:** IP matches `^10\.134\.` (corporate network)
- **IsMachineNetwork = 1:** IP matches `^192\.168\.` or `^100\.0\.0\.` (machine network, includes CMM cases)
---
### Application Detection
#### Serial Ports
- **Description:** List of COM ports for DNC communication
- **Collection:** `Get-CimInstance -ClassName Win32_SerialPort`
- **API Parameter:** `serialPorts` (JSON array)
- **Example:**
```json
[
{"PortName": "COM1", "Description": "Communications Port"},
{"PortName": "COM3", "Description": "USB Serial Port"}
]
```
#### VNC Detection
- **Description:** Whether VNC Server is installed
- **Collection Methods:**
1. Registry check for VNC Server/Connect/RealVNC in Uninstall keys
2. Service check for `vncserver*` services
- **API Parameter:** `hasVnc` (1 or 0)
#### All Installed Applications
- **Description:** Complete list of installed software
- **Collection Locations:**
- `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\*`
- **API Parameters:**
- `allInstalledApps` (pipe-delimited string)
- `allInstalledAppsCount` (integer)
#### Tracked Applications
- **Description:** Applications matched against `applications.csv`
- **API Parameter:** `installedApplications` (JSON array)
- **Example:**
```json
[
{"appid": 2, "appname": "UDC", "version": "2.1.0", "isactive": 1},
{"appid": 15, "appname": "Tanium", "version": "7.4.2", "isactive": 1}
]
```
---
### Printer Information
#### Default Printer FQDN
- **Description:** Network printer port name (IP or FQDN)
- **Collection:** `Get-WmiObject -Query "SELECT * FROM Win32_Printer WHERE Default=$true"`
- **Filtering:** Excludes local/virtual printers (USB, LPT, XPS, PDF, etc.)
- **Processing:** Strips trailing underscore and port suffix (e.g., `10.80.92.53_2` → `10.80.92.53`)
- **API Parameter:** `defaultPrinterFQDN`
---
## Collection Methods
### Remote Script Data Flow
```
Admin 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
```
### Local Script Data Flow
```
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
```
---
## API Parameter Mapping
### updateCompleteAsset Action
| 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 |
---
## Testing Parity
### Manual Parity Test
Run both scripts on the same PC and compare results:
**Step 1: Run Local Script**
```powershell
# On target PC
.\Update-PC-CompleteAsset.ps1 -DashboardURL "http://dev-server/api.asp" > local-output.txt
```
**Step 2: Run Remote Script**
```powershell
# From admin workstation
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName "TARGET-PC" -ApiUrl "http://dev-server/api.asp" > remote-output.txt
```
**Step 3: Compare Database Records**
```sql
-- 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';
```
### Automated Parity Check Script
```powershell
# 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)"
}
```
---
## Known Differences
### Local-Only Fields
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 |
### Context Differences
| 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 |
### PC Type Detection
Both scripts use the same detection priority:
1. Dashboard (GE Aerospace Dashboard)
2. Lobby Display (GE Aerospace Lobby Display)
3. CMM (PC-DMIS, goCMM, DODA)
4. Wax Trace (FormTracePak, FormStatusMonitor)
5. Keyence (VR-3000/5000/6000)
6. EAS1000 (GageCal, NI Software)
7. Genspect
8. Heat Treat
9. Inspection (machine number based)
10. Shopfloor (default for domain shop PCs)
**Additional local-only types:**
- Engineer (requires V-Drive AND C:\Apps)
- Standard (default)