B
B
blackeangel2019-03-19 06:49:16
C++ / C#
blackeangel, 2019-03-19 06:49:16

How to get user account name?

How to get the user's name?
For example, the username is ivanov_ii, and the start menu says Ivanov Ivan Ivanovich, this is exactly what you need to get.
In Google they say that you need to use LDAP. However, I haven't seen any real examples.
There is this:

hr = ADsGetObject(L"LDAP://CN=computers,DC=mydomain,DC=local", IID_IADsContainer, (void**) &pCont );

In Borland C++ Builder 6.0 , I know that in VB6 it looks like this:
(void**) &pCont
Sub asdas()
Set SI_ = CreateObject("ADSystemInfo")
Set Un_ = GetObject("LDAP://" & SI_.UserName)
UZ_ = Un_.DisplayName
msgbox UZ_
End Sub

It returns the full name from the user account that is logged on to the domain. Not his login.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Adamos, 2019-03-19
@Adamos

Isn't it? With level = 2, specifically usri2_full_name is returned
https://docs.microsoft.com/en-us/windows/desktop/a...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question