UserInformation.GetDomainNameAsync UserInformation.GetDomainNameAsync UserInformation.GetDomainNameAsync UserInformation.GetDomainNameAsync UserInformation.GetDomainNameAsync Method

Definition

Gets the domain name for the user.

Important

The UserInformation class is not supported on Windows 10 or later. Use the User class instead. See Remarks in the UserInformation class documentation.

public : static IAsyncOperation<Platform::String> GetDomainNameAsync()
static IAsyncOperation<winrt::hstring> GetDomainNameAsync() const;
public static IAsyncOperation<string> GetDomainNameAsync()
Public Shared Function GetDomainNameAsync() As IAsyncOperation(Of string)
Windows.System.UserProfile.UserInformation.getDomainNameAsync().done( /* Your success and error handlers */ );
Returns

A string that represents the domain name for the user.

Remarks

Important

The UserInformation class is not supported on Windows 10 or later. Use the User class instead. See Remarks in the UserInformation class documentation.

Access to the domain name can be blocked by privacy settings (for example, if the UserInformation::NameAccessAllowed property is false). If access is blocked, this method returns an empty string.

This method does not throw an exception.

See Also