Advertisement
dutch2005

Custom - Restricted user experience

Jan 16th, 2025
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # PowerShell script to enable Kiosk mode with the Multi-App Launcher in Windows 11
  2. # More details here https://woshub.com/configure-kiosk-mode-windows/
  3.  
  4. $MultiKioskModeConfig= @"
  5. <?xml version="1.0" encoding="utf-8"?>
  6. <AssignedAccessConfiguration xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/AssignedAccess/2017/config" xmlns:default="http://schemas.microsoft.com/AssignedAccess/2017/config" xmlns:rs5="http://schemas.microsoft.com/AssignedAccess/201810/config" xmlns:v3="http://schemas.microsoft.com/AssignedAccess/2020/config" xmlns:v5="http://schemas.microsoft.com/AssignedAccess/2022/config">
  7.  <Profiles>
  8.    <Profile Id="{9A2A490F-10F6-4764-974A-43B19E722C23}">
  9.      <AllAppsList>
  10.        <AllowedApps>
  11.          <App AppUserModelId="Microsoft.WindowsCalculator_8wekyb3d8bbwe!App" />
  12.          <App AppUserModelId="Microsoft.Windows.Photos_8wekyb3d8bbwe!App" />
  13.          <App DesktopAppPath="%windir%\explorer.exe" />
  14.          <App AppUserModelId="windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel" />
  15.          <App AppUserModelId="%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe" />  
  16.        </AllowedApps>
  17.      </AllAppsList>
  18.      <rs5:FileExplorerNamespaceRestrictions>
  19.        <rs5:AllowedNamespace Name="Downloads" />
  20.        <v3:AllowRemovableDrives />
  21.      </rs5:FileExplorerNamespaceRestrictions>
  22.      <v5:StartPins><![CDATA[{
  23.          "pinnedList":[
  24.            {"packagedAppId":"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App"},
  25.            {"packagedAppId":"Microsoft.Windows.Photos_8wekyb3d8bbwe!App"},
  26.            {"desktopAppLink":"%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\File Explorer.lnk"},
  27.            {"packagedAppId": "windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel"},
  28.             {"desktopAppLink": "%ALLUSERSPROFILE%\\Microsoft\\Windows\\Start Menu\\Programs\\Microsoft Edge.lnk"},         
  29.          ]
  30.        }]]></v5:StartPins>
  31.      <Taskbar ShowTaskbar="true" />
  32.    </Profile>
  33.  </Profiles>
  34.  <Configs>
  35.    <Config>
  36.      <AutoLogonAccount/>
  37.      <DefaultProfile Id="{c79c6e82-283e-47f7-8460-5cad6d5016c3}"/>
  38.    </Config>
  39.  </Configs>
  40. </AssignedAccessConfiguration>
  41. "@
  42. $namespaceName="root\cimv2\mdm\dmmap"
  43. $className="MDM_AssignedAccess"
  44. $obj = Get-CimInstance -Namespace $namespaceName -ClassName $className
  45. $obj.Configuration = [System.Net.WebUtility]::HtmlEncode($MultiKioskModeConfig)
  46. Set-CimInstance -CimInstance $obj
  47.  
  48.  
  49. # Turn off and clean up the Multi-App Kiosk mode settings in Windows 11
  50. # $obj  = Get-CimInstance -Namespace "root\cimv2\mdm\dmmap" -ClassName "MDM_AssignedAccess"
  51. # $obj.Configuration = $NULL
  52. # Set-CimInstance -CimInstance $obj
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement