如何在 Windows 10 企业版上运行应用程序作为外壳替换 [英] How to run an application as shell replacement on Windows 10 Enterprise

查看:48
本文介绍了如何在 Windows 10 企业版上运行应用程序作为外壳替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在运行 Windows 10 企业版的计算机上创建一个特殊帐户.此帐户将在登录时直接启动应用程序而不是默认 shell,退出应用程序应强制计算机重新启动.

I need to create a special account on a computer running Windows 10 Enterprise. This account would launch an application directly on login instead of the default shell and exiting the application should force the computer to restart.

我能够使用配置控制台和锁定功能在 Windows 8.1 Embedded Industry Pro 上轻松完成此操作.

I was able to do this easily on Windows 8.1 Embedded Industry Pro using the configuration console and lockdown features.

现在,在 Windows 10 上,我尝试遵循 technet 上的两个教程 WESL_UserSetting在 Windows 10 专业版、企业版或教育版上设置信息亭

Now, on Windows 10 I try to follow the two tutorials on technet WESL_UserSetting and Set up a kiosk on Windows 10 Pro, Enterprise, or Education

但是,这两个教程都不起作用.我已设法执行其中描述的脚本,但它们没有任何效果(我已对其进行了修改,因此它们不会删除 shell 集).

However, neither of the tutorials work. I have managed to execute the scripts described in them but they have no effect (I've modified them so they do not remove the shells set).

最后我得到了以下代码:

Finally I've ended up with the following code:

$COMPUTER = "localhost"
$NAMESPACE = "root\standardcimv2\embedded"
$ACCOUNT_NAME = "cmp"

$ShellLauncherClass = [wmiclass]"\\$COMPUTER\${NAMESPACE}:WESL_UserSetting"


$NTUserObject = New-Object System.Security.Principal.NTAccount($ACCOUNT_NAME)
$NTUserSID = $NTUserObject.Translate([System.Security.Principal.SecurityIdentifier]).Value

$NTUser_Shell = Get-WmiObject -namespace $NAMESPACE -computer $COMPUTER -class WESL_UserSetting | 
    where {$_.Sid -eq $NTUserSID}

if ($NTUser_Shell) {
    "`Custom shell already set for [$ACCOUNT_NAME] removing it"
    $ShellLauncherClass.RemoveCustomShell($NTUserSID)
}

$restart_shell = 0
$restart_device = 1
$shutdown_device = 2

$ShellLauncherClass.SetCustomShell($NTUserSID, "cmd.exe", ($null), ($null), $restart_device)

"`nCurrent settings for custom shells:"
Get-WmiObject -namespace $NAMESPACE -computer $COMPUTER -class WESL_UserSetting | Select Sid, Shell, DefaultAction

在管理 powershell 中执行此脚本会产生所需的输出:

Executing this script in an admin powershell produces the desired output:

Custom shell already set for [cmp] removing it

Current settings for custom shells:

Sid                                            Shell   DefaultAction
---                                            -----   -------------
S-1-5-21-3842421150-1098587697-2315725148-1002 cmd.exe             1

然而,以cmp"用户身份登录只会显示标准的 Windows 10 shell.

However logging as the 'cmp' user simply shows the standard Windows 10 shell.

为了能够运行程序而不是标准 shell,我应该改变什么?

What should I change in order to be able to run a program instead of a standard shell?

推荐答案

您是否尝试过更改用户外壳?

Have you tried changing the users shell?

https://msdn.microsoft.com/en-us/library/ms838576(v=WinEmbedded.5).aspx

您需要设置几个注册表项.第一个能够为用户提供唯一的 shell,第二个定义启动的可执行文件而不是资源管理器.

There are a few registry keys you need to set. First one enables the ability to give the user a unique shell, the second one defines the executable that starts instead of explorer.

这篇关于如何在 Windows 10 企业版上运行应用程序作为外壳替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆