Partager via


WEDL_AssignedAccess (Industry 8.1)

7/8/2014

Review the syntax, member, and examples of the WEDL_AssignedAcess WMI provider class for Windows Embedded 8.1 Industry (Industry 8.1).

This Windows Management Instrumentation (WMI) provider class configures settings for assigned access.

Syntax

class WEDL_AssignedAccess {
    [Key] string UserSID;
    [Read, Write] string AppUserModelId;
    [Read] sint32 Status;
};

Members

The following tables list any methods and properties that belong to this class.

Methods

This class contains no methods.

Properties

Property

Data type

Qualifiers

Description

UserSID

string

[key]

The security identifier (SID) for the standard account that you want to use as the assigned access account.

This account cannot be an administrator account or a domain account.

AppUserModelId

string

[read, write]

The Application User Model ID (AUMID) of the Windows Store app to launch for the assigned access account.

Status

Boolean

none

Indicates the current status of the assigned access configuration:

ValueDescription
0A valid account is configured, but no Windows Store app is specified. Assigned access is not enabled.
1 Assigned access is enabled.
0x100UserSID error: cannot find the account.
0x101UserSID error: the account is not a local account.
0x102UserSID error: the account is an administrator account.
0x103UserSID error: the account profile does not exist.
0x200AppUserModelID error: cannot find the Windows Store app.
0x201Task Scheduler error: Could not schedule task. Make sure that the Task Scheduler service is running.
0xffffffffUnspecified error.

Remarks

You must use an administrator account to change any properties in this class.

Changes to assigned access do not affect any sessions that are currently signed in; you must sign out and sign back in.

For more information about finding the AUMID of an installed Windows Store app, see Find the Application User Model ID of an installed app.

Example

The following Windows PowerShell script demonstrates how to use this class to set up an assigned access account.

#---Define variables---

$COMPUTER = "localhost"
$NAMESPACE = "root\standardcimv2\embedded"

# Define the assigned access account. 
# To use a different account, change $AssignedAccessAccount to a standard local account that is present on your device.

$AssignedAccessAccount = "KioskAccount"

# Define the Windows Store app to launch, in this example, use the Application Model User ID (AUMID) for Bing News.
# To use a different Windows Store app, change $AppAUMID to the AUMID of the Windows Store app to launch.
# The Windows Store app must be installed for the account.

$AppAUMID = "Microsoft.BingNews_8wekyb3d8bbwe!AppexNews"

#---Define helper functions---

function Get-UsernameSID($AccountName) {

    # This function retrieves the SID for a user account on a machine.
    # This function does not check to verify that the user account actually exists.

    $NTUserObject = New-Object System.Security.Principal.NTAccount($AccountName)
    $NTUserSID = $NTUserObject.Translate([System.Security.Principal.SecurityIdentifier])

    return $NTUserSID.Value
}

#---Set up the new assigned access account---

# Get the SID for the assigned access account.

$AssignedAccessUserSID = Get-UsernameSID($AssignedAccessAccount)

# Check to see if an assigned access account is already set up, and if so, clear it.

$AssignedAccessConfig = get-WMIObject -namespace $NAMESPACE -computer $COMPUTER -class WEDL_AssignedAccess

if ($AssignedAccessConfig) {

    # Configuration already exists.  Delete it so that we can create a new one, since only one assigned access account can be set up at a time.

    $AssignedAccessConfig.delete();

}

# Configure assigned access to launch the specified Windows Store app for the specified account.

Set-WmiInstance -class WEDL_AssignedAccess -ComputerName $COMPUTER -Namespace $NAMESPACE -Arguments @{
        UserSID = $AssignedAccessUserSID;
        AppUserModelId = $AppAUMID
        } | Out-Null;
    
# Confirm that the settings were created properly.    
    
$AssignedAccessConfig = get-WMIObject -namespace $NAMESPACE -computer $COMPUTER -class WEDL_AssignedAccess

if ($AssignedAccessConfig) {
        
    "Set up assigned access for the " + $AssignedAccessAccount + " account."
    "  UserSID = " + $AssignedAccessConfig.UserSid
    "  AppModelId = " + $AssignedAccessConfig.AppUserModelId

} else {

    "Could not set up assigned access account."
}
 

See Also

Concepts

Assigned access