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

前端之家收集整理的这篇文章主要介绍了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方法).

猜你在找的Bash相关文章