powershell – 带自定义shell的Windows 10 Kiosk Modus
发布时间:2020-12-15 18:27:13 所属栏目:安全 来源:网络整理
导读:我想设置一个Kiosk Modus,用户登录并自动启动浏览器. Windows Custom Shell $COMPUTER = "localhost"$NAMESPACE = "rootstandardcimv2embedded"# Create a handle to the class instance so we can call the static methods.$ShellLauncherClass = [wmicla
我想设置一个Kiosk Modus,用户登录并自动启动浏览器.
Windows Custom Shell $COMPUTER = "localhost" $NAMESPACE = "rootstandardcimv2embedded" # 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 BUILTINAdministrators 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 filesinternet exploreriexplore.exe www.google.com",($null),$restart_shell) # Enable Shell Launcher $ShellLauncherClass.SetEnabled($TRUE) 当我执行此powershell脚本并使用自助服务终端登录时,我只看到黑屏.
为什么这么复杂?
Windows允许您通过一个注册表行或在Group Policys的帮助下设置自定义用户界面. GPO: User ConfigurationAdministrative TemplatesSystemCustom User Interface 在这里你可以设置例如 C:Program FilesInternet Exploreriexplore.exe -k www.google.de 这不仅会打开Internet Explorer而不是浏览器作为用户界面,IE也将全屏显示(-k选项). 注册地: HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem 在这里,您需要一个与上述内容相同的REG_SZ项目.如果“系统”键不存在,请创建它.由于这是在“当前用户”Hive中完成的,因此这只会影响当前登录的用户. 我在一些只能访问一个特定站点的自助服务终端计算机上使用它,并且它工作正常(我使用域计算机,所以我使用GPO方法). (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |