Created
January 24, 2022 00:52
-
-
Save MartinMiles/99e8ca221238472c5fd77f917543da87 to your computer and use it in GitHub Desktop.
Allows policy for users without password to RDP to a given machine
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
$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