Files
powershell-scripts/tools/Enable-WinRM.bat
cproudlock 7c30939234 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>
2025-12-30 13:08:08 -05:00

41 lines
1.1 KiB
Batchfile

@echo off
:: Enable WinRM for Remote Management
:: Run as Administrator
echo ============================================
echo Enable WinRM for ShopDB Remote Management
echo ============================================
echo.
:: Check for admin rights
net session >nul 2>&1
if %errorLevel% neq 0 (
echo ERROR: Please run as Administrator!
echo Right-click and select "Run as administrator"
pause
exit /b 1
)
echo Enabling WinRM...
powershell -Command "Enable-PSRemoting -Force -SkipNetworkProfileCheck" 2>nul
echo.
echo Setting firewall rules...
powershell -Command "Set-NetFirewallRule -Name 'WINRM-HTTP-In-TCP' -Enabled True -Profile Any" 2>nul
netsh advfirewall firewall add rule name="WinRM-HTTP" dir=in localport=5985 protocol=TCP action=allow >nul 2>&1
echo.
echo Starting WinRM service...
sc config winrm start= auto >nul
net start winrm >nul 2>&1
echo.
echo ============================================
echo WinRM Enabled Successfully!
echo This PC can now be remotely managed.
echo ============================================
echo.
echo Hostname: %COMPUTERNAME%
echo.
pause