Created
October 31, 2012 14:09
-
-
Save ebibibi/3987219 to your computer and use it in GitHub Desktop.
Windowsに指定したユーザー名、パスワードで自動ログオンをさせるPowerShellスクリプトです。
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
Param( | |
$DefaultUserName = "", | |
$DefaultPassword = "", | |
$DefaultDomainName = "" | |
) | |
$RegLogonKey = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" | |
Set-itemproperty -path $RegLogonKey -name "AutoAdminLogon" -value 1 | |
Set-itemproperty -path $RegLogonKey -name "DefaultUsername" -value $DefaultUserName | |
Set-itemproperty -path $RegLogonKey -name "DefaultPassword" -value $DefaultPassword | |
if($DefaultDomainName -ne "") | |
{ | |
Set-itemproperty -path $RegLogonKey -name "DefaultDomainName" -value $DefaultDomainName | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment