This script sample shows how to show all users or last login user in Windows 8.
Sometimes users want to show all user on login screen. This script is to achieve that.
Step 1: Double click the script and it will show a UAC.

Step 2: Press Yes to continue, then there is a message box. Select what you want.

Step 3: After that, you can get a message.

Note
1. After script executed, it will take effect when you restart the computer or logoff.
2. Do not delete TakeOwnerShip.ps1 file, otherwise it will show an error.
Here are some code snippets for your references.
set oShell = CreateObject("WScript.Shell")
oShell.Run "PowerShell -nologo " & PsPath , 0, True
' Create a temp file with the script that regini.exe will use
strFileName = FSO.GetTempName
set oFile = FSO.CreateTextFile(strFileName)
oFile.WriteLine "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\UserSwitch [2 8 19]"
oFile.WriteLine "Enabled = REG_DWORD 1"
oFile.WriteLine "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
oFile.WriteLine "AutoAdminLogon = REG_SZ 0"
oFile.Close
' Change registry permissions with regini.exe
set oShell = CreateObject("WScript.Shell")
oShell.Run "regini " & strFileName, 0, true
set oShell = CreateObject("WScript.Shell") oShell.Run "PowerShell -nologo "& PsPath , 0, True ' Create a temp file with the script that regini.exe will use strFileName = FSO.GetTempName set oFile = FSO.CreateTextFile(strFileName) oFile.WriteLine "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\UserSwitch [2 8 19]" oFile.WriteLine "Enabled = REG_DWORD 1" oFile.WriteLine "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" oFile.WriteLine "AutoAdminLogon = REG_SZ 0" oFile.Close ' Change registry permissions with regini.exe set oShell = CreateObject("WScript.Shell") oShell.Run "regini "& strFileName, 0, true
Windows 8 or later version