Rediger

Del via


ISCrdEnr::getUserName method

The getUserName method retrieves the name of the user on whose behalf the certificate enrollment is intended.

Before calling this method, you must specify the user name in a call to ISCrdEnr::selectUserName or ISCrdEnr::setUserName.

Syntax

HRESULT getUserName(
  [in]  DWORD     dwFlags,
  [out] BSTR *pbstrUserName
);

SCrdEnr.getUserName( _
  ByVal dwFlags, _
  ByRef pbstrUserName _
)

Parameters

dwFlags [in]

This value must be either zero (0), SCARD_ENROLL_UPN_NAME, or SCARD_ENROLL_SAM_COMPATIBLE_NAME.

If this value is SCARD_ENROLL_UPN_NAME, getUserName returns the user's Universal Principal Name (UPN), such as "someone@example.com".

If this value is SCARD_ENROLL_SAM_COMPATIBLE_NAME, the method returns the user's security access manager (SAM) name in the format "DOMAIN\USER".

If this value is zero, the method returns the user's UPN name if it exists. If the user does not have a UPN name, the method returns the user's SAM name.

pbstrUserName [out]

A pointer to a string that returns the name of the user.

Return value

C++

If the method succeeds, the method returns S_OK.

If the method fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

VB

String that represents the name of the user.

Remarks

You can specify the name of the user to whom the smart card is issued by calling either ISCrdEnr::setUserName or ISCrdEnr::selectUserName. After a user name has been specified, its value can be retrieved by calling getUserName.

Requirements

Requirement Value
Minimum supported client
None supported
Minimum supported server
Windows Server 2003 [desktop apps only]
DLL
Scrdenrl.dll
IID
IID_ISCrdEnr is defined as 753988a1-1357-436d-9cf5-f089bdd67d64

See also

ISCrdEnr

ISCrdEnr::resetUser

ISCrdEnr::selectUserName

ISCrdEnr::setUserName