سؤال

I am trying to retrieve some attributes of a terminal service user(eg.ms-TS-Allow-Logon) through ADSI. I tried something like

LPOLESTR pszPropertyList [] = {L"ms-TS-Allow-Logon"};
swprintf_s(pszSearchFilter, dwLength, L"(&(objectCategory=person)(objectClass=user)");
hr = pContainerToSearch->ExecuteSearch(pszSearchFilter,
                                               pszPropertyList,
                                               sizeof(pszPropertyList)/sizeof(LPOLESTR),
                                               &hSearch
                                             );

But it doesn't work. Where can I get the exact attribute names to be passed to an ADSI call for all these terminal service names(like ms-TS-Allow-Logon, ms-TS-Endpoint-Type etc)

Thanks Sunil

هل كانت مفيدة؟

المحلول

according to MSDN ms-TS-Allow-Logon attribute the ldap name for this attribute is msTSAllowLogon

نصائح أخرى

We can get all the attribute names using the ADSI tool that gets shipped along with the activedirectory

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top