Files
powershell-scripts/docs/Update-ShopfloorPCs-Remote.html
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

864 lines
27 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-ShopfloorPCs-Remote.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-shopfloorpcs-remoteps1">Update-ShopfloorPCs-Remote.ps1</h1>
<p>Remote data collection script that gathers PC information from shopfloor PCs via WinRM and updates 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="#data-collected">Data Collected</a></li>
<li><a href="#pc-type-detection">PC Type Detection</a></li>
<li><a href="#troubleshooting">Troubleshooting</a></li>
<li><a href="#advanced-usage">Advanced Usage</a></li>
<li><a href="#script-files">Script Files</a></li>
</ul>
<hr>
<h2 id="overview">Overview</h2>
<p>This script remotely connects to shopfloor PCs using Windows Remote Management (WinRM) to collect comprehensive system information including hardware details, network configuration, DNC settings, and installed applications. The collected data is then sent to the ShopDB API for asset tracking.</p>
<p><strong>Location:</strong> <code>S:\dt\shopfloor\scripts\remote-execution\Update-ShopfloorPCs-Remote.ps1</code></p>
<p><strong>Use Cases:</strong></p>
<ul>
<li>Bulk asset inventory updates</li>
<li>Automated PC discovery and classification</li>
<li>Scheduled data collection from all shopfloor PCs</li>
<li>Targeted updates for specific machines or groups</li>
</ul>
<hr>
<h2 id="api-integration">API Integration</h2>
<p>This script interacts with the ShopDB API (<code>api.asp</code>) for both retrieving PC lists and storing collected data.</p>
<h3 id="retrieving-pc-lists">Retrieving PC Lists</h3>
<p>When using <code>-All</code>, the script queries the API to get the list of shopfloor PCs:</p>
<pre><code>GET /api.asp?action=getShopfloorPCs</code></pre>
<p>This returns all active PCs with 10.134.<em>.</em> IP addresses. Optional filters:</p>
<ul>
<li><code>pctypeid</code> - Filter by PC type (1=Shopfloor, 2=CMM, etc.)</li>
<li><code>businessunitid</code> - Filter by business unit</li>
</ul>
<h3 id="retrieving-high-uptime-pcs">Retrieving High Uptime PCs</h3>
<p>When using <code>-Reboot</code>, the script queries:</p>
<pre><code>GET /api.asp?action=getHighUptimePCs&amp;minUptime=30</code></pre>
<p>This returns PCs that haven't been rebooted in the specified number of days.</p>
<h3 id="storing-collected-data">Storing Collected Data</h3>
<p>After collecting data from each PC, the script POSTs to:</p>
<pre><code>POST /api.asp?action=updateCompleteAsset</code></pre>
<p>With parameters including hostname, serial number, network interfaces, DNC config, and installed applications.</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-your-workstation-where-you-run-the-script">On Your Workstation (Where You Run the Script)</h3>
<ol>
<li><strong>PowerShell 5.1 or higher</strong></li>
</ol>
<pre><code class="language-powershell"> $PSVersionTable.PSVersion</code></pre>
<ol>
<li><strong>Network access to target PCs</strong> on port 5985 (HTTP) or 5986 (HTTPS)</li>
</ol>
<ol>
<li><strong>Domain admin or local admin credentials</strong> for target PCs</li>
</ol>
<h3 id="on-target-pcs">On Target PCs</h3>
<ol>
<li><strong>WinRM must be enabled</strong></li>
</ol>
<pre><code class="language-powershell"> # Check if WinRM is running
Get-Service WinRM
# Enable WinRM (run as admin on target PC)
Enable-PSRemoting -Force</code></pre>
<ol>
<li><strong>Firewall rules</strong> allowing WinRM traffic (TCP 5985/5986)</li>
</ol>
<h3 id="winrm-trusted-hosts-setup">WinRM Trusted Hosts Setup</h3>
<p>If your workstation is not domain-joined or targets are in a different domain:</p>
<pre><code class="language-powershell"># Option 1: Use the script&#x27;s built-in setup
.\Update-ShopfloorPCs-Remote.ps1 -SetupTrustedHosts
# Option 2: Manual setup (run as admin)
Set-Item WSMan:\localhost\Client\TrustedHosts -Value &quot;192.168.*&quot; -Force
Set-Item WSMan:\localhost\Client\TrustedHosts -Value &quot;10.134.*&quot; -Concatenate -Force</code></pre>
<hr>
<h2 id="quick-start">Quick Start</h2>
<h3 id="step-1-open-powershell-as-administrator">Step 1: Open PowerShell as Administrator</h3>
<pre><code class="language-powershell"># Navigate to script directory
cd C:\Path\To\powershell\remote-execution</code></pre>
<h3 id="step-2-get-credentials">Step 2: Get Credentials</h3>
<pre><code class="language-powershell"># Store credentials for the session
$cred = Get-Credential -Message &quot;Enter domain admin credentials&quot;</code></pre>
<h3 id="step-3-run-your-first-collection">Step 3: Run Your First Collection</h3>
<pre><code class="language-powershell"># Test with a single PC
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;SHOPFLOOR-PC01&quot; -Credential $cred</code></pre>
<h3 id="step-4-verify-results">Step 4: Verify Results</h3>
<p>Check the ShopDB database or web interface to confirm the PC data was updated.</p>
<hr>
<h2 id="parameters-reference">Parameters Reference</h2>
<h3 id="targeting-parameters">Targeting Parameters</h3>
<table>
<thead><tr>
<th>Parameter</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td><code>-ComputerName</code></td>
<td>string[]</td>
<td>One or more computer names to target</td>
</tr>
<tr>
<td><code>-All</code></td>
<td>switch</td>
<td>Query ShopDB for all shopfloor PCs</td>
</tr>
</tbody></table>
<h3 id="authentication-parameters">Authentication Parameters</h3>
<table>
<thead><tr>
<th>Parameter</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td><code>-Credential</code></td>
<td>PSCredential</td>
<td>Prompt</td>
<td>Admin credentials for remote access</td>
</tr>
<tr>
<td><code>-UseSSL</code></td>
<td>switch</td>
<td>False</td>
<td>Use HTTPS (port 5986) instead of HTTP</td>
</tr>
</tbody></table>
<h3 id="api-parameters">API Parameters</h3>
<table>
<thead><tr>
<th>Parameter</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td><code>-ApiUrl</code></td>
<td>string</td>
<td>Production URL</td>
<td>ShopDB API endpoint</td>
</tr>
</tbody></table>
<h3 id="network-parameters">Network Parameters</h3>
<table>
<thead><tr>
<th>Parameter</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td><code>-DnsSuffix</code></td>
<td>string</td>
<td>logon.ds.ge.com</td>
<td>DNS suffix for FQDN resolution</td>
</tr>
<tr>
<td><code>-SkipDnsLookup</code></td>
<td>switch</td>
<td>False</td>
<td>Use hostnames as-is without DNS</td>
</tr>
<tr>
<td><code>-ThrottleLimit</code></td>
<td>int</td>
<td>25</td>
<td>Max concurrent remote sessions</td>
</tr>
</tbody></table>
<h3 id="reboot-parameters">Reboot Parameters</h3>
<table>
<thead><tr>
<th>Parameter</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td><code>-Reboot</code></td>
<td>switch</td>
<td>Enable reboot mode</td>
</tr>
<tr>
<td><code>-MinUptimeDays</code></td>
<td>int</td>
<td>Minimum uptime threshold for reboot</td>
</tr>
<tr>
<td><code>-Force</code></td>
<td>switch</td>
<td>Skip confirmation prompts</td>
</tr>
<tr>
<td><code>-WhatIf</code></td>
<td>switch</td>
<td>Preview without executing</td>
</tr>
</tbody></table>
<h3 id="setup-parameters">Setup Parameters</h3>
<table>
<thead><tr>
<th>Parameter</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td><code>-SetupTrustedHosts</code></td>
<td>switch</td>
<td>Configure WinRM trusted hosts</td>
</tr>
</tbody></table>
<hr>
<h2 id="how-to-guides">How-To Guides</h2>
<h3 id="how-to-update-a-single-pc">How to Update a Single PC</h3>
<p><strong>Scenario:</strong> You need to update asset data for one specific PC.</p>
<pre><code class="language-powershell"># Basic usage
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;G1ZTNCX3ESF&quot;
# With credentials (avoids prompt)
$cred = Get-Credential
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;G1ZTNCX3ESF&quot; -Credential $cred
# Using IP address instead of hostname
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;10.134.50.101&quot; -SkipDnsLookup</code></pre>
<p><strong>Expected Output:</strong></p>
<pre><code>Connecting to G1ZTNCX3ESF...
[OK] Connected successfully
Collecting system information...
Hostname: G1ZTNCX3ESF
Serial: ABC1234
PC Type: Shopfloor
Sending data to API...
[OK] Data stored successfully (PCID: 1234)</code></pre>
<hr>
<h3 id="how-to-update-multiple-pcs">How to Update Multiple PCs</h3>
<p><strong>Scenario:</strong> You have a list of PCs that need updating.</p>
<pre><code class="language-powershell"># Array of computer names
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;PC01&quot;,&quot;PC02&quot;,&quot;PC03&quot;,&quot;PC04&quot;
# From a variable
$pcs = @(&quot;SHOPFLOOR-01&quot;, &quot;SHOPFLOOR-02&quot;, &quot;SHOPFLOOR-03&quot;)
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName $pcs -Credential $cred
# From a text file (one hostname per line)
$pcs = Get-Content &quot;C:\Lists\shopfloor-pcs.txt&quot;
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName $pcs -Credential $cred</code></pre>
<p><strong>Adjusting Concurrency:</strong></p>
<pre><code class="language-powershell"># Slower network - reduce concurrent connections
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName $pcs -ThrottleLimit 5
# Fast network - increase concurrent connections
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName $pcs -ThrottleLimit 50</code></pre>
<hr>
<h3 id="how-to-update-all-shopfloor-pcs">How to Update All Shopfloor PCs</h3>
<p><strong>Scenario:</strong> Scheduled full inventory update of all shopfloor PCs.</p>
<pre><code class="language-powershell"># Update all PCs from ShopDB database
.\Update-ShopfloorPCs-Remote.ps1 -All -Credential $cred
# With lower throttle for off-hours
.\Update-ShopfloorPCs-Remote.ps1 -All -Credential $cred -ThrottleLimit 10</code></pre>
<p><strong>Scheduling with Task Scheduler:</strong></p>
<ol>
<li>Create a batch file <code>run-collection.bat</code>:</li>
</ol>
<pre><code class="language-batch"> @echo off
powershell.exe -ExecutionPolicy Bypass -File &quot;C:\Scripts\Update-ShopfloorPCs-Remote.ps1&quot; -All</code></pre>
<ol>
<li>Create scheduled task:</li>
</ol>
<ul>
<li>Trigger: Daily at 2:00 AM</li>
<li>Action: Run <code>run-collection.bat</code></li>
<li>Run as: Service account with admin rights</li>
</ul>
<hr>
<h3 id="how-to-reboot-pcs-with-high-uptime">How to Reboot PCs with High Uptime</h3>
<p><strong>Scenario:</strong> Reboot PCs that haven't been restarted in 30+ days.</p>
<pre><code class="language-powershell"># Step 1: Preview which PCs would be rebooted
.\Update-ShopfloorPCs-Remote.ps1 -Reboot -MinUptimeDays 30 -WhatIf
# Output shows:
# Would reboot: SHOPFLOOR-01 (Uptime: 45 days)
# Would reboot: SHOPFLOOR-02 (Uptime: 62 days)
# Would skip: SHOPFLOOR-03 (Uptime: 12 days)
# Step 2: Execute with confirmation
.\Update-ShopfloorPCs-Remote.ps1 -Reboot -MinUptimeDays 30 -Credential $cred
# Prompts: &quot;Reboot 2 PCs? [Y/N]&quot;
# Step 3: Or execute without confirmation
.\Update-ShopfloorPCs-Remote.ps1 -Reboot -MinUptimeDays 30 -Force -Credential $cred</code></pre>
<p><strong>Best Practices for Reboots:</strong></p>
<ul>
<li>Always run <code>-WhatIf</code> first</li>
<li>Schedule during maintenance windows</li>
<li>Start with higher threshold (60 days) then reduce</li>
<li>Monitor for production impact</li>
</ul>
<hr>
<h3 id="how-to-set-up-winrm-trusted-hosts">How to Set Up WinRM Trusted Hosts</h3>
<p><strong>Scenario:</strong> Your workstation can't connect to shopfloor PCs.</p>
<pre><code class="language-powershell"># Use built-in setup (configures common shopfloor subnets)
.\Update-ShopfloorPCs-Remote.ps1 -SetupTrustedHosts
# Verify configuration
Get-Item WSMan:\localhost\Client\TrustedHosts
# Manual addition of specific subnet
Set-Item WSMan:\localhost\Client\TrustedHosts -Value &quot;10.134.*&quot; -Force</code></pre>
<hr>
<h3 id="how-to-use-different-api-endpoints">How to Use Different API Endpoints</h3>
<p><strong>Scenario:</strong> Testing against development or staging environments.</p>
<pre><code class="language-powershell"># Development environment
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;TEST-PC&quot; -ApiUrl &quot;http://192.168.122.151:8080/api.asp&quot;
# Staging environment
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;TEST-PC&quot; -ApiUrl &quot;https://staging-server/shopdb/api.asp&quot;</code></pre>
<hr>
<h3 id="how-to-handle-dns-resolution-issues">How to Handle DNS Resolution Issues</h3>
<p><strong>Scenario:</strong> PC hostnames aren't resolving correctly.</p>
<pre><code class="language-powershell"># Skip DNS and use hostnames as-is
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;SHOPFLOOR-01&quot; -SkipDnsLookup
# Use different DNS suffix
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;SHOPFLOOR-01&quot; -DnsSuffix &quot;shopfloor.local&quot;
# Use IP addresses directly
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;10.134.50.101&quot; -SkipDnsLookup</code></pre>
<hr>
<h3 id="how-to-use-secure-connections-ssl">How to Use Secure Connections (SSL)</h3>
<p><strong>Scenario:</strong> Security requirements mandate encrypted WinRM connections.</p>
<pre><code class="language-powershell"># Enable SSL for WinRM (uses port 5986)
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;SECURE-PC&quot; -UseSSL -Credential $cred</code></pre>
<p><strong>Prerequisites for SSL:</strong></p>
<ul>
<li>Valid certificate on target PC</li>
<li>WinRM HTTPS listener configured</li>
<li>Port 5986 open in firewall</li>
</ul>
<hr>
<h2 id="data-collected">Data Collected</h2>
<h3 id="basic-system-information">Basic System Information</h3>
<table>
<thead><tr>
<th>Field</th>
<th>Example</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td>Hostname</td>
<td><code>G1ZTNCX3ESF</code></td>
<td>Computer name</td>
</tr>
<tr>
<td>Serial Number</td>
<td><code>ABC1234567</code></td>
<td>BIOS serial</td>
</tr>
<tr>
<td>Service Tag</td>
<td><code>ABC1234567</code></td>
<td>Dell service tag</td>
</tr>
<tr>
<td>Manufacturer</td>
<td><code>Dell Inc.</code></td>
<td>System manufacturer</td>
</tr>
<tr>
<td>Model</td>
<td><code>OptiPlex 7080</code></td>
<td>System model</td>
</tr>
<tr>
<td>OS Version</td>
<td><code>Microsoft Windows 10 Enterprise</code></td>
<td>Windows edition</td>
</tr>
<tr>
<td>Last Boot Time</td>
<td><code>2025-01-15 08:30:00</code></td>
<td>Last restart</td>
</tr>
<tr>
<td>Total Physical Memory</td>
<td><code>16.0</code></td>
<td>RAM in GB</td>
</tr>
<tr>
<td>Domain Role</td>
<td><code>1</code></td>
<td>0=Standalone, 1=Member Workstation</td>
</tr>
<tr>
<td>Current Time Zone</td>
<td><code>Eastern Standard Time</code></td>
<td>System timezone</td>
</tr>
<tr>
<td>Logged In User</td>
<td><code>DOMAIN\jsmith</code></td>
<td>Current user</td>
</tr>
</tbody></table>
<h3 id="dnc-configuration">DNC Configuration</h3>
<table>
<thead><tr>
<th>Field</th>
<th>Example</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td>Site</td>
<td><code>WJF</code></td>
<td>GE site code</td>
</tr>
<tr>
<td>CNC</td>
<td><code>FANUC</code></td>
<td>CNC controller type</td>
</tr>
<tr>
<td>NcIF</td>
<td><code>FOCAS2</code></td>
<td>NC interface protocol</td>
</tr>
<tr>
<td>Machine No</td>
<td><code>M0612</code></td>
<td>GE machine number</td>
</tr>
<tr>
<td>FTP Primary</td>
<td><code>10.134.50.10</code></td>
<td>Primary FTP server</td>
</tr>
<tr>
<td>FTP Secondary</td>
<td><code>10.134.50.11</code></td>
<td>Backup FTP server</td>
</tr>
</tbody></table>
<h3 id="network-interfaces">Network Interfaces</h3>
<table>
<thead><tr>
<th>Field</th>
<th>Example</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td>Interface Name</td>
<td><code>Ethernet0</code></td>
<td>Adapter name</td>
</tr>
<tr>
<td>IP Address</td>
<td><code>10.134.50.101</code></td>
<td>IPv4 address</td>
</tr>
<tr>
<td>Subnet Mask</td>
<td><code>24</code></td>
<td>CIDR prefix</td>
</tr>
<tr>
<td>Default Gateway</td>
<td><code>10.134.50.1</code></td>
<td>Gateway</td>
</tr>
<tr>
<td>MAC Address</td>
<td><code>00-11-22-33-44-55</code></td>
<td>Physical address</td>
</tr>
<tr>
<td>Is Primary</td>
<td><code>1</code></td>
<td>10.134.<em>.</em> network</td>
</tr>
<tr>
<td>Is Machine Network</td>
<td><code>0</code></td>
<td>192.168.<em>.</em> or 100.0.0.* network (CMM)</td>
</tr>
</tbody></table>
<h3 id="additional-data">Additional Data</h3>
<table>
<thead><tr>
<th>Field</th>
<th>Example</th>
<th>Description</th>
</tr></thead>
<tbody>
<tr>
<td>Serial Ports</td>
<td><code>COM1, COM2</code></td>
<td>Available COM ports</td>
</tr>
<tr>
<td>Has VNC</td>
<td><code>1</code></td>
<td>VNC Server installed</td>
</tr>
<tr>
<td>Default Printer</td>
<td><code>10.80.92.53</code></td>
<td>Network printer port</td>
</tr>
<tr>
<td>All Installed Apps</td>
<td><code>Microsoft Office...</code></td>
<td>Complete app list</td>
</tr>
</tbody></table>
<hr>
<h2 id="pc-type-detection">PC Type Detection</h2>
<p>The script automatically classifies PCs based on installed software:</p>
<table>
<thead><tr>
<th>Priority</th>
<th>Type</th>
<th>Detection Criteria</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>
</tbody></table>
<hr>
<h2 id="troubleshooting">Troubleshooting</h2>
<h3 id="error-winrm-cannot-process-the-request">Error: "WinRM cannot process the request"</h3>
<p><strong>Cause:</strong> WinRM not enabled on target PC.</p>
<p><strong>Solution:</strong></p>
<pre><code class="language-powershell"># On target PC (as admin)
Enable-PSRemoting -Force
Set-Service WinRM -StartupType Automatic
Start-Service WinRM</code></pre>
<hr>
<h3 id="error-access-is-denied">Error: "Access is denied"</h3>
<p><strong>Cause:</strong> Insufficient credentials or UAC blocking remote admin.</p>
<p><strong>Solutions:</strong></p>
<pre><code class="language-powershell"># 1. Use explicit domain credentials
$cred = Get-Credential -UserName &quot;DOMAIN\AdminUser&quot; -Message &quot;Enter password&quot;
# 2. On target PC, enable remote UAC (as admin)
Set-ItemProperty -Path &quot;HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System&quot; -Name &quot;LocalAccountTokenFilterPolicy&quot; -Value 1 -Type DWord</code></pre>
<hr>
<h3 id="error-the-winrm-client-cannot-process-the-request-not-in-trustedhosts">Error: "The WinRM client cannot process the request... not in TrustedHosts"</h3>
<p><strong>Cause:</strong> Target not in trusted hosts list.</p>
<p><strong>Solution:</strong></p>
<pre><code class="language-powershell">.\Update-ShopfloorPCs-Remote.ps1 -SetupTrustedHosts
# Or manually:
Set-Item WSMan:\localhost\Client\TrustedHosts -Value &quot;10.134.*&quot; -Force</code></pre>
<hr>
<h3 id="error-the-underlying-connection-was-closed">Error: "The underlying connection was closed"</h3>
<p><strong>Cause:</strong> TLS/SSL configuration mismatch.</p>
<p><strong>Solution:</strong> The script automatically sets TLS 1.2/1.3. If issues persist:</p>
<pre><code class="language-powershell"># Force TLS 1.2 before running
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12</code></pre>
<hr>
<h3 id="error-cannot-find-computer-or-dns-failures">Error: "Cannot find computer" or DNS failures</h3>
<p><strong>Cause:</strong> Hostname not resolving.</p>
<p><strong>Solutions:</strong></p>
<pre><code class="language-powershell"># 1. Skip DNS resolution
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;PC01&quot; -SkipDnsLookup
# 2. Use IP address
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;10.134.50.101&quot; -SkipDnsLookup
# 3. Use different DNS suffix
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName &quot;PC01&quot; -DnsSuffix &quot;yourdomain.local&quot;</code></pre>
<hr>
<h3 id="slow-performance-with-many-pcs">Slow Performance with Many PCs</h3>
<p><strong>Cause:</strong> Network bandwidth or target PC load.</p>
<p><strong>Solutions:</strong></p>
<pre><code class="language-powershell"># Reduce concurrent connections
.\Update-ShopfloorPCs-Remote.ps1 -All -ThrottleLimit 5
# Run in batches
$allPCs = Get-Content &quot;all-pcs.txt&quot;
$batch1 = $allPCs[0..49]
$batch2 = $allPCs[50..99]
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName $batch1 -Credential $cred
.\Update-ShopfloorPCs-Remote.ps1 -ComputerName $batch2 -Credential $cred</code></pre>
<hr>
<h2 id="advanced-usage">Advanced Usage</h2>
<h3 id="combining-with-other-scripts">Combining with Other Scripts</h3>
<pre><code class="language-powershell"># Collect data first, then run maintenance
.\Update-ShopfloorPCs-Remote.ps1 -All -Credential $cred
.\Invoke-RemoteMaintenance.ps1 -All -Task SyncTime -Credential $cred</code></pre>
<h3 id="exporting-results-for-analysis">Exporting Results for Analysis</h3>
<pre><code class="language-powershell"># Capture output to file
.\Update-ShopfloorPCs-Remote.ps1 -All -Credential $cred | Tee-Object -FilePath &quot;collection-log.txt&quot;</code></pre>
<hr>
<h2 id="script-files">Script Files</h2>
<h3 id="current-scripts-active">Current Scripts (Active)</h3>
<pre><code>S:\dt\shopfloor\scripts\
├── remote-execution\
│ ├── Update-ShopfloorPCs-Remote.ps1 # Remote data collection (this script)
│ └── Invoke-RemoteMaintenance.ps1 # Remote maintenance tasks
└── complete-asset\
├── Update-PC-CompleteAsset.ps1 # Local data collection
└── Get-ShopfloorConfig.ps1 # Helper functions (required by above)</code></pre>
<h3 id="deprecated-scripts-can-be-removed">Deprecated Scripts (Can Be Removed)</h3>
<p>The following scripts in <code>remote-execution\</code> are legacy and have been replaced:</p>
<table>
<thead><tr>
<th>Deprecated Script</th>
<th>Replaced By</th>
</tr></thead>
<tbody>
<tr>
<td><code>Invoke-RemoteAssetCollection.ps1</code></td>
<td><code>Update-ShopfloorPCs-Remote.ps1</code></td>
</tr>
<tr>
<td><code>Invoke-RemoteAssetCollection-HTTPS.ps1</code></td>
<td><code>Update-ShopfloorPCs-Remote.ps1 -UseSSL</code></td>
</tr>
<tr>
<td><code>Install-KioskApp.ps1</code></td>
<td><code>Invoke-RemoteMaintenance.ps1 -Task InstallDashboard</code></td>
</tr>
<tr>
<td><code>Test-UserRegistryDetection.ps1</code></td>
<td>Functionality integrated into main scripts</td>
</tr>
</tbody></table>
<p>These deprecated scripts can be archived or deleted.</p>
</body>
</html>