Active Directory Users - How to activate a program/script


1. I am using:
      DWORD dwResult = ssl_net::CNetInfo::GetUserInfo (pUsers, computerName); // computer);

on my XP to enumerate the users (See source below).
and I do get all the users.
But I tried it on server with "Active Directory" and I did not receive the "Active Directory" users.

2. How can I see the computers and users in the Active Directory"?

3. Is there a way to Activate (launch) a program in a remote PC (using the Active-Directory or in any other way).?


      USER_LIST* pUsers = new USER_LIST;
      DWORD dwResult = ssl_net::CNetInfo::GetUserInfo (pUsers, computerName); // computer);
      if (ERROR_SUCCESS == dwResult)
            // Process the results
            POSITION pos = pUsers->GetHeadPosition ();
            while (NULL != pos) {
                  NET_DISPLAY_USER ndu = pUsers->GetNext (pos);
                  CString szName, szComment, szFlags, szFullName, szUserID;

                  szName.Format ("%S", ndu.usri1_name);
                  szComment.Format ("%S", ndu.usri1_comment);
                  szFlags.Format ("%d", ndu.usri1_flags);
                  szFullName.Format ("%S", ndu.usri1_full_name);
                  //szUserID.Format ("%d", ndu.usri1_user_id);

                  if (ndu.usri1_flags != 66049) continue;

                  if (pUsersDlg)
         int i=pUsersDlg->list.InsertItem  (0, szName);
                   pUsersDlg->list.SetItemText (i, 1, szFullName);
                   pUsersDlg->list.SetItemText (i, 2, szComment);
Who is Participating?
mahesh1402Connect With a Mentor Commented:
>>How can I see the computers and users in the Active Directory"?

Following may be of your use :
Simple Active directory browsing / navigate :

An easy to use class to list Active Directory Users :

Using the Active Directory Object Selection Dialog :

Following will be simple sample to retrieve users list :

VapiSoftAuthor Commented:
Thank you.
I will check it tomoroow or on Tuesday on a server, and get back to you.
VapiSoftAuthor Commented:

In all four samples, I did not see any that enables me to execute a program or a script in the selected computer.
Did I miss anything?

Also, I tried to compile
Using the Active Directory Object Selection Dialog :

and received the following link error:
mfc42ud.lib : fatal error LNK1113: invalid machine type

To clarify what I need is to install a pice of program in each computer in the network and execute it (somthing like MSI).

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

VapiSoftAuthor Commented:

I managed to compile
and it works greate - thank you.
But I still don't understand how to activate (launch) an application in the remote computer (using the AD)?

I think you need something like Remote Desktop to execute an application to remote PC.. how ever I dont have idea its possible with AD or how to do that using AD...

You may check remote desktop


Other thirdpary remote application launching utilities like :

VapiSoftAuthor Commented:

I know that it can be done view AD.
Remote Desktop is not what I need.
In any case thaks.
All Courses

From novice to tech pro — start learning today.