powershell – 带自定义shell的Windows 10 Kiosk Modus

我想设置一个Kiosk Modus,用户登录自动启动浏览器.

Windows Custom 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),$restart_shell)

# Enable Shell Launcher

$ShellLauncherClass.SetEnabled($TRUE)

当我执行此powershell脚本并使用自助服务终端登录时,我只看到黑屏.

为什么这么复杂?

Windows允许您通过一个注册表行或在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项目.如果“系统”键不存在,请创建它.由于这是在“当前用户”Hive中完成的,因此这只会影响当前登录用户.

我在一些只能访问一个特定站点的自助服务终端计算机上使用它,并且它工作正常(我使用域计算机,所以我使用GPO方法).

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...