# Create a handle to the class instance so we can call the static methods.
$ShellLauncherClass = [wmiclass]"\\localhost\root\standardcimv2\embedded:WESL_UserSetting"
function Get-UsernameSID($AccountName) {
$NTUserObject = New-Object System.Security.Principal.NTAccount($AccountName)
$NTUserSID = $NTUserObject.Translate([System.Security.Principal.SecurityIdentifier])
return $NTUserSID.Value
}
# This well-known security identifier (SID) corresponds to the BUILTIN\Administrators group.
$Admins_SID = "S-1-5-32-544"
# Name of Kiosk account
$Kiosk_SID = Get-UsernameSID("KiOSK")
# Define actions to take when the shell program exits.
$restart_shell = 0
$restart_device = 1
$shutdown_device = 2
# Remove the new custom shells.
$ShellLauncherClass.RemoveCustomShell($Admins_SID)
$ShellLauncherClass.RemoveCustomShell($Kiosk_SID)
# Enable Shell Launcher
$ShellLauncherClass.SetEnabled( 1 )
# Set the custom shell for the kiosk, and restart the shell if it's closed.
$ShellLauncherClass.SetCustomShell($Kiosk_SID, "C:\Program Files (x86)\Omnivex\Moxie\Player\Omnivex Moxie Player.exe", ($null), ($null), $restart_shell)
# Set the admin's shell to Explorer
$ShellLauncherClass.SetCustomShell($Admins_SID, "explorer.exe")
Comments