查找已安装应用的应用程序用户模型 IDFind the Application User Model ID of an installed app

若要配置分配的访问权限 (kiosk 模式), 需要在设备上安装的应用程序用户模型 ID (AUMID)。To configure assigned access (kiosk mode), you need the Application User Model ID (AUMID) of apps installed on a device. 你可以使用 Windows PowerShell、文件资源管理器或注册表查找 AUMID。You can find the AUMID by using Windows PowerShell, File Explorer, or the registry.

使用 Windows PowerShell 查找 AUMIDTo find the AUMID by using Windows PowerShell

若要获取为当前用户安装的所有应用的名称和 Aumid, 请打开 Windows PowerShell 命令提示符, 然后输入以下命令:To get the names and AUMIDs for all apps installed for the current user, open a Windows PowerShell command prompt and enter the following command:

get-StartApps

若要获取为其他用户安装的 Windows 应用商店应用的名称和 Aumid, 请打开 Windows PowerShell 命令提示符, 然后输入以下命令:To get the names and AUMIDs for Windows Store apps installed for another user, open a Windows PowerShell command prompt and enter the following commands:

$installedapps = get-AppxPackage

$aumidList = @()
foreach ($app in $installedapps)
{
    foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id)
    {
        $aumidList += $app.packagefamilyname + "!" + $id
    }
}

$aumidList

你可以将–用户<用户名>或– Allusers 参数添加到 add-appxpackage cmdlet 以列出其他用户的 aumid。You can add the –user <username> or the –allusers parameters to the get-AppxPackage cmdlet to list AUMIDs for other users. 必须使用提升的 Windows PowerShell 提示才能使用– user 或– allusers 参数。You must use an elevated Windows PowerShell prompt to use the –user or –allusers parameters.

使用文件资源管理器查找 AUMIDTo find the AUMID by using File Explorer

若要获取为当前用户安装的所有应用的名称和 Aumid, 请执行以下步骤:To get the names and AUMIDs for all apps installed for the current user, perform the following steps:

  1. 打开 "运行", 输入 " shell: Appsfolder", 然后选择 "确定"Open Run, enter shell:Appsfolder, and select OK.

  2. 将打开文件资源管理器窗口。A File Explorer window opens. Alt > 视图 > 选择 "详细信息"。Press Alt > View > Choose details.

  3. 在 "选择详细信息" 窗口中, 选择 " AppUserModelId", 然后选择 "确定"In the Choose Details window, select AppUserModelId, and then select OK. (您可能需要将视图设置从磁贴更改为 "详细信息"。)(You might need to change the View setting from Tiles to Details.)

"选择详细信息" 选项的图像

使用注册表查找当前用户的已安装应用的 AUMIDTo find the AUMID of an installed app for the current user by using the registry

查询注册表只能返回有关为当前用户安装的 Microsoft Store 应用的信息, 而 Windows PowerShell 查询可以查找设备上任何帐户的信息。Querying the registry can only return information about Microsoft Store apps that are installed for the current user, while the Windows PowerShell query can find information for any account on the device.

在命令提示符处, 键入以下命令:At a command prompt, type the following command:

reg query HKEY_CURRENT_USER\Software\Classes\ActivatableClasses\Package /s /f AppUserModelID | find "REG_SZ"

示例Example

以下代码示例在 Windows PowerShell 中创建一个函数, 该函数返回指定用户的已安装应用的 Aumid 数组。The following code sample creates a function in Windows PowerShell that returns an array of AUMIDs of the installed apps for the specified user.

function listAumids( $userAccount ) {

    if ($userAccount -eq "allusers")
    {
        # Find installed packages for all accounts. Must be run as an administrator in order to use this option.
        $installedapps = Get-AppxPackage -allusers
    }
    elseif ($userAccount)
    {
        # Find installed packages for the specified account. Must be run as an administrator in order to use this option.
        $installedapps = get-AppxPackage -user $userAccount
    }
    else
    {
        # Find installed packages for the current account.
        $installedapps = get-AppxPackage
    }

    $aumidList = @()
    foreach ($app in $installedapps)
    {
        foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id)
        {
            $aumidList += $app.packagefamilyname + "!" + $id
        }
    }

    return $aumidList
}

以下 Windows PowerShell 命令演示如何在创建 listAumids 函数后调用该函数。The following Windows PowerShell commands demonstrate how you can call the listAumids function after you have created it.

# Get a list of AUMIDs for the current account:
listAumids

# Get a list of AUMIDs for an account named “CustomerAccount”:
listAumids("CustomerAccount")

# Get a list of AUMIDs for all accounts on the device:
listAumids("allusers")