我想设置一个用户login的Kiosk Modus,浏览器自动启动。
Windows自定义shell
$COMPUTER = "localhost" $NAMESPACE = "root\standardcimv2\embedded" # Create a handle to the class instance so we can call the static methods. $ShellLauncherClass = [wmiclass]"\\$COMPUTER\${NAMESPACE}:WESL_UserSetting" # This well-known security identifier (SID) corresponds to the BUILTIN\Administrators group. $Admins_SID = "S-1-5-32-544" # Create a function to retrieve the SID for a user account on a machine. function Get-UsernameSID($AccountName) { $NTUserObject = New-Object System.Security.Principal.NTAccount($AccountName) $NTUserSID = $NTUserObject.Translate([System.Security.Principal.SecurityIdentifier]) return $NTUserSID.Value } # Get the SID for a user account named "Cashier". Rename "Cashier" to an existing account on your system to test this script. $Kiosk_SID = Get-UsernameSID("Kiosk") # Define actions to take when the shell program exits. $restart_shell = 0 $restart_device = 1 $shutdown_device = 2 # Set Internet Explorer as the shell for "Cashier", and restart the machine if it's closed. $ShellLauncherClass.SetCustomShell($Kiosk_SID, "c:\program files\internet explorer\iexplore.exe www.google.com", ($null), ($null), $restart_shell) # Enable Shell Launcher $ShellLauncherClass.SetEnabled($TRUE)
当我执行这个PowerShell脚本和login亭我只看到一个黑色的屏幕。
为什么这么复杂?
Windows允许您通过一个registry行或在Group Policys的帮助下设置自定义用户界面。
GPO:
User Configuration\Administrative Templates\System\Custom User Interface
在这里你可以设置例如
C:\Program Files\Internet Explorer\iexplore.exe -k www.google.de
这不仅会打开Internet Explorer而不是浏览器作为用户界面,IE也会全屏显示(-k选项)。
注册地:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System
在这里你需要一个REG_SZ项目,其内容与上面相同。 如果“系统”密钥不存在,请创build它。 由于这是在“当前用户”configuration单元中完成的,因此这只会影响当前login的用户。
我在一些自助服务terminal电脑上只能使用一个特定的网站,而且工作的很好(我使用域计算机,所以我使用的是GPO方法)。
这已被Windows 10replace为一个称为Shell Launcher的function,使用它您可以configurationWin32应用程序来启动而不是Explorer。
更重要的是,Windows甚至可以configuration为在closures时自动重新启动应用程序,或者甚至在应用程序被禁止打开时重新启动PC。
这里有一些关于这个主题的更多信息 。 我会在今天晚些时候逐步更新。