Powershell Skype for Business处于Kiosk模式

Powershell Skype for Business处于Kiosk模式,powershell,kiosk,skype-for-business,Powershell,Kiosk,Skype For Business,我想在Kiosk模式下运行Skype for Business,因此我使用与之相同的脚本,但我的脚本不起作用 我替换了以下行: $Cashier_SID = Get-UsernameSID("bbwallonepeop") $ShellLauncherClass.SetCustomShell($Cashier_SID, "C:\Program Files (x86)\Microsoft Office\Office16\lync.exe", ($null), ($null), $restart_

我想在Kiosk模式下运行Skype for Business,因此我使用与之相同的脚本,但我的脚本不起作用

我替换了以下行:

$Cashier_SID = Get-UsernameSID("bbwallonepeop")

$ShellLauncherClass.SetCustomShell($Cashier_SID, "C:\Program Files (x86)\Microsoft Office\Office16\lync.exe", ($null), ($null), $restart_shell)
但它不能启动Skype,也不能与任何其他应用程序一起使用。 运行脚本时,登录时唯一看到的是黑屏,然后我可以使用ctrl+alt+del启动Taskmanager,然后打开资源管理器并找到powershell exe以运行禁用脚本

因此发生了一些事情,explorer.exe不再启动(即使是管理员也不启动,即使它应该为管理员启动),但Skype没有启动:/

有什么想法吗?以下是完整的脚本:

$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.

$Cashier_SID = Get-UsernameSID("bbwallonepeop")

# Define actions to take when the shell program exits.

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

# Examples. You can change these examples to use the program that you want to use as the shell.

# This example sets the command prompt as the default shell, and restarts the device if the command prompt is closed. 

$ShellLauncherClass.SetDefaultShell("cmd.exe", $restart_device)

# Display the default shell to verify that it was added correctly.

$DefaultShellObject = $ShellLauncherClass.GetDefaultShell()

"`nDefault Shell is set to " + $DefaultShellObject.Shell + " and the default action is set to " + $DefaultShellObject.defaultaction

# Set lync/Skype for busniess as the shell for "Cashier", and restart the machine if it is closed.

$ShellLauncherClass.SetCustomShell($Cashier_SID, "C:\Program Files (x86)\Microsoft Office\Office16\lync.exe", ($null), ($null), $restart_shell)

# Set Explorer as the shell for administrators.

$ShellLauncherClass.SetCustomShell($Admins_SID, "explorer.exe")

# View all the custom shells defined.

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

# Enable Shell Launcher

$ShellLauncherClass.SetEnabled($TRUE)

$IsShellLauncherEnabled = $ShellLauncherClass.IsEnabled()

"`nEnabled is set to " + $IsShellLauncherEnabled.Enabled

# Remove the new custom shells.

#$ShellLauncherClass.RemoveCustomShell($Admins_SID)

#$ShellLauncherClass.RemoveCustomShell($Cashier_SID)

# Disable Shell Launcher

#$ShellLauncherClass.SetEnabled($FALSE)

#$IsShellLauncherEnabled = $ShellLauncherClass.IsEnabled()

"`nEnabled is set to " + $IsShellLauncherEnabled.Enabled

哦,我使用的是Windows 10 Pro,在许多网站上,它说thw Pro版本不能与该脚本一起使用: