The following code retrieves a Server Data Object (SDO) for the Administrator.
HRESULT hr;
_bstr_t bstrUserName = L"Administrator";
CComPtr<IUnknown> pUserUnknown;
hr = pSdoMachine->GetUserSDO(
DATA_STORE_LOCAL,
bstrUserName,
(IUnknown**) &pUserUnknown
);
if (FAILED(hr))
{
return hr;
}
CComPtr<ISdo> pUserSDO;
hr = pUserUnknown->QueryInterface(
__uuidof(ISdo),
(void**) &pUserSDO
);
if (FAILED(hr))
{
return hr;
}
Related topics
Attaching to an SDO-Enabled Computer
Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.
