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>
982 lines
30 KiB
HTML
982 lines
30 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Update-PC-CompleteAsset.ps1</title>
|
|
<style>
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
line-height: 1.6;
|
|
max-width: 900px;
|
|
margin: 0 auto;
|
|
padding: 20px 40px;
|
|
background-color: #ffffff;
|
|
color: #333;
|
|
}
|
|
h1 {
|
|
color: #1a5276;
|
|
border-bottom: 3px solid #1a5276;
|
|
padding-bottom: 10px;
|
|
margin-top: 0;
|
|
}
|
|
h2 {
|
|
color: #2874a6;
|
|
border-bottom: 2px solid #d5dbdb;
|
|
padding-bottom: 8px;
|
|
margin-top: 40px;
|
|
}
|
|
h3 {
|
|
color: #2e86ab;
|
|
margin-top: 30px;
|
|
}
|
|
h4 {
|
|
color: #5d6d7e;
|
|
margin-top: 25px;
|
|
}
|
|
a {
|
|
color: #2980b9;
|
|
text-decoration: none;
|
|
}
|
|
a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
code {
|
|
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
|
|
background-color: #f4f4f4;
|
|
padding: 2px 6px;
|
|
border-radius: 3px;
|
|
font-size: 0.9em;
|
|
border: 1px solid #e1e1e1;
|
|
}
|
|
pre {
|
|
background-color: #2d2d2d;
|
|
color: #f8f8f2;
|
|
padding: 15px 20px;
|
|
border-radius: 6px;
|
|
overflow-x: auto;
|
|
font-family: 'Cascadia Mono', 'JetBrains Mono', 'Fira Code', 'Source Code Pro', 'DejaVu Sans Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
|
|
font-size: 14px;
|
|
line-height: 1.4;
|
|
border: 1px solid #444;
|
|
margin: 15px 0;
|
|
-webkit-font-feature-settings: "liga" 0;
|
|
font-feature-settings: "liga" 0;
|
|
letter-spacing: 0;
|
|
}
|
|
pre code {
|
|
background-color: transparent;
|
|
padding: 0;
|
|
border: none;
|
|
color: inherit;
|
|
font-size: inherit;
|
|
}
|
|
table {
|
|
border-collapse: collapse;
|
|
width: 100%;
|
|
margin: 15px 0;
|
|
font-size: 14px;
|
|
}
|
|
th, td {
|
|
border: 1px solid #ddd;
|
|
padding: 10px 12px;
|
|
text-align: left;
|
|
}
|
|
th {
|
|
background-color: #34495e;
|
|
color: white;
|
|
font-weight: 600;
|
|
}
|
|
tr:nth-child(even) {
|
|
background-color: #f9f9f9;
|
|
}
|
|
tr:hover {
|
|
background-color: #f1f1f1;
|
|
}
|
|
ul, ol {
|
|
padding-left: 25px;
|
|
}
|
|
li {
|
|
margin-bottom: 5px;
|
|
}
|
|
blockquote {
|
|
border-left: 4px solid #3498db;
|
|
margin: 15px 0;
|
|
padding: 10px 20px;
|
|
background-color: #f8f9fa;
|
|
color: #555;
|
|
}
|
|
hr {
|
|
border: none;
|
|
border-top: 2px solid #eee;
|
|
margin: 30px 0;
|
|
}
|
|
.toc {
|
|
background-color: #f8f9fa;
|
|
border: 1px solid #e9ecef;
|
|
border-radius: 6px;
|
|
padding: 20px;
|
|
margin-bottom: 30px;
|
|
}
|
|
.toc h2 {
|
|
margin-top: 0;
|
|
border-bottom: none;
|
|
font-size: 1.2em;
|
|
}
|
|
.toc ul {
|
|
list-style-type: none;
|
|
padding-left: 0;
|
|
}
|
|
.toc li {
|
|
margin-bottom: 8px;
|
|
}
|
|
.toc a {
|
|
color: #2c3e50;
|
|
}
|
|
.note {
|
|
background-color: #fff3cd;
|
|
border-left: 4px solid #ffc107;
|
|
padding: 10px 15px;
|
|
margin: 15px 0;
|
|
}
|
|
.warning {
|
|
background-color: #f8d7da;
|
|
border-left: 4px solid #dc3545;
|
|
padding: 10px 15px;
|
|
margin: 15px 0;
|
|
}
|
|
@media print {
|
|
body {
|
|
max-width: 100%;
|
|
padding: 20px;
|
|
}
|
|
pre {
|
|
white-space: pre-wrap;
|
|
word-wrap: break-word;
|
|
}
|
|
h2 {
|
|
page-break-before: auto;
|
|
}
|
|
pre, table {
|
|
page-break-inside: avoid;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1 id="update-pc-completeassetps1">Update-PC-CompleteAsset.ps1</h1>
|
|
<p>Local data collection script that runs directly on shopfloor PCs to collect comprehensive system information and send it to the ShopDB database.</p>
|
|
<h2 id="table-of-contents">Table of Contents</h2>
|
|
<ul>
|
|
<li><a href="#overview">Overview</a></li>
|
|
<li><a href="#api-integration">API Integration</a></li>
|
|
<li><a href="#prerequisites">Prerequisites</a></li>
|
|
<li><a href="#quick-start">Quick Start</a></li>
|
|
<li><a href="#parameters-reference">Parameters Reference</a></li>
|
|
<li><a href="#how-to-guides">How-To Guides</a></li>
|
|
<li><a href="#how-to-run-manually">Manual Execution</a></li>
|
|
<li><a href="#how-to-schedule-automatic-collection">Scheduled Tasks</a></li>
|
|
<li><a href="#how-to-deploy-via-group-policy">Group Policy Deployment</a></li>
|
|
<li><a href="#how-to-test-connectivity">Testing Connectivity</a></li>
|
|
<li><a href="#how-to-troubleshoot-issues">Troubleshooting</a></li>
|
|
<li><a href="#data-collected">Data Collected</a></li>
|
|
<li><a href="#pc-type-detection">PC Type Detection</a></li>
|
|
<li><a href="#supporting-files">Supporting Files</a></li>
|
|
<li><a href="#comparison-with-remote-script">Comparison with Remote Script</a></li>
|
|
</ul>
|
|
<hr>
|
|
<h2 id="overview">Overview</h2>
|
|
<p>This script runs locally on individual shopfloor PCs to collect comprehensive system information and send it to the ShopDB API. Unlike the remote collection script, this script runs in the local user context, allowing it to collect additional data like mapped drives and user-specific settings.</p>
|
|
<p><strong>Location:</strong> <code>S:\dt\shopfloor\scripts\complete-asset\Update-PC-CompleteAsset.ps1</code></p>
|
|
<p><strong>Use Cases:</strong></p>
|
|
<ul>
|
|
<li>Scheduled data collection on each PC</li>
|
|
<li>Startup script deployment</li>
|
|
<li>Manual inventory updates</li>
|
|
<li>Collecting data that requires local context</li>
|
|
</ul>
|
|
<p><strong>Advantages over Remote Collection:</strong></p>
|
|
<ul>
|
|
<li>Can detect V-Drive access (mapped drives)</li>
|
|
<li>Can access C:\Apps folder with user context</li>
|
|
<li>No WinRM configuration required on target</li>
|
|
<li>Works even if remote management is disabled</li>
|
|
</ul>
|
|
<hr>
|
|
<h2 id="api-integration">API Integration</h2>
|
|
<p>This script sends collected data to the ShopDB API:</p>
|
|
<h3 id="storing-pc-data">Storing PC Data</h3>
|
|
<pre><code>POST /api.asp?action=updateCompleteAsset</code></pre>
|
|
<p>Parameters include:</p>
|
|
<ul>
|
|
<li><code>hostname</code>, <code>serialNumber</code> (required)</li>
|
|
<li><code>manufacturer</code>, <code>model</code>, <code>osVersion</code></li>
|
|
<li><code>pcType</code> - Auto-detected based on installed software</li>
|
|
<li><code>networkInterfaces</code> - JSON array of network configurations</li>
|
|
<li><code>dncConfig</code> - DNC/FTP settings (if applicable)</li>
|
|
<li><code>installedApps</code> - Tracked applications with versions</li>
|
|
<li><code>hasVnc</code>, <code>hasWinRM</code> - Feature detection flags</li>
|
|
</ul>
|
|
<h3 id="updating-printer-mapping">Updating Printer Mapping</h3>
|
|
<p>If a default printer is detected:</p>
|
|
<pre><code>POST /api.asp?action=updatePrinterMapping</code></pre>
|
|
<p>Links the PC to its default network printer in ShopDB.</p>
|
|
<h3 id="updating-installed-applications">Updating Installed Applications</h3>
|
|
<pre><code>POST /api.asp?action=updateInstalledApps</code></pre>
|
|
<p>Updates the list of tracked applications (matched against <code>applications.csv</code>).</p>
|
|
<p><strong>See:</strong> <a href="ShopDB-API.html">ShopDB API Reference</a> for complete API documentation.</p>
|
|
<hr>
|
|
<h2 id="prerequisites">Prerequisites</h2>
|
|
<h3 id="on-the-target-pc">On the Target PC</h3>
|
|
<ol>
|
|
<li><strong>PowerShell 5.1 or higher</strong></li>
|
|
</ol>
|
|
<pre><code class="language-powershell"> $PSVersionTable.PSVersion</code></pre>
|
|
<ol>
|
|
<li><strong>Local administrator rights</strong> (for full data collection)</li>
|
|
</ol>
|
|
<ol>
|
|
<li><strong>Network access to ShopDB API</strong></li>
|
|
</ol>
|
|
<ul>
|
|
<li>HTTPS access to production server</li>
|
|
<li>Or HTTP access to development server</li>
|
|
</ul>
|
|
<ol>
|
|
<li><strong>TLS 1.2 support</strong> (Windows 10 has this by default)</li>
|
|
</ol>
|
|
<h3 id="script-files-required">Script Files Required</h3>
|
|
<p>The script depends on a helper file that should be in the same directory:</p>
|
|
<pre><code>complete-asset/
|
|
├── Update-PC-CompleteAsset.ps1 # Main script
|
|
├── Get-ShopfloorConfig.ps1 # Helper functions (auto-loaded)</code></pre>
|
|
<p>And the applications tracking file should be at:</p>
|
|
<pre><code>powershell/
|
|
└── applications.csv # Application definitions</code></pre>
|
|
<hr>
|
|
<h2 id="quick-start">Quick Start</h2>
|
|
<h3 id="step-1-copy-scripts-to-target-pc">Step 1: Copy Scripts to Target PC</h3>
|
|
<p>Copy the <code>complete-asset</code> folder to the target PC:</p>
|
|
<pre><code>C:\Scripts\complete-asset\
|
|
├── Update-PC-CompleteAsset.ps1
|
|
├── Get-ShopfloorConfig.ps1</code></pre>
|
|
<h3 id="step-2-open-powershell-as-administrator">Step 2: Open PowerShell as Administrator</h3>
|
|
<p>Right-click PowerShell and select "Run as administrator"</p>
|
|
<h3 id="step-3-navigate-to-script-directory">Step 3: Navigate to Script Directory</h3>
|
|
<pre><code class="language-powershell">cd C:\Scripts\complete-asset</code></pre>
|
|
<h3 id="step-4-run-the-script">Step 4: Run the Script</h3>
|
|
<pre><code class="language-powershell">.\Update-PC-CompleteAsset.ps1</code></pre>
|
|
<h3 id="step-5-verify-output">Step 5: Verify Output</h3>
|
|
<p>The script will display collection progress and API response:</p>
|
|
<pre><code>========================================
|
|
Complete PC Asset Collection & Storage
|
|
========================================
|
|
Computer: SHOPFLOOR-PC01
|
|
Dashboard: https://production-server/shopdb/api.asp
|
|
|
|
=== STEP 1: COLLECT SYSTEM INFO ===
|
|
Collecting comprehensive system information...
|
|
System Details:
|
|
Hostname: SHOPFLOOR-PC01
|
|
Manufacturer: Dell Inc.
|
|
Model: OptiPlex 7080
|
|
Serial: ABC1234
|
|
PC Type: Shopfloor
|
|
...
|
|
|
|
=== STEP 4: SEND TO DATABASE ===
|
|
[OK] Complete asset data stored in database!
|
|
PCID: 1234
|
|
Operation: update</code></pre>
|
|
<hr>
|
|
<h2 id="parameters-reference">Parameters Reference</h2>
|
|
<table>
|
|
<thead><tr>
|
|
<th>Parameter</th>
|
|
<th>Type</th>
|
|
<th>Required</th>
|
|
<th>Default</th>
|
|
<th>Description</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>-DashboardURL</code></td>
|
|
<td>string</td>
|
|
<td>No</td>
|
|
<td>Auto-detect</td>
|
|
<td>Override the API endpoint URL</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>-TestConnections</code></td>
|
|
<td>switch</td>
|
|
<td>No</td>
|
|
<td>False</td>
|
|
<td>Test connectivity only, no data collection</td>
|
|
</tr>
|
|
</tbody></table>
|
|
<hr>
|
|
<h2 id="how-to-guides">How-To Guides</h2>
|
|
<h3 id="how-to-run-manually">How to Run Manually</h3>
|
|
<h4 id="basic-execution">Basic Execution</h4>
|
|
<pre><code class="language-powershell"># Navigate to script directory
|
|
cd C:\Scripts\complete-asset
|
|
|
|
# Run with default settings (auto-detects production API)
|
|
.\Update-PC-CompleteAsset.ps1</code></pre>
|
|
<h4 id="specify-api-endpoint">Specify API Endpoint</h4>
|
|
<pre><code class="language-powershell"># Use development server
|
|
.\Update-PC-CompleteAsset.ps1 -DashboardURL "http://192.168.122.151:8080/api.asp"
|
|
|
|
# Use staging server
|
|
.\Update-PC-CompleteAsset.ps1 -DashboardURL "https://staging-server/shopdb/api.asp"</code></pre>
|
|
<h4 id="run-from-any-location">Run from Any Location</h4>
|
|
<pre><code class="language-powershell"># Full path execution
|
|
& "C:\Scripts\complete-asset\Update-PC-CompleteAsset.ps1"
|
|
|
|
# With UNC path
|
|
& "\\server\share\scripts\Update-PC-CompleteAsset.ps1"</code></pre>
|
|
<hr>
|
|
<h3 id="how-to-test-connectivity">How to Test Connectivity</h3>
|
|
<p>Before deploying widely, test that the PC can reach the API:</p>
|
|
<pre><code class="language-powershell">.\Update-PC-CompleteAsset.ps1 -TestConnections</code></pre>
|
|
<p><strong>Expected Output (Success):</strong></p>
|
|
<pre><code>=== CONNECTION TESTS ===
|
|
Skipping proxy test (not accessible from client PCs)
|
|
Testing dashboard connection...
|
|
Dashboard URL: https://production-server/shopdb/api.asp
|
|
[OK] Dashboard responded successfully
|
|
|
|
[OK] Dashboard connection working!</code></pre>
|
|
<p><strong>Expected Output (Failure):</strong></p>
|
|
<pre><code>=== CONNECTION TESTS ===
|
|
Testing dashboard connection...
|
|
Dashboard URL: https://production-server/shopdb/api.asp
|
|
[FAIL] Could not connect to dashboard
|
|
|
|
[FAIL] Dashboard connection failed</code></pre>
|
|
<p><strong>Troubleshooting Failed Connections:</strong></p>
|
|
<ol>
|
|
<li>Check network connectivity: <code>ping production-server</code></li>
|
|
<li>Check firewall rules for HTTPS (443)</li>
|
|
<li>Verify TLS configuration</li>
|
|
<li>Try with HTTP if HTTPS fails: <code>-DashboardURL "http://..."</code></li>
|
|
</ol>
|
|
<hr>
|
|
<h3 id="how-to-schedule-automatic-collection">How to Schedule Automatic Collection</h3>
|
|
<h4 id="option-1-windows-task-scheduler-gui">Option 1: Windows Task Scheduler (GUI)</h4>
|
|
<ol>
|
|
<li><strong>Open Task Scheduler</strong></li>
|
|
</ol>
|
|
<ul>
|
|
<li>Press <code>Win + R</code>, type <code>taskschd.msc</code>, press Enter</li>
|
|
</ul>
|
|
<ol>
|
|
<li><strong>Create New Task</strong></li>
|
|
</ol>
|
|
<ul>
|
|
<li>Click "Create Task" (not "Create Basic Task")</li>
|
|
</ul>
|
|
<ol>
|
|
<li><strong>General Tab</strong></li>
|
|
</ol>
|
|
<ul>
|
|
<li>Name: <code>ShopDB PC Collection</code></li>
|
|
<li>Description: <code>Collects PC data and sends to ShopDB</code></li>
|
|
<li>Security options:</li>
|
|
<li>"Run whether user is logged on or not"</li>
|
|
<li>"Run with highest privileges"</li>
|
|
<li>Configure for: Windows 10</li>
|
|
</ul>
|
|
<ol>
|
|
<li><strong>Triggers Tab</strong></li>
|
|
</ol>
|
|
<ul>
|
|
<li>New trigger: "At startup"</li>
|
|
<li>Delay task for: 5 minutes (allows network to connect)</li>
|
|
<li>Or: "Daily" at specific time</li>
|
|
</ul>
|
|
<ol>
|
|
<li><strong>Actions Tab</strong></li>
|
|
</ol>
|
|
<ul>
|
|
<li>Action: Start a program</li>
|
|
<li>Program: <code>powershell.exe</code></li>
|
|
<li>Arguments: <code>-ExecutionPolicy Bypass -WindowStyle Hidden -File "C:\Scripts\complete-asset\Update-PC-CompleteAsset.ps1"</code></li>
|
|
</ul>
|
|
<ol>
|
|
<li><strong>Conditions Tab</strong></li>
|
|
</ol>
|
|
<ul>
|
|
<li>Check "Start only if network connection is available"</li>
|
|
</ul>
|
|
<ol>
|
|
<li><strong>Settings Tab</strong></li>
|
|
</ol>
|
|
<ul>
|
|
<li>Allow task to be run on demand</li>
|
|
<li>Stop task if it runs longer than: 1 hour</li>
|
|
</ul>
|
|
<h4 id="option-2-powershell-script-to-create-task">Option 2: PowerShell Script to Create Task</h4>
|
|
<pre><code class="language-powershell"># Run this on target PC as administrator
|
|
$action = New-ScheduledTaskAction -Execute "powershell.exe" `
|
|
-Argument '-ExecutionPolicy Bypass -WindowStyle Hidden -File "C:\Scripts\complete-asset\Update-PC-CompleteAsset.ps1"'
|
|
|
|
$trigger = New-ScheduledTaskTrigger -AtStartup -RandomDelay (New-TimeSpan -Minutes 5)
|
|
|
|
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount -RunLevel Highest
|
|
|
|
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries `
|
|
-StartWhenAvailable -ExecutionTimeLimit (New-TimeSpan -Hours 1)
|
|
|
|
Register-ScheduledTask -TaskName "ShopDB PC Collection" `
|
|
-Action $action -Trigger $trigger -Principal $principal -Settings $settings `
|
|
-Description "Collects PC data and sends to ShopDB"</code></pre>
|
|
<h4 id="option-3-daily-collection-at-specific-time">Option 3: Daily Collection at Specific Time</h4>
|
|
<pre><code class="language-powershell"># Run daily at 6:00 AM
|
|
$trigger = New-ScheduledTaskTrigger -Daily -At 6am
|
|
|
|
Register-ScheduledTask -TaskName "ShopDB PC Collection" `
|
|
-Action $action -Trigger $trigger -Principal $principal -Settings $settings</code></pre>
|
|
<h4 id="verify-scheduled-task">Verify Scheduled Task</h4>
|
|
<pre><code class="language-powershell"># List the task
|
|
Get-ScheduledTask -TaskName "ShopDB PC Collection"
|
|
|
|
# Run the task manually to test
|
|
Start-ScheduledTask -TaskName "ShopDB PC Collection"
|
|
|
|
# Check task history
|
|
Get-ScheduledTaskInfo -TaskName "ShopDB PC Collection"</code></pre>
|
|
<hr>
|
|
<h3 id="how-to-deploy-via-group-policy">How to Deploy via Group Policy</h3>
|
|
<h4 id="step-1-prepare-network-share">Step 1: Prepare Network Share</h4>
|
|
<p>Create a network share accessible to all shopfloor PCs:</p>
|
|
<pre><code>\\fileserver\shopdb-scripts\
|
|
├── complete-asset\
|
|
│ ├── Update-PC-CompleteAsset.ps1
|
|
│ └── Get-ShopfloorConfig.ps1
|
|
└── applications.csv</code></pre>
|
|
<p>Set permissions:</p>
|
|
<ul>
|
|
<li>Domain Computers: Read & Execute</li>
|
|
<li>Authenticated Users: Read & Execute</li>
|
|
</ul>
|
|
<h4 id="step-2-create-gpo">Step 2: Create GPO</h4>
|
|
<ol>
|
|
<li>Open Group Policy Management Console</li>
|
|
<li>Create new GPO: "ShopDB PC Collection"</li>
|
|
<li>Link to OU containing shopfloor PCs</li>
|
|
</ol>
|
|
<h4 id="step-3-configure-computer-startup-script">Step 3: Configure Computer Startup Script</h4>
|
|
<p>Navigate to:</p>
|
|
<pre><code>Computer Configuration > Policies > Windows Settings > Scripts > Startup</code></pre>
|
|
<p>Add PowerShell script:</p>
|
|
<ul>
|
|
<li>Script Name: <code>\\fileserver\shopdb-scripts\complete-asset\Update-PC-CompleteAsset.ps1</code></li>
|
|
</ul>
|
|
<p>Or create a batch wrapper:</p>
|
|
<p><strong>startup-collection.bat:</strong></p>
|
|
<pre><code class="language-batch">@echo off
|
|
REM Wait for network
|
|
ping -n 30 127.0.0.1 > nul
|
|
|
|
REM Run collection script
|
|
powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File "\\fileserver\shopdb-scripts\complete-asset\Update-PC-CompleteAsset.ps1"</code></pre>
|
|
<h4 id="step-4-force-gpo-update-testing">Step 4: Force GPO Update (Testing)</h4>
|
|
<p>On target PC:</p>
|
|
<pre><code class="language-cmd">gpupdate /force</code></pre>
|
|
<p>Then restart to trigger startup script.</p>
|
|
<hr>
|
|
<h3 id="how-to-deploy-via-sccmendpoint-manager">How to Deploy via SCCM/Endpoint Manager</h3>
|
|
<h4 id="create-application">Create Application</h4>
|
|
<ol>
|
|
<li><strong>Detection Method:</strong></li>
|
|
</ol>
|
|
<pre><code class="language-powershell"> # Detect if last collection was within 24 hours
|
|
$logPath = "C:\Logs\CompleteAsset"
|
|
$recentLog = Get-ChildItem $logPath -Filter "*.log" |
|
|
Where-Object { $_.LastWriteTime -gt (Get-Date).AddHours(-24) }
|
|
if ($recentLog) { Write-Output "Installed" }</code></pre>
|
|
<ol>
|
|
<li><strong>Install Command:</strong></li>
|
|
</ol>
|
|
<pre><code class="language-cmd"> powershell.exe -ExecutionPolicy Bypass -File "Update-PC-CompleteAsset.ps1"</code></pre>
|
|
<ol>
|
|
<li><strong>Deployment Schedule:</strong></li>
|
|
</ol>
|
|
<ul>
|
|
<li>Recurring deployment: Daily</li>
|
|
<li>Run as: System</li>
|
|
</ul>
|
|
<hr>
|
|
<h3 id="how-to-troubleshoot-issues">How to Troubleshoot Issues</h3>
|
|
<h4 id="problem-script-runs-but-no-data-in-database">Problem: Script Runs But No Data in Database</h4>
|
|
<p><strong>Check 1: API Response</strong> Look at script output for API errors:</p>
|
|
<pre><code>[FAIL] Dashboard could not store data: Invalid hostname</code></pre>
|
|
<p><strong>Check 2: Network Connectivity</strong></p>
|
|
<pre><code class="language-powershell">.\Update-PC-CompleteAsset.ps1 -TestConnections</code></pre>
|
|
<p><strong>Check 3: Log Files</strong></p>
|
|
<pre><code class="language-powershell"># Find recent log files
|
|
Get-ChildItem "C:\Logs\CompleteAsset" -Recurse | Sort-Object LastWriteTime -Descending | Select -First 5</code></pre>
|
|
<hr>
|
|
<h4 id="problem-pc-type-detection-wrong">Problem: PC Type Detection Wrong</h4>
|
|
<p><strong>Check installed applications:</strong></p>
|
|
<pre><code class="language-powershell"># List installed apps the script sees
|
|
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |
|
|
Where-Object { $_.DisplayName } |
|
|
Select-Object DisplayName |
|
|
Sort-Object DisplayName</code></pre>
|
|
<p><strong>Verify detection criteria:</strong></p>
|
|
<ul>
|
|
<li>Dashboard: Look for "GE Aerospace Dashboard"</li>
|
|
<li>CMM: Look for "PC-DMIS" or "PCDMIS" or "goCMM" or "DODA"</li>
|
|
<li>Wax Trace: Look for "FormTracePak" or "FormStatusMonitor"</li>
|
|
</ul>
|
|
<hr>
|
|
<h4 id="problem-dnc-configuration-not-detected">Problem: DNC Configuration Not Detected</h4>
|
|
<p><strong>Check registry paths:</strong></p>
|
|
<pre><code class="language-powershell"># Check 32-bit registry
|
|
Test-Path "HKLM:\SOFTWARE\GE Aircraft Engines"
|
|
|
|
# Check 64-bit registry
|
|
Test-Path "HKLM:\SOFTWARE\WOW6432Node\GE Aircraft Engines"
|
|
|
|
# List DNC settings
|
|
Get-ChildItem "HKLM:\SOFTWARE\WOW6432Node\GE Aircraft Engines\DNC" -Recurse</code></pre>
|
|
<hr>
|
|
<h4 id="problem-serial-ports-not-detected">Problem: Serial Ports Not Detected</h4>
|
|
<p><strong>Check Win32_SerialPort:</strong></p>
|
|
<pre><code class="language-powershell">Get-CimInstance -ClassName Win32_SerialPort | Select DeviceID, Description</code></pre>
|
|
<p>If empty, serial ports may be virtual or use different drivers.</p>
|
|
<hr>
|
|
<h4 id="problem-vnc-not-detected">Problem: VNC Not Detected</h4>
|
|
<p><strong>Check manually:</strong></p>
|
|
<pre><code class="language-powershell"># Check registry
|
|
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" |
|
|
Where-Object { $_.DisplayName -like "*VNC*" }
|
|
|
|
# Check service
|
|
Get-Service -Name "vncserver*"</code></pre>
|
|
<hr>
|
|
<h4 id="problem-script-errors-on-startup">Problem: Script Errors on Startup</h4>
|
|
<p><strong>Check execution policy:</strong></p>
|
|
<pre><code class="language-powershell">Get-ExecutionPolicy
|
|
# Should be RemoteSigned or Bypass
|
|
|
|
# Fix:
|
|
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine</code></pre>
|
|
<p><strong>Check script signing:</strong> If policy requires signed scripts, sign the script or use:</p>
|
|
<pre><code class="language-powershell">powershell.exe -ExecutionPolicy Bypass -File "script.ps1"</code></pre>
|
|
<hr>
|
|
<h2 id="data-collected">Data Collected</h2>
|
|
<h3 id="basic-system-information">Basic System Information</h3>
|
|
<table>
|
|
<thead><tr>
|
|
<th>Field</th>
|
|
<th>Source</th>
|
|
<th>Example</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>Hostname</td>
|
|
<td><code>$env:COMPUTERNAME</code></td>
|
|
<td><code>SHOPFLOOR-PC01</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Serial Number</td>
|
|
<td>CIM_BIOSElement</td>
|
|
<td><code>ABC1234</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Service Tag</td>
|
|
<td>CIM_BIOSElement</td>
|
|
<td><code>ABC1234</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Manufacturer</td>
|
|
<td>CIM_ComputerSystem</td>
|
|
<td><code>Dell Inc.</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Model</td>
|
|
<td>CIM_ComputerSystem</td>
|
|
<td><code>OptiPlex 7080</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Total Physical Memory</td>
|
|
<td>CIM_ComputerSystem</td>
|
|
<td><code>16.0</code> GB</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Domain Role</td>
|
|
<td>CIM_ComputerSystem</td>
|
|
<td><code>1</code> (Member Workstation)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>OS Version</td>
|
|
<td>CIM_OperatingSystem</td>
|
|
<td><code>Windows 10 Enterprise</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Last Boot Time</td>
|
|
<td>CIM_OperatingSystem</td>
|
|
<td><code>2025-01-15 08:30:00</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Current Time Zone</td>
|
|
<td>Get-TimeZone</td>
|
|
<td><code>Eastern Standard Time</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Logged In User</td>
|
|
<td>CIM_ComputerSystem</td>
|
|
<td><code>DOMAIN\jsmith</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>PC Type</td>
|
|
<td>Software Detection</td>
|
|
<td><code>Shopfloor</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Machine No</td>
|
|
<td>Hostname/Registry</td>
|
|
<td><code>M0612</code></td>
|
|
</tr>
|
|
</tbody></table>
|
|
<h3 id="dnc-configuration-shopfloor-pcs">DNC Configuration (Shopfloor PCs)</h3>
|
|
<table>
|
|
<thead><tr>
|
|
<th>Field</th>
|
|
<th>Registry Path</th>
|
|
<th>Example</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>Site</td>
|
|
<td><code>DNC\General\Site</code></td>
|
|
<td><code>WJF</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>CNC</td>
|
|
<td><code>DNC\General\Cnc</code></td>
|
|
<td><code>FANUC</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>NcIF</td>
|
|
<td><code>DNC\General\NcIF</code></td>
|
|
<td><code>FOCAS2</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Machine No</td>
|
|
<td><code>DNC\General\MachineNo</code></td>
|
|
<td><code>M0612</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Host Type</td>
|
|
<td><code>DNC\General\HostType</code></td>
|
|
<td><code>MX</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>FTP Primary</td>
|
|
<td><code>DNC\MX\FtpHostPrimary</code></td>
|
|
<td><code>10.134.50.10</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>FTP Secondary</td>
|
|
<td><code>DNC\MX\FtpHostSecondary</code></td>
|
|
<td><code>10.134.50.11</code></td>
|
|
</tr>
|
|
</tbody></table>
|
|
<h3 id="ge-registry-information">GE Registry Information</h3>
|
|
<table>
|
|
<thead><tr>
|
|
<th>Field</th>
|
|
<th>Source</th>
|
|
<th>Example</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>Registry 32-bit</td>
|
|
<td>Path exists check</td>
|
|
<td><code>true</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Registry 64-bit</td>
|
|
<td>Path exists check</td>
|
|
<td><code>true</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Dual Path Enabled</td>
|
|
<td>eFocas registry</td>
|
|
<td><code>true</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Path 1 Name</td>
|
|
<td>eFocas registry</td>
|
|
<td><code>Primary</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Path 2 Name</td>
|
|
<td>eFocas registry</td>
|
|
<td><code>Backup</code></td>
|
|
</tr>
|
|
</tbody></table>
|
|
<h3 id="network-interfaces">Network Interfaces</h3>
|
|
<table>
|
|
<thead><tr>
|
|
<th>Field</th>
|
|
<th>Source</th>
|
|
<th>Example</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>Interface Name</td>
|
|
<td>Get-NetAdapter</td>
|
|
<td><code>Ethernet0</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>IP Address</td>
|
|
<td>Get-NetIPConfiguration</td>
|
|
<td><code>10.134.50.101</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Subnet Mask</td>
|
|
<td>Get-NetIPConfiguration</td>
|
|
<td><code>24</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Default Gateway</td>
|
|
<td>Get-NetIPConfiguration</td>
|
|
<td><code>10.134.50.1</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>MAC Address</td>
|
|
<td>Get-NetAdapter</td>
|
|
<td><code>00-11-22-33-44-55</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Is DHCP</td>
|
|
<td>Get-NetIPConfiguration</td>
|
|
<td><code>false</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Is Active</td>
|
|
<td>Get-NetAdapter</td>
|
|
<td><code>true</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Is Machine Network</td>
|
|
<td>IP pattern match</td>
|
|
<td><code>false</code> (192.168.<em> or 100.0.0.</em> for CMM)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Is Primary</td>
|
|
<td>IP pattern match</td>
|
|
<td><code>true</code> (10.134.*)</td>
|
|
</tr>
|
|
</tbody></table>
|
|
<h3 id="additional-data">Additional Data</h3>
|
|
<table>
|
|
<thead><tr>
|
|
<th>Field</th>
|
|
<th>Source</th>
|
|
<th>Example</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>Serial Ports</td>
|
|
<td>Win32_SerialPort</td>
|
|
<td><code>COM1, COM2</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Has VNC</td>
|
|
<td>Registry + Service check</td>
|
|
<td><code>true</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Default Printer FQDN</td>
|
|
<td>Win32_Printer</td>
|
|
<td><code>10.80.92.53</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td>All Installed Apps</td>
|
|
<td>Registry (HKLM + HKU)</td>
|
|
<td>127 apps</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Tracked Applications</td>
|
|
<td>CSV matching</td>
|
|
<td><code>UDC v2.1, Tanium v7.4</code></td>
|
|
</tr>
|
|
</tbody></table>
|
|
<hr>
|
|
<h2 id="pc-type-detection">PC Type Detection</h2>
|
|
<p>The script detects PC type based on installed software in this priority order:</p>
|
|
<table>
|
|
<thead><tr>
|
|
<th>Priority</th>
|
|
<th>Type</th>
|
|
<th>Detection Method</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>1</td>
|
|
<td>Dashboard</td>
|
|
<td><code>GE Aerospace Dashboard</code> installed</td>
|
|
</tr>
|
|
<tr>
|
|
<td>2</td>
|
|
<td>Lobby Display</td>
|
|
<td><code>GE Aerospace Lobby Display</code> installed</td>
|
|
</tr>
|
|
<tr>
|
|
<td>3</td>
|
|
<td>CMM</td>
|
|
<td>PC-DMIS, goCMM, or DODA software</td>
|
|
</tr>
|
|
<tr>
|
|
<td>4</td>
|
|
<td>Wax Trace</td>
|
|
<td>FormTracePak or FormStatusMonitor</td>
|
|
</tr>
|
|
<tr>
|
|
<td>5</td>
|
|
<td>Keyence</td>
|
|
<td>VR-3000, VR-5000, or VR-6000</td>
|
|
</tr>
|
|
<tr>
|
|
<td>6</td>
|
|
<td>EAS1000</td>
|
|
<td>GageCal or NI Software</td>
|
|
</tr>
|
|
<tr>
|
|
<td>7</td>
|
|
<td>Genspect</td>
|
|
<td>Genspect measuring software</td>
|
|
</tr>
|
|
<tr>
|
|
<td>8</td>
|
|
<td>Heat Treat</td>
|
|
<td>HeatTreat application</td>
|
|
</tr>
|
|
<tr>
|
|
<td>9</td>
|
|
<td>Inspection</td>
|
|
<td>Machine #: 0612, 0613, 0615, 8003</td>
|
|
</tr>
|
|
<tr>
|
|
<td>10</td>
|
|
<td>Shopfloor</td>
|
|
<td>Default for domain shop PCs</td>
|
|
</tr>
|
|
<tr>
|
|
<td>11</td>
|
|
<td>Engineer</td>
|
|
<td>Has C:\Apps AND V-Drive access</td>
|
|
</tr>
|
|
<tr>
|
|
<td>12</td>
|
|
<td>Standard</td>
|
|
<td>Default for other domain PCs</td>
|
|
</tr>
|
|
</tbody></table>
|
|
<p><strong>Note:</strong> Priority matters - a PC with both Dashboard and CMM software will be classified as "Dashboard".</p>
|
|
<hr>
|
|
<h2 id="supporting-files">Supporting Files</h2>
|
|
<h3 id="required-directory-structure">Required Directory Structure</h3>
|
|
<pre><code>S:\dt\shopfloor\scripts\complete-asset\
|
|
├── Update-PC-CompleteAsset.ps1 # Main script
|
|
└── Get-ShopfloorConfig.ps1 # Helper functions (REQUIRED)</code></pre>
|
|
<p><strong>Important:</strong> Both files must be in the same directory. The main script dot-sources the helper:</p>
|
|
<pre><code class="language-powershell">. "$PSScriptRoot\Get-ShopfloorConfig.ps1"</code></pre>
|
|
<h3 id="get-shopfloorconfigps1">Get-ShopfloorConfig.ps1</h3>
|
|
<p>Helper script providing these functions:</p>
|
|
<table>
|
|
<thead><tr>
|
|
<th>Function</th>
|
|
<th>Purpose</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><code>Get-NetworkInterfaceConfig</code></td>
|
|
<td>Network adapters with IsPrimary/IsMachineNetwork</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>Get-SerialPortConfig</code></td>
|
|
<td>DNC serial port settings</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>Get-GERegistryInfo</code></td>
|
|
<td>GE Aircraft Engines registry (DualPath, paths)</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>Get-DNCConfig</code></td>
|
|
<td>DNC general configuration</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>Get-ShopfloorConfigurations</code></td>
|
|
<td>Combines all above into one call</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>Get-InstalledApplications</code></td>
|
|
<td>Detects UDC/CLM processes</td>
|
|
</tr>
|
|
</tbody></table>
|
|
<h3 id="applicationscsv">applications.csv</h3>
|
|
<p>Defines tracked applications for version tracking:</p>
|
|
<pre><code class="language-csv">app_id,app_name,search_patterns
|
|
2,UDC,"Universal Data Collector"
|
|
4,CLM,"Cell Level Manager|ppdcs"
|
|
77,HeatTreat,"HeatTreat"
|
|
82,GE Aerospace Dashboard,"GE Aerospace Dashboard"
|
|
83,GE Aerospace Lobby Display,"GE Aerospace Lobby Display"</code></pre>
|
|
<p><strong>Location:</strong> <code>S:\dt\shopfloor\scripts\applications.csv</code></p>
|
|
<hr>
|
|
<h2 id="comparison-with-remote-script">Comparison with Remote Script</h2>
|
|
<table>
|
|
<thead><tr>
|
|
<th>Feature</th>
|
|
<th>Local Script</th>
|
|
<th>Remote Script</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>Execution</td>
|
|
<td>On target PC</td>
|
|
<td>From admin workstation</td>
|
|
</tr>
|
|
<tr>
|
|
<td>WinRM Required</td>
|
|
<td>No</td>
|
|
<td>Yes</td>
|
|
</tr>
|
|
<tr>
|
|
<td>V-Drive Detection</td>
|
|
<td>Yes</td>
|
|
<td>No</td>
|
|
</tr>
|
|
<tr>
|
|
<td>C:\Apps Detection</td>
|
|
<td>Yes</td>
|
|
<td>Limited</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Batch Operations</td>
|
|
<td>No (one PC)</td>
|
|
<td>Yes (many PCs)</td>
|
|
</tr>
|
|
<tr>
|
|
<td>User Context</td>
|
|
<td>Local user</td>
|
|
<td>WinRM context</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Admin Rights</td>
|
|
<td>Needed locally</td>
|
|
<td>Needed remotely</td>
|
|
</tr>
|
|
</tbody></table>
|
|
</body>
|
|
</html> |