$message = "Do you want to disable automatic logon (if it is not already disabled)?"
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", `
  "Disables automatic logon."
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", `
  "Does nothing."
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)
$result = $host.ui.PromptForChoice($title, $message, $options, 1)
switch ($result) {
  0 {
    $dir = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon'
    Set-ItemProperty $dir -Name AutoAdminLogon -Type String -Value 0
  }
}
