Add maintenance toolkit, DNC/OnGuard utilities
- Add Invoke-RemoteMaintenance.ps1: Remote maintenance tasks (DISM, SFC, disk cleanup, etc.) - Add DNC/, dncfix/, edncfix/: DNC configuration utilities - Add onguard/: OnGuard integration scripts - Add tools/: Additional utility scripts - Update remote-execution/README.md with maintenance toolkit docs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,57 @@ Or run PowerShell directly:
|
||||
|
||||
## PowerShell Scripts
|
||||
|
||||
### Invoke-RemoteMaintenance.ps1
|
||||
**Remote maintenance toolkit** - Execute maintenance tasks on shopfloor PCs via WinRM.
|
||||
|
||||
**Available Tasks:**
|
||||
|
||||
| Category | Task | Description |
|
||||
|----------|------|-------------|
|
||||
| **Repair** | `DISM` | Run DISM /Online /Cleanup-Image /RestoreHealth |
|
||||
| | `SFC` | Run SFC /scannow (System File Checker) |
|
||||
| **Optimization** | `OptimizeDisk` | TRIM for SSD, Defrag for HDD |
|
||||
| | `DiskCleanup` | Windows Disk Cleanup (temp files, updates) |
|
||||
| | `ClearUpdateCache` | Clear Windows Update cache (fixes stuck updates) |
|
||||
| | `ClearBrowserCache` | Clear Chrome/Edge cache files |
|
||||
| **Services** | `RestartSpooler` | Restart Print Spooler service |
|
||||
| | `FlushDNS` | Clear DNS resolver cache |
|
||||
| | `RestartWinRM` | Restart WinRM service |
|
||||
| **Time/Date** | `SetTimezone` | Set timezone to Eastern Standard Time |
|
||||
| | `SyncTime` | Force time sync with domain controller |
|
||||
|
||||
**Usage:**
|
||||
```powershell
|
||||
# Run DISM on a single PC
|
||||
.\Invoke-RemoteMaintenance.ps1 -ComputerName "G1ZTNCX3ESF" -Task DISM
|
||||
|
||||
# Optimize disks on multiple PCs
|
||||
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PC01","PC02" -Task OptimizeDisk
|
||||
|
||||
# Run disk cleanup on all shopfloor PCs
|
||||
.\Invoke-RemoteMaintenance.ps1 -All -Task DiskCleanup
|
||||
|
||||
# Clear Windows Update cache (fixes stuck updates)
|
||||
.\Invoke-RemoteMaintenance.ps1 -ComputerName "PC01" -Task ClearUpdateCache
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
| Parameter | Default | Description |
|
||||
|-----------|---------|-------------|
|
||||
| `-ComputerName` | - | Single or multiple computer names/IPs |
|
||||
| `-ComputerListFile` | - | Path to text file with computer list |
|
||||
| `-All` | - | Target all shopfloor PCs from ShopDB |
|
||||
| `-Task` | (required) | Maintenance task to execute |
|
||||
| `-Credential` | (prompts) | PSCredential for authentication |
|
||||
| `-ThrottleLimit` | `5` | Maximum concurrent sessions |
|
||||
|
||||
**Notes:**
|
||||
- DISM and SFC tasks can take 10-30 minutes per PC
|
||||
- OptimizeDisk automatically detects SSD vs HDD
|
||||
- ClearUpdateCache stops Windows Update service, clears cache, restarts service
|
||||
|
||||
---
|
||||
|
||||
### Invoke-RemoteAssetCollection.ps1
|
||||
**Remote collection via WinRM HTTP** - Execute asset collection on multiple PCs using WinRM over HTTP (port 5985).
|
||||
|
||||
@@ -151,28 +202,33 @@ $cred = Get-Credential
|
||||
## Architecture
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────┐
|
||||
│ Management Server │
|
||||
│ ┌───────────────────────────────┐ │
|
||||
│ │ Invoke-RemoteAssetCollection │ │
|
||||
│ │ Update-ShopfloorPCs-Remote │ │
|
||||
│ └──────────────┬────────────────┘ │
|
||||
└─────────────────┼───────────────────┘
|
||||
│ WinRM (5985/5986)
|
||||
▼
|
||||
┌─────────────────────────────────────┐
|
||||
│ Shopfloor PC 1 │
|
||||
│ ┌───────────────────────────────┐ │
|
||||
│ │ Update-PC-CompleteAsset.ps1 │ │
|
||||
│ └───────────────────────────────┘ │
|
||||
└─────────────────────────────────────┘
|
||||
┌─────────────────────────────────────┐
|
||||
│ Shopfloor PC 2 │
|
||||
│ ┌───────────────────────────────┐ │
|
||||
│ │ Update-PC-CompleteAsset.ps1 │ │
|
||||
│ └───────────────────────────────┘ │
|
||||
└─────────────────────────────────────┘
|
||||
... (parallel execution)
|
||||
┌──────────────────────────────────────────────────────────────┐
|
||||
│ Management Server │
|
||||
│ ┌────────────────────────────────────────────────────────┐ │
|
||||
│ │ Update-ShopfloorPCs-Remote.ps1 - Data collection │ │
|
||||
│ │ Invoke-RemoteMaintenance.ps1 - Maintenance tasks │ │
|
||||
│ │ Invoke-RemoteAssetCollection.ps1 - General execution │ │
|
||||
│ └────────────────────────┬───────────────────────────────┘ │
|
||||
└───────────────────────────┼──────────────────────────────────┘
|
||||
│ WinRM (5985/5986)
|
||||
▼
|
||||
┌──────────────────────────────────────────────────────────────┐
|
||||
│ Shopfloor PCs │
|
||||
│ ┌────────────────────────────────────────────────────────┐ │
|
||||
│ │ Data Collection: │ │
|
||||
│ │ - System info, network, DNC config, installed apps │ │
|
||||
│ │ │ │
|
||||
│ │ Maintenance Tasks: │ │
|
||||
│ │ - DISM, SFC, Disk Cleanup, Optimize Disk │ │
|
||||
│ │ - Restart Spooler, Flush DNS, Clear Caches │ │
|
||||
│ └────────────────────────────────────────────────────────┘ │
|
||||
└──────────────────────────────────────────────────────────────┘
|
||||
│
|
||||
▼ HTTPS POST
|
||||
┌──────────────────────────────────────────────────────────────┐
|
||||
│ ShopDB API │
|
||||
│ api.asp -> MySQL (machines, communications, dncconfig) │
|
||||
└──────────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## WinRM Setup
|
||||
|
||||
Reference in New Issue
Block a user