# Asset Collection Scripts Scripts for collecting PC asset data and sending it to the ShopDB database. ## Quick Start **Run as Administrator:** ```batch Update-PC-CompleteAsset.bat ``` For scheduled tasks (no window): ```batch Update-PC-CompleteAsset-Silent.bat ``` --- ## Batch Launchers (Entry Points) | Batch File | Purpose | |------------|---------| | `Update-PC-CompleteAsset.bat` | Main launcher - run this for full asset collection | | `Update-PC-CompleteAsset-Silent.bat` | Silent version for scheduled tasks | | `Update-PC-Minimal.bat` | Lightweight collection for restricted PCs | | `Get-InstalledApps.bat` | Application inventory only | --- ## PowerShell Scripts ### Update-PC-CompleteAsset.ps1 **Primary asset collection script** - Comprehensive data collection for all PC types. **What it collects:** - System information (hostname, serial number, manufacturer, model) - Operating system details - Network interface configurations - For shopfloor PCs: DNC/machine configurations from GE registry - Dell warranty information (optional, via proxy) **Usage:** ```powershell # Standard execution (requires administrator) .\Update-PC-CompleteAsset.ps1 # Test connectivity only .\Update-PC-CompleteAsset.ps1 -TestConnections # With warranty lookup enabled .\Update-PC-CompleteAsset.ps1 -SkipWarranty:$false ``` **Parameters:** | Parameter | Default | Description | |-----------|---------|-------------| | `-ProxyURL` | `http://10.48.130.158/vendor-api-proxy.php` | Warranty API proxy | | `-DashboardURL` | `https://tsgwp00525.rd.ds.ge.com/shopdb/api.asp` | ShopDB API endpoint | | `-SkipWarranty` | `$true` | Skip warranty lookups | | `-TestConnections` | `$false` | Test API connectivity only | --- ### Get-ShopfloorConfig.ps1 **Shopfloor configuration library** - Functions for collecting manufacturing-specific data. **Functions provided:** - `Get-NetworkInterfaceConfig` - Collects all network adapter information - `Get-SerialPortConfig` - Enumerates COM port configurations - `Get-DNCConfig` - Extracts DNC registry settings - `Get-GERegistryConfig` - Reads GE Aircraft Engines registry keys **Note:** This script is sourced by `Update-PC-CompleteAsset.ps1` and not run directly. --- ### Update-PC-Minimal.ps1 **Lightweight collection script** - For locked-down PCs with restricted permissions. **What it collects:** - Basic system info without requiring admin privileges - Uses only non-elevated WMI/CIM queries - Detects PC-DMIS software for measuring machine classification **Usage:** ```powershell .\Update-PC-Minimal.ps1 ``` **When to use:** - PCs where users cannot run as administrator - Measuring machines with restricted permissions - Quick data collection without full registry access --- ### Get-InstalledApps.ps1 **Application inventory script** - Collects list of installed applications. **Usage:** ```powershell .\Get-InstalledApps.ps1 ``` --- ## Batch File Launchers | File | Purpose | |------|---------| | `Update-PC-CompleteAsset.bat` | Standard launcher with visible window | | `Update-PC-CompleteAsset-Silent.bat` | Silent launcher for scheduled tasks | | `Update-PC-Minimal.bat` | Launcher for minimal collection | | `Get-InstalledApps.bat` | Launcher for app inventory | | `Run-GetInstalledApps.bat` | Alternative app inventory launcher | --- ## Requirements - PowerShell 5.1 or later - Administrator privileges (for full collection) - Network access to ShopDB API - Windows 10/11 or Windows Server ## Data Flow ``` PC Local Execution │ ▼ ┌──────────────────┐ │ Update-PC- │ │ CompleteAsset.ps1│ │ + │ │ Get-Shopfloor- │ │ Config.ps1 │ └────────┬─────────┘ │ HTTPS POST ▼ ┌──────────────────┐ │ ShopDB API │ │ (api.asp) │ └────────┬─────────┘ │ ▼ ┌──────────────────┐ │ MySQL Database │ └──────────────────┘ ```