User User User User Class

Definition

Represents a user.

public : sealed class User : IUserpublic sealed class User : IUserPublic NotInheritable Class User Implements IUser// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

AuthenticationStatus AuthenticationStatus AuthenticationStatus AuthenticationStatus

Gets the authentication status of the user.

public : UserAuthenticationStatus AuthenticationStatus { get; }public UserAuthenticationStatus AuthenticationStatus { get; }Public ReadOnly Property AuthenticationStatus As UserAuthenticationStatus// You can use this property in JavaScript.

NonRoamableId NonRoamableId NonRoamableId NonRoamableId

Gets the user's non-roamable id.

public : PlatForm::String NonRoamableId { get; }public string NonRoamableId { get; }Public ReadOnly Property NonRoamableId As string// You can use this property in JavaScript.
Value
PlatForm::String string string string

The user's non-roamable Id.

Type Type Type Type

Gets the user type.

public : UserType Type { get; }public UserType Type { get; }Public ReadOnly Property Type As UserType// You can use this property in JavaScript.
Value
UserType UserType UserType UserType

The user type.

Methods

CreateWatcher() CreateWatcher() CreateWatcher() CreateWatcher()

Creates a UserWatcher which enumerates users and raises events when the collection of users changes or when a user’s authentication state changes.

public : static UserWatcher CreateWatcher()public static UserWatcher CreateWatcher()Public Static Function CreateWatcher() As UserWatcher// You can use this method in JavaScript.
Returns

A UserWatcher which enumerates users and raises events when the collection of users changes.

See Also

FindAllAsync() FindAllAsync() FindAllAsync() FindAllAsync()

Finds all users asynchronously.

public : static IAsyncOperation<IVectorView<User>> FindAllAsync()public static IAsyncOperation<IReadOnlyList<User>> FindAllAsync()Public Static Function FindAllAsync() As IAsyncOperation( Of IReadOnlyListUser )// You can use this method in JavaScript.
Returns
IAsyncOperation<IVectorView<User>> IAsyncOperation<IReadOnlyList<User>> IAsyncOperation<IReadOnlyList<User>> IAsyncOperation<IReadOnlyList<User>>

When this method completes successfully, it returns a list (type IVectorView ) of Users.

See Also

FindAllAsync(UserType) FindAllAsync(UserType) FindAllAsync(UserType) FindAllAsync(UserType)

Finds all users of a given type asynchronously.

public : static IAsyncOperation<IVectorView<User>> FindAllAsync(UserType type)public static IAsyncOperation<IReadOnlyList<User>> FindAllAsync(UserType type)Public Static Function FindAllAsync(type As UserType) As IAsyncOperation( Of IReadOnlyListUser )// You can use this method in JavaScript.
Parameters
type
UserType UserType UserType UserType

The type of users to find.

Returns
IAsyncOperation<IVectorView<User>> IAsyncOperation<IReadOnlyList<User>> IAsyncOperation<IReadOnlyList<User>> IAsyncOperation<IReadOnlyList<User>>

When this method completes successfully, it returns a list (type IVectorView ) of Users.

See Also

FindAllAsync(UserType, UserAuthenticationStatus) FindAllAsync(UserType, UserAuthenticationStatus) FindAllAsync(UserType, UserAuthenticationStatus) FindAllAsync(UserType, UserAuthenticationStatus)

Finds all users of a given type and authentication status asynchronously.

public : static IAsyncOperation<IVectorView<User>> FindAllAsync(UserType type, UserAuthenticationStatus status)public static IAsyncOperation<IReadOnlyList<User>> FindAllAsync(UserType type, UserAuthenticationStatus status)Public Static Function FindAllAsync(type As UserType, status As UserAuthenticationStatus) As IAsyncOperation( Of IReadOnlyListUser )// You can use this method in JavaScript.
Parameters
type
UserType UserType UserType UserType

The type of users to find.

Returns
IAsyncOperation<IVectorView<User>> IAsyncOperation<IReadOnlyList<User>> IAsyncOperation<IReadOnlyList<User>> IAsyncOperation<IReadOnlyList<User>>

When this method completes successfully, it returns a list (type IVectorView ) of Users.

See Also

GetFromId(String) GetFromId(String) GetFromId(String) GetFromId(String)

Gets a user with a given Id.

public : static User GetFromId(PlatForm::String nonRoamableId)public static User GetFromId(String nonRoamableId)Public Static Function GetFromId(nonRoamableId As String) As User// You can use this method in JavaScript.
Parameters
nonRoamableId
PlatForm::String String String String

The Id of the user to get.

Returns

The user with the given Id.

GetPictureAsync(UserPictureSize) GetPictureAsync(UserPictureSize) GetPictureAsync(UserPictureSize) GetPictureAsync(UserPictureSize)

Gets a user's picture asynchronously.

public : IAsyncOperation<IRandomAccessStreamReference> GetPictureAsync(UserPictureSize desiredSize)public IAsyncOperation<IRandomAccessStreamReference> GetPictureAsync(UserPictureSize desiredSize)Public Function GetPictureAsync(desiredSize As UserPictureSize) As IAsyncOperation( Of IRandomAccessStreamReference )// You can use this method in JavaScript.
Parameters
desiredSize
UserPictureSize UserPictureSize UserPictureSize UserPictureSize

The desired size of the user's picture to return.

Returns
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
userAccountInformation
See Also

GetPropertiesAsync(IVectorView) GetPropertiesAsync(IVectorView) GetPropertiesAsync(IVectorView) GetPropertiesAsync(IVectorView)

Gets properties for the user.

public : IAsyncOperation<IPropertySet> GetPropertiesAsync(IVectorView<PlatForm::String> values)public IAsyncOperation<IPropertySet> GetPropertiesAsync(IReadOnlyList<String> values)Public Function GetPropertiesAsync(values As IReadOnlyList<String>) As IAsyncOperation( Of IPropertySet )// You can use this method in JavaScript.
Parameters
values
IVectorView<PlatForm::String> IReadOnlyList<String> IReadOnlyList<String> IReadOnlyList<String>

The properties to get. Use the KnownUserProperties class to obtain property names.

Returns

When this method completes, it returns the requested properties. If a property is missing or unavailable, it is reported as an empty string.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
userAccountInformation
See Also

GetPropertyAsync(String) GetPropertyAsync(String) GetPropertyAsync(String) GetPropertyAsync(String)

Gets a property for the user. Use the KnownUserProperties class to obtain property names.

public : IAsyncOperation<PlatForm::Object> GetPropertyAsync(PlatForm::String value)public IAsyncOperation<object> GetPropertyAsync(String value)Public Function GetPropertyAsync(value As String) As IAsyncOperation( Of object )// You can use this method in JavaScript.
Parameters
value
PlatForm::String String String String

The property to get.

Returns

When this method completes, it returns the requested property. If the property is missing or unavailable, an empty string is returned.

Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
userAccountInformation
See Also