The following code demonstrates how you can retrieve the user name from the user context:
INSSUserContext* pUser;
IPropertyMap* pIUserPropMap;
HRESULT hres;
VARIANT userName;
hres = pUser->QueryInterface(IID_IPropertyMap,
(void**) &pIUserPropMap);
hres = pIUserPropMap->Read(_T("NSS_USER_NAME"),
&userName);
[Previous][Next]