Files
powershell-scripts/docs/Invoke-RemoteMaintenance.html
cproudlock 86b32d8597 Add fixnetworkshare, winrm-setup-package, udc remote-execution suites
- NetworkDriveManager.ps1: S: drive repair utility
- winrm-setup-package: Invoke-RemoteTask helper + Setup-WinRM.bat + HTML guide
- remote-execution/udc: UDC_Update.ps1 and batch wrappers for updating
  DNC controllers on shop-floor PCs
- Invoke-RemoteMaintenance.ps1: substantial rework (~1650 lines)
- Schedule-Maintenance and complete-asset minor updates
- Bump edncfix gitlink to v1.6.0 (2748bfa)
- .gitignore: block inventory.csv/xlsx (CUI) and logs_*.txt (per-host logs)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 12:04:40 -04:00

1742 lines
83 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Invoke-RemoteMaintenance.ps1 - GE Aerospace Knowledge Base</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--ge-blue-dark: #003B5C;
--ge-blue-primary: #0075C9;
--ge-blue-light: #4A9BD9;
--ge-gray-dark: #2D3E50;
--ge-gray-medium: #6C757D;
--ge-gray-light: #E9ECEF;
--ge-white: #FFFFFF;
--success-green: #28A745;
--warning-yellow: #FFC107;
--danger-red: #DC3545;
--info-blue: #17A2B8;
}
body {
font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
line-height: 1.6;
color: var(--ge-gray-dark);
background: var(--ge-gray-light);
padding: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
background: var(--ge-white);
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0, 59, 92, 0.1);
overflow: hidden;
}
/* Header Styles */
.header {
background: linear-gradient(135deg, var(--ge-blue-dark) 0%, var(--ge-blue-primary) 100%);
color: var(--ge-white);
padding: 40px 40px;
display: flex;
align-items: center;
justify-content: space-between;
}
.header-content {
flex: 1;
}
.header-logo {
margin-left: 30px;
}
.header-logo svg {
height: 40px;
width: auto;
}
.kb-badge {
background: rgba(255, 255, 255, 0.2);
color: var(--ge-white);
padding: 4px 12px;
border-radius: 4px;
font-size: 0.85em;
font-weight: 600;
display: inline-block;
margin-bottom: 10px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.header h1 {
font-size: 2em;
font-weight: 600;
margin-bottom: 8px;
line-height: 1.2;
}
.header-subtitle {
font-size: 1.05em;
opacity: 0.95;
font-weight: 400;
}
/* Content Area */
.content {
padding: 40px;
}
/* Overview Section */
.overview {
background: linear-gradient(to right, #E3F2FD 0%, #F5F9FC 100%);
border-left: 5px solid var(--ge-blue-primary);
padding: 25px;
margin-bottom: 35px;
border-radius: 4px;
}
.overview h2 {
color: var(--ge-blue-dark);
font-size: 1.5em;
margin-bottom: 15px;
font-weight: 600;
}
.overview p {
margin-bottom: 15px;
line-height: 1.7;
}
.overview h4 {
color: var(--ge-blue-dark);
font-size: 1.1em;
margin: 20px 0 10px 0;
font-weight: 600;
}
.overview ul {
list-style-position: inside;
margin-left: 15px;
}
.overview li {
margin-bottom: 8px;
line-height: 1.6;
}
/* Typography */
h2 {
color: var(--ge-blue-dark);
font-size: 1.8em;
font-weight: 600;
margin: 50px 0 25px 0;
padding-bottom: 12px;
border-bottom: 3px solid var(--ge-blue-primary);
}
h3 {
color: var(--ge-blue-primary);
font-size: 1.4em;
font-weight: 600;
margin: 35px 0 15px 0;
padding-left: 15px;
border-left: 4px solid var(--ge-blue-primary);
}
h4 {
color: var(--ge-gray-dark);
font-size: 1.15em;
font-weight: 600;
margin: 25px 0 12px 0;
}
p {
margin-bottom: 15px;
line-height: 1.7;
}
/* Lists */
ol, ul {
margin-left: 30px;
margin-bottom: 20px;
}
li {
margin-bottom: 10px;
line-height: 1.6;
}
ul ul, ol ol {
margin-top: 10px;
margin-bottom: 10px;
}
/* Step Boxes */
.step {
background: #F8F9FA;
padding: 25px;
margin: 25px 0;
border-radius: 6px;
border-left: 5px solid var(--ge-blue-primary);
}
.step-number {
background: var(--ge-blue-primary);
color: var(--ge-white);
padding: 6px 16px;
border-radius: 20px;
font-weight: 600;
display: inline-block;
margin-bottom: 12px;
font-size: 0.95em;
}
/* Code Blocks */
.code-block {
position: relative;
background: #1E1E1E;
color: #D4D4D4;
padding: 20px;
border-radius: 6px;
margin: 20px 0;
overflow-x: auto;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 0.9em;
line-height: 1.5;
}
.code-block pre {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
}
.copy-button {
position: absolute;
top: 12px;
right: 12px;
background: var(--ge-blue-primary);
color: var(--ge-white);
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
font-size: 0.85em;
font-weight: 600;
transition: all 0.3s ease;
z-index: 10;
}
.copy-button:hover {
background: var(--ge-blue-dark);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 117, 201, 0.3);
}
.copy-button:active {
transform: translateY(0);
}
.copy-button.copied {
background: var(--success-green);
}
/* Alert Boxes */
.alert {
padding: 18px 22px;
margin: 25px 0;
border-radius: 6px;
border-left: 5px solid;
line-height: 1.6;
}
.alert strong {
display: block;
margin-bottom: 8px;
font-size: 1.05em;
font-weight: 600;
}
.alert-info {
background: #E3F2FD;
border-color: var(--info-blue);
color: #014361;
}
.alert-warning {
background: #FFF8E1;
border-color: var(--warning-yellow);
color: #5D4037;
}
.alert-danger {
background: #FFEBEE;
border-color: var(--danger-red);
color: #B71C1C;
}
.alert-success {
background: #E8F5E9;
border-color: var(--success-green);
color: #1B5E20;
}
.alert ul {
margin-top: 12px;
margin-bottom: 0;
}
/* Navigation */
.nav {
position: sticky;
top: 20px;
background: var(--ge-white);
padding: 25px;
border-radius: 6px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
margin-bottom: 30px;
border: 1px solid var(--ge-gray-light);
}
.nav h3 {
margin: 0 0 18px 0;
padding: 0 0 12px 0;
border: none;
border-bottom: 2px solid var(--ge-gray-light);
font-size: 1.1em;
color: var(--ge-blue-dark);
}
.nav ul {
list-style: none;
margin: 0;
}
.nav li {
margin-bottom: 8px;
}
.nav a {
color: var(--ge-blue-primary);
text-decoration: none;
transition: all 0.2s ease;
display: block;
padding: 6px 12px;
border-radius: 4px;
font-size: 0.95em;
}
.nav a:hover {
background: var(--ge-gray-light);
color: var(--ge-blue-dark);
padding-left: 18px;
}
.nav .nav-indent {
padding-left: 28px;
font-size: 0.9em;
}
/* Troubleshooting Section */
.troubleshooting {
background: #FFF8E1;
padding: 25px;
border-radius: 6px;
margin: 25px 0;
border-left: 5px solid var(--warning-yellow);
}
.troubleshooting h4 {
color: #E65100;
margin-top: 0;
font-weight: 600;
}
/* Tables */
table {
width: 100%;
border-collapse: collapse;
margin: 25px 0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
border-radius: 6px;
overflow: hidden;
}
table th {
background: var(--ge-blue-dark);
color: var(--ge-white);
padding: 16px;
text-align: left;
font-weight: 600;
font-size: 0.95em;
}
table td {
padding: 16px;
border-bottom: 1px solid var(--ge-gray-light);
}
table tr:last-child td {
border-bottom: none;
}
table tr:hover {
background: #F8F9FA;
}
/* Inline Code */
.command-inline {
background: var(--ge-gray-light);
padding: 3px 8px;
border-radius: 4px;
font-family: 'Consolas', 'Monaco', monospace;
font-size: 0.88em;
color: var(--ge-blue-dark);
font-weight: 500;
}
/* Highlight */
.highlight {
background: #FFF9C4;
padding: 2px 6px;
border-radius: 3px;
font-weight: 600;
}
/* Checkbox List */
.checkbox-list {
list-style: none;
margin-left: 0;
}
.checkbox-list li {
padding-left: 30px;
position: relative;
}
.checkbox-list li::before {
content: "\2610";
position: absolute;
left: 0;
color: var(--ge-blue-primary);
font-size: 1.3em;
font-weight: bold;
}
/* Section Divider */
.section-divider {
height: 3px;
background: linear-gradient(to right, var(--ge-blue-primary), transparent);
margin: 50px 0;
border: none;
}
/* Footer */
.footer {
background: var(--ge-gray-light);
padding: 30px 40px;
text-align: center;
color: var(--ge-gray-medium);
border-top: 3px solid var(--ge-blue-primary);
}
.footer-content {
max-width: 800px;
margin: 0 auto;
}
.footer p {
margin-bottom: 10px;
}
.footer strong {
color: var(--ge-blue-dark);
}
/* Print Styles */
@media print {
body {
background: white;
padding: 0;
}
.container {
box-shadow: none;
}
.copy-button {
display: none;
}
.nav {
display: none;
}
.header {
background: var(--ge-blue-dark);
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}
/* Responsive Design */
@media (max-width: 768px) {
body {
padding: 10px;
}
.header {
flex-direction: column;
text-align: center;
padding: 25px 20px;
}
.header-logo {
margin-left: 0;
margin-top: 20px;
}
.content {
padding: 25px 20px;
}
.header h1 {
font-size: 1.5em;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.2em;
}
}
</style>
</head>
<body>
<div class="container">
<!-- HEADER SECTION -->
<div class="header">
<div class="header-content">
<span class="kb-badge">Knowledge Base Article</span>
<h1>Invoke-RemoteMaintenance.ps1</h1>
<p class="header-subtitle">Remote maintenance toolkit for executing maintenance tasks on shopfloor PCs via WinRM</p>
</div>
<div class="header-logo">
<!-- GE Aerospace Logo -->
<svg width="138" height="32" viewBox="0 0 138 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="mask0_1587_16237" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="138" height="32">
<path d="M138 0H0V32H138V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_1587_16237)">
<path d="M52.7203 22.4828V9.51721H59.3399V10.944H54.3731V15.2042H59.0216V16.5948H54.3731V21.06H59.3399V22.4868H52.7203V22.4828ZM66.7717 17.1294L68.5021 10.9962L70.2325 17.1294H66.7717ZM65.2657 22.4828L66.3921 18.4999H70.6243L71.7507 22.4828H73.4811L69.5673 9.51721H67.4981L63.5843 22.4828H65.2576H65.2657ZM78.2234 14.4607C79.4069 14.4607 79.9742 15.0917 79.9742 16.4421V17.2017H76.4766V16.4421C76.4766 15.0877 77.0398 14.4607 78.2275 14.4607M74.8605 16.5546V19.3358C74.8605 21.5021 76.044 22.6677 78.1907 22.6677C80.3374 22.6677 81.4638 21.7232 81.5373 19.7217H79.9742C79.9171 20.9234 79.3743 21.4258 78.1867 21.4258C76.999 21.4258 76.4766 20.7787 76.4766 19.4243V18.4999H81.574V16.5185C81.574 14.3682 80.4068 13.2228 78.2275 13.2228C76.0481 13.2228 74.8605 14.3883 74.8605 16.5546ZM87.8957 14.9269V13.3353H87.7243C86.5775 13.3353 85.7858 13.8337 85.3368 14.7822V13.4117H83.8146V22.4868H85.4307V16.9847C85.4307 15.783 86.0143 14.8907 87.5162 14.8907C87.6672 14.8907 87.8182 14.9068 87.8916 14.9269M92.3319 21.4097C91.1484 21.4097 90.6015 20.7787 90.6015 19.4283V16.4622C90.6015 15.1118 91.1484 14.4808 92.3319 14.4808C93.5154 14.4808 94.0623 15.1118 94.0623 16.4622V19.4283C94.0623 20.7787 93.5154 21.4097 92.3319 21.4097ZM92.3319 22.6677C94.5153 22.6677 95.6825 21.5021 95.6825 19.3358V16.5546C95.6825 14.3883 94.5153 13.2228 92.3319 13.2228C90.1485 13.2228 88.9854 14.3883 88.9854 16.5546V19.3358C88.9854 21.5021 90.1526 22.6677 92.3319 22.6677ZM99.1964 15.5378C99.1964 14.8144 99.7025 14.4446 100.588 14.4446C101.641 14.4446 102.074 14.943 102.074 16.0362H103.616C103.616 14.111 102.714 13.2188 100.588 13.2188C98.6863 13.2188 97.6333 14.1432 97.6333 15.7589C97.6333 17.258 98.6128 17.7965 99.8535 18.3873L100.813 18.8495C101.792 19.3117 102.131 19.5328 102.131 20.2763C102.131 21.0721 101.568 21.4418 100.588 21.4418C99.4576 21.4418 98.9719 20.9234 98.9719 19.7739H97.4293C97.4293 21.7553 98.4087 22.6637 100.588 22.6637C102.563 22.6637 103.69 21.6991 103.69 20.0512C103.69 18.5521 102.71 18.0136 101.47 17.4228L100.511 16.9606C99.5311 16.4984 99.1923 16.2773 99.1923 15.5338M110.836 19.4243C110.836 20.7224 110.326 21.3132 109.199 21.3132C107.959 21.3132 107.375 20.4974 107.375 19.1469V16.6471C107.375 15.2967 107.959 14.4808 109.199 14.4808C110.326 14.4808 110.836 15.0756 110.836 16.3698V19.4283V19.4243ZM112.452 19.3881V16.4059C112.452 14.3321 111.379 13.2188 109.554 13.2188C108.501 13.2188 107.73 13.6609 107.277 14.5129V13.4037H105.755V25.8146H107.371V21.4418C107.82 22.1814 108.575 22.5712 109.554 22.5712C111.379 22.5712 112.452 21.4579 112.452 19.3841M117.341 21.3293C116.362 21.3293 115.876 20.8269 115.876 19.8302V19.5529C115.876 18.4959 116.533 18.0899 118.321 18.0899H119.17V19.4243C119.17 20.6662 118.529 21.3333 117.345 21.3333M116.99 22.5752C118.064 22.5752 118.851 22.1492 119.284 21.3333V22.4828H120.79V16.1286C120.79 14.1472 119.757 13.2188 117.59 13.2188C115.541 13.2188 114.525 14.107 114.488 15.9437H116.052C116.072 14.9631 116.598 14.4446 117.594 14.4446C118.668 14.4446 119.174 14.9832 119.174 16.1326V16.836H118.235C115.525 16.836 114.268 17.7242 114.268 19.6534V19.9307C114.268 21.5423 115.341 22.5793 116.994 22.5793M126.34 22.6717C128.54 22.6717 129.536 21.6549 129.536 19.376H127.977C127.977 20.839 127.487 21.4137 126.34 21.4137C125.193 21.4137 124.626 20.7827 124.626 19.4323V16.4662C124.626 15.1158 125.173 14.4848 126.34 14.4848C127.507 14.4848 127.956 14.9832 127.977 16.4099H129.536C129.515 14.1874 128.556 13.2228 126.34 13.2228C124.124 13.2228 123.01 14.3883 123.01 16.5546V19.3358C123.01 21.5021 124.177 22.6677 126.34 22.6677M134.653 14.4607C135.837 14.4607 136.404 15.0917 136.404 16.4421V17.2017H132.907V16.4421C132.907 15.0877 133.47 14.4607 134.658 14.4607M131.291 16.5546V19.3358C131.291 21.5021 132.474 22.6677 134.621 22.6677C136.767 22.6677 137.894 21.7232 137.967 19.7217H136.404C136.347 20.9234 135.804 21.4258 134.617 21.4258C133.429 21.4258 132.907 20.7787 132.907 19.4243V18.4999H138.004V16.5185C138.004 14.3682 136.837 13.2228 134.658 13.2228C132.478 13.2228 131.291 14.3883 131.291 16.5546ZM46.3088 22.6677C47.6433 22.6677 48.8473 22.3904 49.9573 21.8156V15.2042H45.9129V16.5948H48.3208V20.8912C47.7576 21.1324 47.023 21.2811 46.3292 21.2811C44.2968 21.2811 43.5255 20.3165 43.5255 17.8166V13.3514C43.5255 11.7036 44.4682 10.7229 46.0476 10.7229C47.627 10.7229 48.3412 11.4464 48.3779 13.0018H50.092C50.0349 10.5019 48.7575 9.33635 46.0476 9.33635C43.3377 9.33635 41.8726 10.7792 41.8726 13.4117V17.7443C41.8726 21.1726 43.2275 22.6717 46.3129 22.6717M19.8915 11.8362C19.8915 10.0196 21.1404 8.25119 21.826 8.5888C22.6014 8.97061 21.2424 10.6868 19.8915 11.8362ZM11.3823 12.4994C11.3823 11.0364 12.8475 8.25521 13.7453 8.54861C14.8023 8.89425 12.8679 11.6996 11.3823 12.4994ZM9.89679 22.9611C9.2234 22.9932 8.77447 22.5672 8.77447 21.8558C8.77447 19.9508 11.4558 18.1301 13.4841 17.1535C13.125 19.8141 12.2108 22.8525 9.90087 22.957M22.279 16.7516C20.7486 16.7516 19.5773 17.8608 19.5773 19.1912C19.5773 20.3004 20.2507 21.1846 21.1526 21.1846C21.4668 21.1846 21.7811 21.0078 21.7811 20.6099C21.7811 20.0352 21.0057 19.8945 21.0669 19.0304C21.1036 18.4637 21.6505 18.0819 22.1892 18.0819C23.2707 18.0819 23.7768 19.1148 23.7768 20.1758C23.7319 21.8156 22.5075 22.957 21.0669 22.957C19.1773 22.957 17.9611 21.1846 17.9611 19.2756C17.9611 16.4381 19.8507 15.3328 20.8424 15.0676C20.8547 15.0676 23.4299 15.5217 23.3483 14.4004C23.3156 13.9101 22.5688 13.7212 22.03 13.6971C21.4301 13.6729 20.8302 13.886 20.8302 13.886C20.5159 13.7292 20.2996 13.4238 20.165 13.0701C22.0096 11.6956 23.3156 10.3652 23.3156 8.85808C23.3156 8.0623 22.7769 7.35092 21.7403 7.35092C19.8956 7.35092 18.4998 9.65386 18.4998 11.7398C18.4998 12.0934 18.4998 12.4511 18.5896 12.7606C17.4183 13.6046 16.5491 14.1271 14.9737 15.0555C14.9737 14.8626 15.0145 14.3602 15.1492 13.7131C15.6879 13.1384 16.4307 12.2743 16.4307 11.6112C16.4307 11.3017 16.2511 11.0364 15.892 11.0364C14.9941 11.0364 14.3167 12.3667 14.1371 13.2952C13.7331 13.7815 12.9209 14.4044 12.2475 14.4044C11.7088 14.4044 11.5292 13.9141 11.4803 13.7413C13.1903 13.1625 15.3084 10.8596 15.3084 8.77769C15.3084 8.33559 15.1288 7.35895 13.778 7.35895C11.7537 7.35895 10.0437 10.3291 10.0437 12.632C9.32134 12.632 9.05607 11.8764 9.05607 11.3017C9.05607 10.727 9.28053 10.1482 9.28053 9.97136C9.28053 9.79452 9.19075 9.57347 8.92139 9.57347C8.248 9.57347 7.83989 10.4617 7.83989 11.4785C7.88478 12.8973 8.83161 13.7855 10.0886 13.8739C10.2682 14.7179 11.0354 15.5137 11.9782 15.5137C12.5659 15.5137 13.2841 15.3369 13.778 14.8947C13.7331 15.2042 13.6882 15.4695 13.6433 15.7388C11.6639 16.7596 10.2233 17.467 8.91731 18.6204C7.88478 19.5529 7.29709 20.7908 7.29709 21.7674C7.29709 23.0977 8.15005 24.3356 9.90903 24.3356C11.9782 24.3356 13.5535 22.6958 14.3208 20.4371C14.6799 19.372 14.8268 17.8247 14.9166 16.4059C16.9857 15.2565 17.9693 14.5853 19.0467 13.8337C19.1814 14.0548 19.3202 14.2316 19.4956 14.3642C18.5529 14.8505 16.3001 16.2251 16.3001 19.4604C16.3001 21.7674 17.8754 24.3356 20.9812 24.3356C23.5482 24.3356 25.3031 22.2537 25.3031 20.2602C25.3031 18.4436 24.2665 16.7596 22.2872 16.7596M30.025 20.5657C30.025 20.5657 29.9924 20.6019 29.9434 20.5818C29.9067 20.5697 29.8944 20.5496 29.8944 20.5255C29.8944 20.4974 30.4372 18.9219 30.4331 17.1133C30.429 15.164 29.621 13.9663 28.5884 13.9663C27.96 13.9663 27.5069 14.4084 27.5069 15.0756C27.5069 16.2733 28.9925 16.3617 28.9925 18.9781C28.9925 20.0432 28.768 21.06 28.4089 22.1693C26.7438 27.7076 21.4301 30.2798 16.2593 30.2798C13.8718 30.2798 12.1781 29.7975 11.6721 29.5765C11.6517 29.5684 11.6354 29.5283 11.6517 29.4881C11.6639 29.4559 11.6966 29.4358 11.717 29.4439C11.921 29.5242 13.378 29.9744 15.1778 29.9744C17.1571 29.9744 18.3284 29.1786 18.3284 28.202C18.3284 27.583 17.8346 27.0967 17.202 27.0967C15.9859 27.0967 15.8961 28.6039 13.2882 28.6039C12.1618 28.6039 11.1742 28.3828 10.0029 28.0291C4.41988 26.3451 1.76306 21.1605 1.76714 16.0161C1.76714 13.5122 2.48134 11.5187 2.49358 11.4986C2.50174 11.4866 2.53439 11.4705 2.5752 11.4866C2.61602 11.4986 2.62418 11.5348 2.62418 11.5428C2.55888 11.7518 2.08547 13.1786 2.08547 14.951C2.08547 16.9003 2.89353 18.0538 3.93015 18.0538C4.51783 18.0538 5.01165 17.6117 5.01165 16.9887C5.01165 15.791 3.52611 15.6584 3.52611 13.0862C3.52611 11.9769 3.75058 11.0043 4.10972 9.85079C5.80747 4.34464 11.0722 1.7684 16.2471 1.72821C18.6509 1.70811 20.7567 2.41949 20.8383 2.47978C20.8506 2.49184 20.8669 2.52399 20.8506 2.56016C20.8343 2.60035 20.8057 2.60839 20.7935 2.60437C20.769 2.60437 19.3977 2.03768 17.3286 2.03768C15.3941 2.03768 14.1779 2.83346 14.1779 3.85431C14.1779 4.42904 14.6268 4.91535 15.3043 4.91535C16.5205 4.91535 16.6103 3.4524 19.2181 3.4524C20.3445 3.4524 21.3322 3.67345 22.5035 4.02713C28.1314 5.71113 30.6902 10.94 30.7392 15.996C30.7637 18.5843 30.025 20.5456 30.0169 20.5576M16.2471 0.75157C7.69705 0.75157 0.763175 7.58001 0.763175 16C0.763175 24.42 7.69705 31.2444 16.2471 31.2444C24.7971 31.2444 31.7269 24.42 31.7269 16C31.7269 7.58001 24.7971 0.75157 16.2471 0.75157ZM16.2471 32C7.28893 32 0 24.8661 0 16C0 7.13389 7.28893 0 16.2471 0C25.2052 0 32.4941 7.18212 32.4941 16C32.4941 24.8179 25.2011 32 16.2471 32Z" fill="white"/>
</g>
</svg>
</div>
</div>
<!-- MAIN CONTENT -->
<div class="content">
<!-- NAVIGATION -->
<div class="nav">
<h3>Quick Navigation</h3>
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#first-time-setup">First-Time Setup</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">Parameters Reference</a></li>
<li><a href="#available-tasks">Available Tasks</a></li>
<li><a href="#deployment-mechanism">Software Deployment Mechanism</a></li>
<li><a href="#how-to-guides">How-To Guides</a></li>
<li><a href="#how-to-repair" class="nav-indent">System Repair</a></li>
<li><a href="#how-to-optimize" class="nav-indent">Disk Optimization</a></li>
<li><a href="#how-to-services" class="nav-indent">Service Management</a></li>
<li><a href="#how-to-time" class="nav-indent">Time Sync</a></li>
<li><a href="#how-to-dnc" class="nav-indent">DNC Configuration</a></li>
<li><a href="#how-to-copyfile" class="nav-indent">File Deployment</a></li>
<li><a href="#how-to-importreg" class="nav-indent">Registry Import</a></li>
<li><a href="#how-to-software" class="nav-indent">Software Deployment</a></li>
<li><a href="#how-to-batch" class="nav-indent">Batch Operations</a></li>
<li><a href="#targeting">Targeting Strategies</a></li>
<li><a href="#troubleshooting">Troubleshooting</a></li>
<li><a href="#best-practices">Best Practices</a></li>
</ul>
</div>
<!-- OVERVIEW SECTION -->
<div id="overview" class="overview">
<h2>Overview</h2>
<p>This script provides a comprehensive remote maintenance toolkit for managing shopfloor PCs. It executes maintenance tasks via WinRM (Windows Remote Management) and can target PCs individually, by type, by business unit, or all at once.</p>
<p><strong>Location:</strong> <span class="command-inline">S:\dt\shopfloor\scripts\remote-execution\Invoke-RemoteMaintenance.ps1</span></p>
<h4>Key Features:</h4>
<ul>
<li>22 maintenance tasks available</li>
<li>General-purpose file deployment (<span class="command-inline">CopyFile</span>) and registry import (<span class="command-inline">ImportReg</span>) tasks</li>
<li>Registry imports run as logged-in user via scheduled task (HKCU support)</li>
<li>Optional post-copy commands via scheduled task (service/app restarts)</li>
<li>Multiple targeting options (by name, type, business unit, or all)</li>
<li>Concurrent execution with configurable throttling</li>
<li>Integration with ShopDB for PC discovery</li>
</ul>
</div>
<!-- FIRST-TIME SETUP -->
<h2 id="first-time-setup">First-Time Setup</h2>
<p>Before running this script for the first time, you must allow PowerShell script execution and unblock the script file.</p>
<div class="step">
<span class="step-number">Step 1</span>
<h4>Allow PowerShell Script Execution</h4>
<p>Open PowerShell <strong>as Administrator</strong> and run:</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>Set-ExecutionPolicy RemoteSigned -Scope CurrentUser</pre>
</div>
<p>When prompted, type <span class="command-inline">Y</span> and press Enter. This allows locally-created scripts to run and requires downloaded scripts to be signed or unblocked.</p>
<div class="alert alert-info">
<strong>Note:</strong>
You only need to do this once per user account. <span class="command-inline">RemoteSigned</span> is the recommended policy &mdash; it allows local scripts while still protecting against untrusted downloads.
</div>
</div>
<div class="step">
<span class="step-number">Step 2</span>
<h4>Unblock the Script File</h4>
<p>Files downloaded from a network share or the internet are marked as "blocked" by Windows. You must unblock the script before it can run.</p>
<p><strong>Option A &mdash; File Explorer (GUI):</strong></p>
<ol>
<li>Navigate to <span class="command-inline">S:\dt\shopfloor\scripts\remote-execution\</span></li>
<li>Right-click <span class="command-inline">Invoke-RemoteMaintenance.ps1</span> and select <strong>Properties</strong></li>
<li>At the bottom of the General tab, check the <span class="highlight">Unblock</span> checkbox</li>
<li>Click <strong>Apply</strong>, then <strong>OK</strong></li>
</ol>
<p><strong>Option B &mdash; PowerShell:</strong></p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>Unblock-File -Path "S:\dt\shopfloor\scripts\remote-execution\Invoke-RemoteMaintenance.ps1"</pre>
</div>
<div class="alert alert-warning">
<strong>Important:</strong>
If you skip this step, you will get a security error when trying to run the script: <em>"cannot be loaded because running scripts is disabled on this system"</em> or <em>"cannot be loaded. The file is not digitally signed."</em>
</div>
</div>
<hr class="section-divider">
<!-- API INTEGRATION -->
<h2 id="api-integration">API Integration</h2>
<p>When using <span class="command-inline">-All</span>, <span class="command-inline">-PcType</span>, or <span class="command-inline">-BusinessUnit</span> targeting, the script retrieves PC lists from the ShopDB API:</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>GET /api.asp?action=getShopfloorPCs
GET /api.asp?action=getShopfloorPCs&amp;pctypeid=2 # CMM PCs only
GET /api.asp?action=getShopfloorPCs&amp;businessunitid=1 # Specific business unit</pre>
</div>
<h3>PC Type IDs</h3>
<table>
<thead>
<tr><th>ID</th><th>Type</th><th>ID</th><th>Type</th></tr>
</thead>
<tbody>
<tr><td>1</td><td>Standard</td><td>7</td><td>Keyence</td></tr>
<tr><td>2</td><td>Engineer</td><td>8</td><td>Genspect</td></tr>
<tr><td>3</td><td>Shopfloor</td><td>9</td><td>Heat Treat</td></tr>
<tr><td>4</td><td>Uncategorized</td><td>10</td><td>Inspection</td></tr>
<tr><td>5</td><td>CMM</td><td>11</td><td>Dashboard</td></tr>
<tr><td>6</td><td>Wax / Trace</td><td>12</td><td>Lobby Display</td></tr>
</tbody>
</table>
<div class="alert alert-info">
<strong>Reference:</strong>
See <strong>ShopDB API Reference</strong> for complete API documentation.
</div>
<hr class="section-divider">
<!-- PREREQUISITES -->
<h2 id="prerequisites">Prerequisites</h2>
<h3>On Your Workstation</h3>
<ol>
<li><strong>PowerShell 5.1 or higher</strong></li>
<li><strong>Network access to target PCs</strong> (TCP port 5985)</li>
<li><strong>Admin credentials</strong> for target PCs</li>
</ol>
<h3>On Target PCs</h3>
<ol>
<li><strong>WinRM enabled</strong> (<span class="command-inline">Enable-PSRemoting -Force</span>)</li>
<li><strong>Firewall rules</strong> allowing WinRM traffic</li>
</ol>
<h3>Verify Connectivity</h3>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Test WinRM connectivity
Test-WSMan -ComputerName "SHOPFLOOR-PC01"
# Test with credentials
$cred = Get-Credential
Test-WSMan -ComputerName "SHOPFLOOR-PC01" -Credential $cred</pre>
</div>
<hr class="section-divider">
<!-- QUICK START -->
<h2 id="quick-start">Quick Start</h2>
<div class="step">
<span class="step-number">Step 1</span>
<h4>Get Credentials</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>$cred = Get-Credential -Message "Enter domain admin credentials"</pre>
</div>
</div>
<div class="step">
<span class="step-number">Step 2</span>
<h4>Run a Simple Task</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Flush DNS on a single PC
.\Invoke-RemoteMaintenance.ps1 -ComputerName "SHOPFLOOR-PC01" -Task FlushDNS -Credential $cred</pre>
</div>
</div>
<div class="step">
<span class="step-number">Step 3</span>
<h4>Check Results</h4>
<p>The script outputs status for each PC:</p>
<div class="code-block">
<pre>[SHOPFLOOR-PC01] FlushDNS: SUCCESS
DNS Resolver Cache flushed successfully</pre>
</div>
</div>
<hr class="section-divider">
<!-- PARAMETERS REFERENCE -->
<h2 id="parameters">Parameters Reference</h2>
<h3>Targeting Parameters (Mutually Exclusive)</h3>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><span class="command-inline">-ComputerName</span></td><td>string[]</td><td>One or more computer names or IPs</td></tr>
<tr><td><span class="command-inline">-ComputerListFile</span></td><td>string</td><td>Path to text file with hostnames</td></tr>
<tr><td><span class="command-inline">-All</span></td><td>switch</td><td>Target all shopfloor PCs from ShopDB</td></tr>
<tr><td><span class="command-inline">-PcType</span></td><td>string</td><td>Target by PC type (see PC Types)</td></tr>
<tr><td><span class="command-inline">-BusinessUnit</span></td><td>string</td><td>Target by business unit (see Business Units)</td></tr>
</tbody>
</table>
<h3>Task Parameter (Required)</h3>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><span class="command-inline">-Task</span></td><td>string</td><td>Maintenance task to execute</td></tr>
</tbody>
</table>
<h3>File Deployment Parameters (CopyFile / ImportReg)</h3>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><span class="command-inline">-SourcePath</span></td><td>string</td><td>Source file path (local or UNC). Required for CopyFile and ImportReg</td></tr>
<tr><td><span class="command-inline">-DestinationPath</span></td><td>string</td><td>Destination file path on remote PCs. Required for CopyFile</td></tr>
<tr><td><span class="command-inline">-RunCommand</span></td><td>string</td><td>Command to run after CopyFile. Runs as logged-in user by default (via scheduled task)</td></tr>
<tr><td><span class="command-inline">-AsSystem</span></td><td>switch</td><td>Run ImportReg and -RunCommand in the WinRM session (SYSTEM context) instead of as logged-in user</td></tr>
</tbody>
</table>
<h3>Optional Parameters</h3>
<table>
<thead>
<tr><th>Parameter</th><th>Type</th><th>Default</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><span class="command-inline">-Credential</span></td><td>PSCredential</td><td>Prompt</td><td>Remote authentication</td></tr>
<tr><td><span class="command-inline">-ApiUrl</span></td><td>string</td><td>Production</td><td>ShopDB API endpoint</td></tr>
<tr><td><span class="command-inline">-ThrottleLimit</span></td><td>int</td><td>5</td><td>Max concurrent sessions</td></tr>
<tr><td><span class="command-inline">-DnsSuffix</span></td><td>string</td><td>logon.ds.ge.com</td><td>DNS suffix for FQDN resolution</td></tr>
<tr><td><span class="command-inline">-LogFile</span></td><td>switch</td><td>Off</td><td>Enable transcript logging to <span class="command-inline">logs/</span> directory</td></tr>
</tbody>
</table>
<h3>PC Types</h3>
<div class="code-block">
<pre>Standard, Engineer, Shopfloor, CMM, Wax / Trace, Keyence,
Genspect, Heat Treat, Inspection, Dashboard, Lobby Display, Uncategorized</pre>
</div>
<h3>Business Units</h3>
<div class="code-block">
<pre>TBD, Blisk, HPT, Spools, Inspection, Venture, Turn/Burn, DT</pre>
</div>
<hr class="section-divider">
<!-- AVAILABLE TASKS -->
<h2 id="available-tasks">Available Tasks</h2>
<h3>Repair Tasks</h3>
<table>
<thead><tr><th>Task</th><th>Description</th><th>Duration</th><th>Impact</th></tr></thead>
<tbody>
<tr><td><span class="command-inline">DISM</span></td><td>Repair Windows component store</td><td>15-60 min</td><td>Low</td></tr>
<tr><td><span class="command-inline">SFC</span></td><td>System File Checker scan</td><td>10-30 min</td><td>Low</td></tr>
</tbody>
</table>
<h3>Optimization Tasks</h3>
<table>
<thead><tr><th>Task</th><th>Description</th><th>Duration</th><th>Impact</th></tr></thead>
<tbody>
<tr><td><span class="command-inline">OptimizeDisk</span></td><td>TRIM (SSD) or Defrag (HDD)</td><td>5-60 min</td><td>Medium</td></tr>
<tr><td><span class="command-inline">DiskCleanup</span></td><td>Remove temp files, updates</td><td>5-15 min</td><td>Low</td></tr>
<tr><td><span class="command-inline">ClearUpdateCache</span></td><td>Clear Windows Update cache</td><td>1-2 min</td><td>Low</td></tr>
<tr><td><span class="command-inline">ClearBrowserCache</span></td><td>Clear Chrome/Edge cache</td><td>1-2 min</td><td>Low</td></tr>
</tbody>
</table>
<h3>Service Tasks</h3>
<table>
<thead><tr><th>Task</th><th>Description</th><th>Duration</th><th>Impact</th></tr></thead>
<tbody>
<tr><td><span class="command-inline">RestartSpooler</span></td><td>Restart Print Spooler</td><td>&lt;1 min</td><td>Low</td></tr>
<tr><td><span class="command-inline">FlushDNS</span></td><td>Clear DNS cache</td><td>&lt;1 min</td><td>None</td></tr>
<tr><td><span class="command-inline">RestartWinRM</span></td><td>Restart WinRM service</td><td>&lt;1 min</td><td>Temp disconnect</td></tr>
</tbody>
</table>
<h3>Time/Date Tasks</h3>
<table>
<thead><tr><th>Task</th><th>Description</th><th>Duration</th><th>Impact</th></tr></thead>
<tbody>
<tr><td><span class="command-inline">SetTimezone</span></td><td>Set to Eastern Time</td><td>&lt;1 min</td><td>None</td></tr>
<tr><td><span class="command-inline">SyncTime</span></td><td>Force time sync with DC</td><td>&lt;1 min</td><td>None</td></tr>
</tbody>
</table>
<h3>DNC Tasks</h3>
<table>
<thead><tr><th>Task</th><th>Description</th><th>Duration</th><th>Impact</th></tr></thead>
<tbody>
<tr><td><span class="command-inline">UpdateDNCMXHosts</span></td><td>Update FtpHostPrimary/Secondary in DNC\MX registry</td><td>&lt;1 min</td><td>None</td></tr>
<tr><td><span class="command-inline">AuditDNCConfig</span></td><td>Compare DNC registry vs UDC backup JSON, export CSV</td><td>1-5 min</td><td>None</td></tr>
<tr><td><span class="command-inline">CheckDefectTracker</span></td><td>Check if Defect_Tracker.exe is running, export CSV</td><td>1-5 min</td><td>None</td></tr>
</tbody>
</table>
<h3>File Deployment Tasks</h3>
<table>
<thead><tr><th>Task</th><th>Description</th><th>Duration</th><th>Impact</th></tr></thead>
<tbody>
<tr><td><span class="command-inline">CopyFile</span></td><td>Copy file from <span class="command-inline">-SourcePath</span> to <span class="command-inline">-DestinationPath</span> on remote PCs</td><td>1-2 min</td><td>Low</td></tr>
<tr><td><span class="command-inline">ImportReg</span></td><td>Copy <span class="command-inline">.reg</span> file and import via scheduled task as logged-in user</td><td>1-2 min</td><td>Low</td></tr>
</tbody>
</table>
<h3>System Tasks</h3>
<table>
<thead><tr><th>Task</th><th>Description</th><th>Duration</th><th>Impact</th></tr></thead>
<tbody>
<tr><td><span class="command-inline">GPUpdate</span></td><td>Force Group Policy refresh (<span class="command-inline">gpupdate /force</span>)</td><td>&lt;1 min</td><td>Low</td></tr>
<tr><td><span class="command-inline">Reboot</span></td><td>Restart PC (30s delay)</td><td>2-5 min</td><td>High</td></tr>
</tbody>
</table>
<h3>Software Deployment Tasks</h3>
<table>
<thead><tr><th>Task</th><th>Description</th><th>Duration</th><th>Impact</th></tr></thead>
<tbody>
<tr><td><span class="command-inline">InstallDashboard</span></td><td>Install GE Dashboard app</td><td>2-5 min</td><td>Medium</td></tr>
<tr><td><span class="command-inline">InstallLobbyDisplay</span></td><td>Install Lobby Display app</td><td>2-5 min</td><td>Medium</td></tr>
<tr><td><span class="command-inline">UninstallDashboard</span></td><td>Remove GE Dashboard</td><td>1-2 min</td><td>Low</td></tr>
<tr><td><span class="command-inline">UninstallLobbyDisplay</span></td><td>Remove Lobby Display</td><td>1-2 min</td><td>Low</td></tr>
</tbody>
</table>
<hr class="section-divider">
<!-- SOFTWARE DEPLOYMENT MECHANISM -->
<h2 id="deployment-mechanism">Software Deployment Mechanism</h2>
<h3>Source File Locations</h3>
<p>Deployment tasks require source files to be available before execution:</p>
<table>
<thead><tr><th>Task</th><th>Source File Path</th></tr></thead>
<tbody>
<tr><td><span class="command-inline">InstallDashboard</span></td><td><span class="command-inline">\\tsgwp00525.wjs.geaerospace.net\shared\dt\shopfloor\scripts\Dashboard\GEAerospaceDashboardSetup.exe</span></td></tr>
<tr><td><span class="command-inline">InstallLobbyDisplay</span></td><td><span class="command-inline">\\tsgwp00525.wjs.geaerospace.net\shared\dt\shopfloor\scripts\LobbyDisplay\GEAerospaceLobbyDisplaySetup.exe</span></td></tr>
<tr><td><span class="command-inline">CopyFile</span></td><td>Any file &mdash; specified via <span class="command-inline">-SourcePath</span> parameter</td></tr>
<tr><td><span class="command-inline">ImportReg</span></td><td>Any <span class="command-inline">.reg</span> file &mdash; specified via <span class="command-inline">-SourcePath</span> parameter</td></tr>
</tbody>
</table>
<h3>How Deployment Works</h3>
<ol>
<li><strong>Pre-flight Check:</strong> Script verifies source file exists</li>
<li><strong>WinRM Session:</strong> Opens remote session to target PC</li>
<li><strong>File Push:</strong> Copies source file to <span class="command-inline">C:\Windows\Temp\</span> on remote PC</li>
<li><strong>Execution:</strong> Runs install/copy/import task using pushed file</li>
<li><strong>Post-action:</strong> Optionally runs command as logged-in user via scheduled task</li>
<li><strong>Cleanup:</strong> Removes temp file from remote PC</li>
</ol>
<div class="code-block">
<pre>+---------------------+ WinRM +---------------------+
| Your Workstation | ------------> | Target PC |
| | | |
| Source Files: | Push File | Temp Location: |
| - Setup.exe | ------------> | C:\Windows\Temp |
| - config.json | | |
| - settings.reg | Execute | Final Location: |
| (any path/UNC) | ------------> | -DestinationPath |
| | | |
| | Sched. Task | Logged-in User: |
| | ------------> | - regedit /s |
| | | - RunCommand |
+---------------------+ +---------------------+</pre>
</div>
<h3>CopyFile Details</h3>
<p>The <span class="command-inline">CopyFile</span> task:</p>
<ol>
<li><strong>Source:</strong> Any file specified via <span class="command-inline">-SourcePath</span> (local or UNC path)</li>
<li><strong>Destination:</strong> Specified via <span class="command-inline">-DestinationPath</span></li>
<li><strong>Backup:</strong> Existing file is backed up as <span class="command-inline">&lt;name&gt;-old-&lt;timestamp&gt;.&lt;ext&gt;</span></li>
<li><strong>Post-action:</strong> If <span class="command-inline">-RunCommand</span> is specified, runs as the logged-in user via a one-shot scheduled task (same pattern as Dashboard/Lobby kiosk relaunch)</li>
</ol>
<h3>ImportReg Details</h3>
<p>The <span class="command-inline">ImportReg</span> task:</p>
<ol>
<li><strong>Source:</strong> <span class="command-inline">.reg</span> file specified via <span class="command-inline">-SourcePath</span></li>
<li><strong>Import method:</strong> <span class="command-inline">regedit.exe /s</span> via one-shot scheduled task as logged-in user</li>
<li><strong>HKCU support:</strong> Runs as the logged-in user, so both HKLM and HKCU keys apply correctly</li>
<li><strong>Fallback:</strong> If no user is logged in, runs <span class="command-inline">regedit.exe /s</span> directly (HKLM only)</li>
<li><strong>Cleanup:</strong> Temp <span class="command-inline">.reg</span> file removed after import</li>
</ol>
<div class="alert alert-info">
<strong>HKCU vs HKLM:</strong>
By default, ImportReg runs as the logged-in user via scheduled task so HKCU keys apply to the correct user profile. Use <span class="command-inline">-AsSystem</span> for HKLM-only .reg files to skip the scheduled task overhead.
</div>
<h3>Dashboard/Lobby Display Install Details</h3>
<p>Both kiosk app installers:</p>
<ol>
<li><strong>Installer type:</strong> Inno Setup (supports <span class="command-inline">/VERYSILENT</span>)</li>
<li><strong>Pre-install:</strong> Kills running Edge kiosk via <span class="command-inline">PrepareToInstall</span> in Inno Setup</li>
<li><strong>Execution:</strong> Silent install with no user prompts (120-second timeout)</li>
<li><strong>Post-install:</strong> Creates a one-shot scheduled task to relaunch Edge in kiosk mode as the logged-in user, then auto-deletes the task</li>
<li><strong>Cleanup:</strong> Installer removed from temp after execution</li>
<li><strong>Connectivity:</strong> Offline PCs are skipped with a ping check before connecting</li>
</ol>
<p><strong>Uninstall GUIDs:</strong></p>
<ul>
<li>Dashboard: <span class="command-inline">{9D9EEE25-4D24-422D-98AF-2ADEDA4745ED}</span></li>
<li>Lobby Display: <span class="command-inline">{42FFB952-0B72-493F-8869-D957344CA305}</span></li>
</ul>
<h3>Adding New Deployable Applications</h3>
<div class="step">
<span class="step-number">Step 1</span>
<h4>Add to $KioskAppConfig hashtable</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>$KioskAppConfig = @{
# Existing entries...
# Add new application
'InstallNewApp' = @{
Action = 'Install'
InstallerPath = '\\tsgwp00525.wjs.geaerospace.net\shared\dt\shopfloor\scripts\NewApp\NewAppSetup.exe'
InstallerName = 'NewAppSetup.exe'
AppName = 'New Application Name'
UninstallGuid = '{YOUR-GUID-HERE}' # Find in registry after manual install
KioskUrl = 'https://tsgwp00525.wjs.geaerospace.net/shopdb/your-page/'
}
'UninstallNewApp' = @{
Action = 'Uninstall'
InstallerName = 'NewAppSetup.exe'
AppName = 'New Application Name'
UninstallGuid = '{YOUR-GUID-HERE}'
}
}</pre>
</div>
</div>
<div class="step">
<span class="step-number">Step 2</span>
<h4>Add task names to ValidateSet (~line 142)</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>[ValidateSet(
'DISM', 'SFC', 'OptimizeDisk', 'DiskCleanup', 'ClearUpdateCache',
'RestartSpooler', 'FlushDNS', 'RestartWinRM', 'ClearBrowserCache',
'SetTimezone', 'SyncTime', 'UpdateDNCMXHosts', 'AuditDNCConfig',
'CheckDefectTracker', 'GPUpdate', 'Reboot',
'CopyFile', 'ImportReg',
'InstallDashboard', 'InstallLobbyDisplay', 'UninstallDashboard', 'UninstallLobbyDisplay',
'InstallNewApp', 'UninstallNewApp' # Add new tasks here
)]
[string]$Task</pre>
</div>
</div>
<div class="step">
<span class="step-number">Step 3</span>
<h4>Place installer on network share</h4>
<div class="code-block">
<pre>\\tsgwp00525.wjs.geaerospace.net\shared\dt\shopfloor\scripts\NewApp\NewAppSetup.exe</pre>
</div>
</div>
<h4>Finding the Uninstall GUID</h4>
<p>After manually installing the application on a test PC, find the GUID in registry:</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Search for app in registry
Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" |
Get-ItemProperty | Where-Object { $_.DisplayName -like "*AppName*" } |
Select-Object DisplayName, PSChildName, UninstallString</pre>
</div>
<p>The <span class="command-inline">PSChildName</span> is typically the GUID (e.g., <span class="command-inline">{9D9EEE25-4D24-422D-98AF-2ADEDA4745ED}</span>).</p>
<div class="alert alert-info">
<strong>Installer Requirements:</strong>
<ul>
<li>Must support silent installation flags</li>
<li>Inno Setup: <span class="command-inline">/VERYSILENT /SUPPRESSMSGBOXES /NORESTART</span></li>
<li>MSI: <span class="command-inline">/qn /norestart</span></li>
<li>NSIS: <span class="command-inline">/S</span></li>
</ul>
If your installer uses different flags, modify the <span class="command-inline">InstallKioskApp</span> scriptblock.
</div>
<hr class="section-divider">
<!-- HOW-TO GUIDES -->
<h2 id="how-to-guides">How-To Guides</h2>
<!-- System Repair -->
<h3 id="how-to-repair">How to Repair System Files</h3>
<p><strong>Scenario:</strong> A PC has corrupted system files causing crashes or errors.</p>
<h4>Option 1: DISM (Component Store Repair)</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Run DISM repair on a single PC
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PROBLEM-PC" -Task DISM -Credential $cred</pre>
</div>
<p><strong>What it does:</strong></p>
<ul>
<li>Downloads missing/corrupted files from Windows Update</li>
<li>Repairs the Windows component store</li>
<li>Required before SFC if component store is damaged</li>
</ul>
<p><strong>Expected output:</strong></p>
<div class="code-block">
<pre>[PROBLEM-PC] DISM: SUCCESS
Deployment Image Servicing and Management tool
The restore operation completed successfully.</pre>
</div>
<h4>Option 2: SFC (System File Checker)</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Run SFC after DISM
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PROBLEM-PC" -Task SFC -Credential $cred</pre>
</div>
<p><strong>What it does:</strong></p>
<ul>
<li>Scans all protected system files</li>
<li>Replaces corrupted files from component store</li>
<li>Creates log at <span class="command-inline">C:\Windows\Logs\CBS\CBS.log</span></li>
</ul>
<div class="alert alert-success">
<strong>Best Practice - Full Repair Sequence:</strong>
</div>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Step 1: Run DISM first
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PROBLEM-PC" -Task DISM -Credential $cred
# Step 2: Run SFC after DISM completes
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PROBLEM-PC" -Task SFC -Credential $cred
# Step 3: Reboot to apply changes
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PROBLEM-PC" -Task Reboot -Credential $cred</pre>
</div>
<hr class="section-divider">
<!-- Disk Optimization -->
<h3 id="how-to-optimize">How to Optimize Disks</h3>
<p><strong>Scenario:</strong> PCs are running slow due to disk fragmentation or lack of TRIM.</p>
<h4>Single PC Optimization</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>.\Invoke-RemoteMaintenance.ps1 -ComputerName "SLOW-PC" -Task OptimizeDisk -Credential $cred</pre>
</div>
<p><strong>What it does:</strong></p>
<ul>
<li>Detects drive type (SSD vs HDD)</li>
<li>For SSDs: Runs TRIM to reclaim deleted blocks</li>
<li>For HDDs: Runs defragmentation</li>
</ul>
<h4>Optimize All CMM PCs (After Hours)</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># CMM PCs often have large files - optimize overnight
.\Invoke-RemoteMaintenance.ps1 -PcType CMM -Task OptimizeDisk -Credential $cred -ThrottleLimit 3</pre>
</div>
<h4>Full Cleanup Sequence</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Step 1: Clear update cache
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PC01" -Task ClearUpdateCache -Credential $cred
# Step 2: Run disk cleanup
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PC01" -Task DiskCleanup -Credential $cred
# Step 3: Optimize disk
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PC01" -Task OptimizeDisk -Credential $cred</pre>
</div>
<hr class="section-divider">
<!-- Stuck Windows Updates -->
<h3>How to Fix Stuck Windows Updates</h3>
<p><strong>Scenario:</strong> Windows Update is stuck or failing repeatedly.</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Clear the Windows Update cache
.\Invoke-RemoteMaintenance.ps1 -ComputerName "UPDATE-STUCK-PC" -Task ClearUpdateCache -Credential $cred</pre>
</div>
<p><strong>What it does:</strong></p>
<ol>
<li>Stops Windows Update service</li>
<li>Stops BITS service</li>
<li>Clears <span class="command-inline">C:\Windows\SoftwareDistribution\Download</span></li>
<li>Restarts services</li>
</ol>
<hr class="section-divider">
<!-- Browser Cache -->
<h3>How to Clear Browser Cache</h3>
<p><strong>Scenario:</strong> CMM or inspection PCs have slow browser performance.</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Single PC
.\Invoke-RemoteMaintenance.ps1 -ComputerName "CMM-PC01" -Task ClearBrowserCache -Credential $cred
# All CMM PCs
.\Invoke-RemoteMaintenance.ps1 -PcType CMM -Task ClearBrowserCache -Credential $cred</pre>
</div>
<p><strong>What it does:</strong></p>
<ul>
<li>Clears Chrome cache directories</li>
<li>Clears Edge cache directories</li>
<li>Does NOT clear saved passwords or bookmarks</li>
</ul>
<hr class="section-divider">
<!-- Service Management -->
<h3 id="how-to-services">How to Manage Services</h3>
<h4>Fix Printing Issues</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Restart print spooler on a PC with stuck print jobs
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PRINT-PROBLEM-PC" -Task RestartSpooler -Credential $cred</pre>
</div>
<p><strong>What it does:</strong></p>
<ol>
<li>Stops Print Spooler service</li>
<li>Clears print queue</li>
<li>Restarts Print Spooler service</li>
</ol>
<h4>Fix DNS Resolution Issues</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Flush DNS cache when a PC can't resolve hostnames
.\Invoke-RemoteMaintenance.ps1 -ComputerName "DNS-ISSUE-PC" -Task FlushDNS -Credential $cred
# Flush DNS on all PCs in a business unit
.\Invoke-RemoteMaintenance.ps1 -BusinessUnit Blisk -Task FlushDNS -Credential $cred</pre>
</div>
<h4>Fix Remote Management Issues</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Restart WinRM if subsequent remote commands fail
.\Invoke-RemoteMaintenance.ps1 -ComputerName "WINRM-ISSUE-PC" -Task RestartWinRM -Credential $cred</pre>
</div>
<div class="alert alert-warning">
<strong>Note:</strong>
Connection will briefly drop during WinRM restart.
</div>
<hr class="section-divider">
<!-- Time Sync -->
<h3 id="how-to-time">How to Fix Time Sync Issues</h3>
<p><strong>Scenario:</strong> PC clock is wrong, causing certificate errors or login issues.</p>
<h4>Set Correct Timezone</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Single PC
.\Invoke-RemoteMaintenance.ps1 -ComputerName "WRONG-TIME-PC" -Task SetTimezone -Credential $cred
# All shopfloor PCs
.\Invoke-RemoteMaintenance.ps1 -All -Task SetTimezone -Credential $cred</pre>
</div>
<p><strong>Sets timezone to:</strong> <span class="highlight">Eastern Standard Time</span></p>
<h4>Force Time Synchronization</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Sync time with domain controller
.\Invoke-RemoteMaintenance.ps1 -ComputerName "WRONG-TIME-PC" -Task SyncTime -Credential $cred</pre>
</div>
<h4>Full Time Fix Sequence</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Step 1: Set correct timezone
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PC01" -Task SetTimezone -Credential $cred
# Step 2: Sync time
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PC01" -Task SyncTime -Credential $cred</pre>
</div>
<hr class="section-divider">
<!-- DNC Configuration -->
<h3 id="how-to-dnc">How to Update DNC Configurations</h3>
<h4>Update DNC MX Hosts</h4>
<p><strong>Scenario:</strong> FtpHostPrimary/FtpHostSecondary in DNC\MX registry needs updating (hostname migration).</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Single PC
.\Invoke-RemoteMaintenance.ps1 -ComputerName "DNC-PC01" -Task UpdateDNCMXHosts -Credential $cred
# All shopfloor PCs
.\Invoke-RemoteMaintenance.ps1 -All -Task UpdateDNCMXHosts -Credential $cred</pre>
</div>
<p><strong>What it does:</strong></p>
<ol>
<li>Checks both 32-bit (WOW6432Node) and 64-bit registry paths</li>
<li>Only updates values matching the old hostname &mdash; skips unexpected values</li>
<li>Safe to run on all PCs: no-ops if DNC\MX key doesn't exist</li>
</ol>
<h4>Audit DNC Config vs UDC Backup</h4>
<p><strong>Scenario:</strong> Verify DNC registry settings match UDC backup JSON files.</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>.\Invoke-RemoteMaintenance.ps1 -All -Task AuditDNCConfig -Credential $cred -LogFile</pre>
</div>
<p><strong>What it does:</strong></p>
<ol>
<li>Reads DNC registry values (General, eFocas, Hssb, PPDCS keys)</li>
<li>Compares against UDC backup JSON files on the network share</li>
<li>Reports MATCH/MISMATCH/MISSING for each field</li>
<li>Exports CSV report to <span class="command-inline">logs/</span></li>
</ol>
<h4>Check Defect Tracker Status</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>.\Invoke-RemoteMaintenance.ps1 -PcType Shopfloor -Task CheckDefectTracker -Credential $cred</pre>
</div>
<p><strong>What it does:</strong></p>
<ol>
<li>Checks if <span class="command-inline">Defect_Tracker.exe</span> is running on each PC</li>
<li>Reports machine number + running status</li>
<li>Exports CSV report to <span class="command-inline">logs/</span></li>
</ol>
<hr class="section-divider">
<!-- File Deployment -->
<h3 id="how-to-copyfile">How to Deploy Files</h3>
<p><strong>Scenario:</strong> Push any file to remote PCs with automatic backup of existing files.</p>
<h4>Basic File Copy</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Copy a config file to a specific destination
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PC01","PC02" -Task CopyFile `
-SourcePath "\\server\share\config.json" `
-DestinationPath "C:\ProgramData\App\config.json" `
-Credential $cred</pre>
</div>
<p><strong>What it does:</strong></p>
<ol>
<li>Copies source file to <span class="command-inline">C:\Windows\Temp\</span> on remote PC via WinRM</li>
<li>Creates backup of existing file (if any) with timestamp</li>
<li>Moves temp file to final destination</li>
<li>Verifies deployment</li>
</ol>
<h4>File Copy with Post-Copy Command</h4>
<p><strong>Scenario:</strong> Deploy a file and restart a service/app in the logged-in user's session.</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Deploy eMxInfo.txt and kill DNC so it picks up the new file
.\Invoke-RemoteMaintenance.ps1 -All -Task CopyFile `
-SourcePath "\\server\share\eMxInfo.txt" `
-DestinationPath "C:\Program Files (x86)\DNC\Server Files\eMxInfo.txt" `
-RunCommand "taskkill /IM DNCMain.exe /F" `
-Credential $cred
# Deploy UDC config (no restart needed)
.\Invoke-RemoteMaintenance.ps1 -PcType Shopfloor -Task CopyFile `
-SourcePath "\\server\share\udc_webserver_settings.json" `
-DestinationPath "C:\ProgramData\UDC\udc_webserver_settings.json" `
-Credential $cred</pre>
</div>
<div class="alert alert-info">
<strong>About -RunCommand:</strong>
The <span class="command-inline">-RunCommand</span> runs via a one-shot scheduled task as the logged-in user, so it works for user-session processes (same pattern as Dashboard/Lobby Display kiosk relaunch). Use <span class="command-inline">-AsSystem</span> if the command should run as SYSTEM instead.
</div>
<hr class="section-divider">
<!-- Registry Import -->
<h3 id="how-to-importreg">How to Import Registry Files</h3>
<p><strong>Scenario:</strong> Apply registry settings from a <span class="command-inline">.reg</span> file to remote PCs.</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Import a .reg file on all shopfloor PCs
.\Invoke-RemoteMaintenance.ps1 -PcType Shopfloor -Task ImportReg `
-SourcePath "\\server\share\intranet-zone.reg" `
-Credential $cred
# Import on specific PCs
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PC01" -Task ImportReg `
-SourcePath "C:\Scripts\my-settings.reg" `
-Credential $cred</pre>
</div>
<p><strong>What it does (default &mdash; as logged-in user):</strong></p>
<ol>
<li>Copies <span class="command-inline">.reg</span> file to <span class="command-inline">C:\Windows\Temp\</span> on remote PC via WinRM</li>
<li>Creates a one-shot scheduled task as the logged-in user</li>
<li>Runs <span class="command-inline">regedit.exe /s</span> to silently import the registry file</li>
<li>Cleans up temp file and scheduled task</li>
</ol>
<div class="alert alert-info">
<strong>HKCU Support:</strong>
Because the import runs as the logged-in user (via scheduled task), both <span class="command-inline">HKLM</span> and <span class="command-inline">HKCU</span> keys in the <span class="command-inline">.reg</span> file are applied correctly. If no user is logged in, it falls back to direct import (HKLM only).
</div>
<h4>HKLM-Only / System Context</h4>
<p>Use <span class="command-inline">-AsSystem</span> when the <span class="command-inline">.reg</span> file only contains <span class="command-inline">HKLM</span> keys and you want to skip the scheduled task overhead:</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Import HKLM-only registry settings directly as SYSTEM
.\Invoke-RemoteMaintenance.ps1 -All -Task ImportReg `
-SourcePath "\\server\share\machine-policy.reg" `
-AsSystem -Credential $cred</pre>
</div>
<div class="alert alert-warning">
<strong>Warning:</strong>
Running with <span class="command-inline">-AsSystem</span> means <span class="command-inline">HKCU</span> keys in the .reg file will NOT apply to any user profile. Only use this for HKLM-only registry files.
</div>
<hr class="section-divider">
<!-- Software Deployment -->
<h3 id="how-to-software">How to Deploy Software</h3>
<h4>Install GE Aerospace Dashboard</h4>
<p><strong>Scenario:</strong> Convert a PC to a Dashboard kiosk.</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Single PC installation
.\Invoke-RemoteMaintenance.ps1 -ComputerName "NEWKIOSK-01" -Task InstallDashboard -Credential $cred
# Multiple PCs from a list
$kiosks = @("KIOSK-01", "KIOSK-02", "KIOSK-03")
.\Invoke-RemoteMaintenance.ps1 -ComputerName $kiosks -Task InstallDashboard -Credential $cred</pre>
</div>
<p><strong>What it does:</strong></p>
<ol>
<li>Pings target PC (skips if offline)</li>
<li>Copies installer from network share to <span class="command-inline">C:\Windows\Temp\</span></li>
<li>Kills running Edge kiosk</li>
<li>Runs silent installation (120-second timeout)</li>
<li>Relaunches Edge kiosk via scheduled task as the logged-in user</li>
<li>Cleans up installer and scheduled task</li>
</ol>
<div class="alert alert-success">
<strong>No reboot required</strong>
Edge relaunches automatically in the logged-in user's session.
</div>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Deploy to all Dashboard kiosks
.\Invoke-RemoteMaintenance.ps1 -PcType Dashboard -Task InstallDashboard -Credential $cred
# Deploy to all Lobby Display kiosks
.\Invoke-RemoteMaintenance.ps1 -PcType "Lobby Display" -Task InstallLobbyDisplay -Credential $cred</pre>
</div>
<h4>Uninstall Dashboard or Lobby Display</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Remove Dashboard
.\Invoke-RemoteMaintenance.ps1 -ComputerName "OLD-KIOSK" -Task UninstallDashboard -Credential $cred
# Remove Lobby Display
.\Invoke-RemoteMaintenance.ps1 -ComputerName "OLD-LOBBY" -Task UninstallLobbyDisplay -Credential $cred</pre>
</div>
<hr class="section-divider">
<!-- Reboot -->
<h3>How to Reboot PCs</h3>
<h4>Single PC Reboot</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>.\Invoke-RemoteMaintenance.ps1 -ComputerName "PC-TO-REBOOT" -Task Reboot -Credential $cred</pre>
</div>
<div class="alert alert-warning">
<strong>Note:</strong>
Reboot has a 30-second delay to allow graceful shutdown.
</div>
<h4>Reboot by PC Type</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Reboot all Dashboard PCs
.\Invoke-RemoteMaintenance.ps1 -PcType Dashboard -Task Reboot -Credential $cred
# Reboot all Lobby Display PCs
.\Invoke-RemoteMaintenance.ps1 -PcType "Lobby Display" -Task Reboot -Credential $cred</pre>
</div>
<h4>Reboot by Business Unit</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Reboot all HPT PCs during maintenance window
.\Invoke-RemoteMaintenance.ps1 -BusinessUnit HPT -Task Reboot -Credential $cred</pre>
</div>
<hr class="section-divider">
<!-- Batch Operations -->
<h3 id="how-to-batch">How to Run Batch Operations</h3>
<h4>Using a Computer List File</h4>
<p>Create a text file with one hostname per line:</p>
<div class="code-block">
<pre># shopfloor-pcs.txt
PC001
PC002
PC003
PC004
PC005</pre>
</div>
<p>Run tasks against the list:</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>.\Invoke-RemoteMaintenance.ps1 -ComputerListFile ".\shopfloor-pcs.txt" -Task FlushDNS -Credential $cred</pre>
</div>
<h4>Running Multiple Tasks in Sequence</h4>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Maintenance routine for a PC
$pc = "SHOPFLOOR-PC01"
# Step 1: Clear caches
.\Invoke-RemoteMaintenance.ps1 -ComputerName $pc -Task ClearUpdateCache -Credential $cred
.\Invoke-RemoteMaintenance.ps1 -ComputerName $pc -Task ClearBrowserCache -Credential $cred
# Step 2: Disk cleanup
.\Invoke-RemoteMaintenance.ps1 -ComputerName $pc -Task DiskCleanup -Credential $cred
# Step 3: Repair
.\Invoke-RemoteMaintenance.ps1 -ComputerName $pc -Task DISM -Credential $cred
.\Invoke-RemoteMaintenance.ps1 -ComputerName $pc -Task SFC -Credential $cred
# Step 4: Sync time
.\Invoke-RemoteMaintenance.ps1 -ComputerName $pc -Task SetTimezone -Credential $cred
.\Invoke-RemoteMaintenance.ps1 -ComputerName $pc -Task SyncTime -Credential $cred
# Step 5: Reboot
.\Invoke-RemoteMaintenance.ps1 -ComputerName $pc -Task Reboot -Credential $cred</pre>
</div>
<hr class="section-divider">
<!-- TARGETING STRATEGIES -->
<h2 id="targeting">Targeting Strategies</h2>
<h3>By Individual PCs</h3>
<p><strong>Best for:</strong> Specific troubleshooting, targeted fixes</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>.\Invoke-RemoteMaintenance.ps1 -ComputerName "PROBLEM-PC" -Task DISM -Credential $cred</pre>
</div>
<h3>By PC Type</h3>
<p><strong>Best for:</strong> Type-specific maintenance, software updates</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># All CMM PCs
.\Invoke-RemoteMaintenance.ps1 -PcType CMM -Task DiskCleanup -Credential $cred
# All Dashboard kiosks
.\Invoke-RemoteMaintenance.ps1 -PcType Dashboard -Task Reboot -Credential $cred</pre>
</div>
<h3>By Business Unit</h3>
<p><strong>Best for:</strong> Department-specific maintenance windows</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># All Blisk area PCs
.\Invoke-RemoteMaintenance.ps1 -BusinessUnit Blisk -Task SyncTime -Credential $cred</pre>
</div>
<h3>All Shopfloor PCs</h3>
<p><strong>Best for:</strong> Global maintenance, security updates</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Flush DNS everywhere
.\Invoke-RemoteMaintenance.ps1 -All -Task FlushDNS -Credential $cred -ThrottleLimit 10</pre>
</div>
<h3>Using a List File</h3>
<p><strong>Best for:</strong> Custom groups, staged rollouts</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre>.\Invoke-RemoteMaintenance.ps1 -ComputerListFile ".\phase1-pcs.txt" -Task DISM -Credential $cred</pre>
</div>
<hr class="section-divider">
<!-- TROUBLESHOOTING -->
<h2 id="troubleshooting">Troubleshooting</h2>
<div class="troubleshooting">
<h4>Issue: Task Times Out</h4>
<p><strong>Cause:</strong> Task takes longer than session timeout.</p>
<p><strong>Resolution:</strong> DISM and SFC can take a long time. Check if task completed on target:</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Check DISM log
Invoke-Command -ComputerName "PC01" -Credential $cred -ScriptBlock {
Get-Content "C:\Windows\Logs\DISM\dism.log" -Tail 50
}</pre>
</div>
</div>
<div class="troubleshooting">
<h4>Issue: "Access Denied" on Some PCs</h4>
<p><strong>Cause:</strong> Credentials don't have admin rights on that PC.</p>
<p><strong>Resolution:</strong></p>
<ul>
<li>Use different credentials</li>
<li>Add account to local Administrators group on target</li>
<li>Check if UAC is blocking remote admin</li>
</ul>
</div>
<div class="troubleshooting">
<h4>Issue: Software Installation Fails</h4>
<p><strong>Cause:</strong> Network share not accessible or installer missing.</p>
<p><strong>Resolution:</strong></p>
<ul>
<li>Verify network share path is accessible</li>
<li>Check installer exists at expected location</li>
<li>Verify credentials can access the share</li>
</ul>
</div>
<div class="troubleshooting">
<h4>Issue: Reboot Doesn't Happen</h4>
<p><strong>Cause:</strong> User cancelled shutdown or application blocked it.</p>
<p><strong>Resolution:</strong></p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Force immediate reboot (no 30-second delay)
Invoke-Command -ComputerName "PC01" -Credential $cred -ScriptBlock {
Restart-Computer -Force
}</pre>
</div>
</div>
<div class="troubleshooting">
<h4>Issue: ImportReg HKCU Keys Not Applied</h4>
<p><strong>Cause:</strong> No user is logged in on the target PC, or <span class="command-inline">-AsSystem</span> was used.</p>
<p><strong>Resolution:</strong></p>
<ul>
<li>Ensure a user is logged in on the target PC</li>
<li>Remove <span class="command-inline">-AsSystem</span> flag if the .reg file contains HKCU keys</li>
<li>Check the script output for "No logged-in user found" messages</li>
</ul>
</div>
<hr class="section-divider">
<!-- BEST PRACTICES -->
<h2 id="best-practices">Best Practices</h2>
<h3>1. Start Small</h3>
<p>Test on one PC before running against groups:</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Test on single PC first
.\Invoke-RemoteMaintenance.ps1 -ComputerName "TEST-PC" -Task DISM -Credential $cred</pre>
</div>
<h3>2. Use Appropriate Throttle Limits</h3>
<table>
<thead><tr><th>Scenario</th><th>Recommended ThrottleLimit</th></tr></thead>
<tbody>
<tr><td>Fast network, light tasks</td><td>10-25</td></tr>
<tr><td>Normal operations</td><td>5 (default)</td></tr>
<tr><td>Heavy tasks (DISM, Defrag)</td><td>2-3</td></tr>
<tr><td>Slow network</td><td>2-3</td></tr>
</tbody>
</table>
<h3>3. Schedule Disruptive Tasks</h3>
<p>Run reboots and heavy tasks during maintenance windows:</p>
<ul>
<li>DISM/SFC: After hours</li>
<li>Disk optimization: After hours</li>
<li>Reboots: During shift changes or maintenance windows</li>
</ul>
<h3>4. Verify Before Rebooting</h3>
<p>Always confirm which PCs will be affected:</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Check PC type before reboot
.\Update-ShopfloorPCs-Remote.ps1 -PcType Dashboard -WhatIf</pre>
</div>
<h3>5. Keep Logs</h3>
<p>Use the <span class="command-inline">-LogFile</span> flag or redirect output for audit trail:</p>
<div class="code-block">
<button class="copy-button" onclick="copyCode(this)">Copy</button>
<pre># Built-in logging
.\Invoke-RemoteMaintenance.ps1 -All -Task SyncTime -Credential $cred -LogFile
# Or redirect output manually
.\Invoke-RemoteMaintenance.ps1 -All -Task SyncTime -Credential $cred | Tee-Object -FilePath "maintenance-log-$(Get-Date -Format 'yyyyMMdd').txt"</pre>
</div>
<!-- SUCCESS MESSAGE -->
<div class="alert alert-success">
<strong>Reference Complete</strong>
This document covers all 22 maintenance tasks available in Invoke-RemoteMaintenance.ps1. For questions or updates, contact the GE Aerospace DT Team.
</div>
</div>
<!-- FOOTER -->
<div class="footer">
<div class="footer-content">
<p><strong>For questions or support, contact GE Aerospace DT Team</strong></p>
<p style="font-size: 0.9em;">Document Classification: Internal Use Only</p>
</div>
</div>
</div>
<!-- JAVASCRIPT -->
<script>
// Copy code functionality
function copyCode(button) {
const codeBlock = button.parentElement;
const code = codeBlock.querySelector('pre').textContent;
navigator.clipboard.writeText(code).then(() => {
const originalText = button.textContent;
button.textContent = 'Copied!';
button.classList.add('copied');
setTimeout(() => {
button.textContent = originalText;
button.classList.remove('copied');
}, 2000);
}).catch(err => {
console.error('Failed to copy text: ', err);
button.textContent = 'Failed';
setTimeout(() => {
button.textContent = 'Copy';
}, 2000);
});
}
// Smooth scrolling for navigation links
document.querySelectorAll('.nav a').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
// Update page title from h1
const mainTitle = document.querySelector('.header h1');
if (mainTitle) {
document.title = mainTitle.textContent + ' - GE Aerospace Knowledge Base';
}
</script>
</body>
</html>