Platform SDK: Smart Card Enrollment Control

ISCrdEnr::getUserName

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.

objSCEnroll.getUserName (dwFlags As Long) As String

Parameters

objSCEnroll
Object expression that resolves to a SCrdEnr object.
dwFlags
This value must be either 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, such as "someone@microsoft.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 0, the method returns the user's UPN name if it exists. If the user doesn't have a UPN name, the method returns the user's SAM name.

Remarks

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

Example Code in VBScript

' Retrieve the user name.
Dim strUser
strUser = Senroll.getUserName(0)

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Library: Included as a resource in Scrdenrl.dll.

See Also

ISCrdEnr::resetUser, ISCrdEnr::selectUserName, ISCrdEnr::setUserName