Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MartinMiles/99e8ca221238472c5fd77f917543da87 to your computer and use it in GitHub Desktop.
Save MartinMiles/99e8ca221238472c5fd77f917543da87 to your computer and use it in GitHub Desktop.
Allows policy for users without password to RDP to a given machine
$name = $PSScriptRoot + "\" + $MyInvocation.MyCommand.Name
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$name`"" -Verb RunAs; exit }
$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa"
$Name = "LimitBlankPasswordUse"
$value = "0"
New-ItemProperty -Path $registryPath -Name $name -Value $value ` -PropertyType DWORD -Force | Out-Null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment