This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ========================= | |
# Enable PowerShell Remoting (HTTPS only, LocalSubnet restricted) | |
# powershell -ExecutionPolicy Bypass -File .\winrm.ps1 | |
# ========================= | |
# User-configurable variables | |
$allowLocalUsers = $false # Set to $true to enable local accounts via WinRM | |
# Ensure script is running as Administrator | |
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { |