Active Directory Users - How to activate a program/script

Posted on 2006-10-29
Last Modified: 2013-11-20

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);
Question by:VapiSoft
  • 4
  • 2
LVL 22

Accepted Solution

mahesh1402 earned 500 total points
ID: 17829339
>>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 :


Author Comment

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

Author Comment

ID: 17835079

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).

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.


Author Comment

ID: 17875770

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)?

LVL 22

Expert Comment

ID: 17876303
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 :


Author Comment

ID: 17876371

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

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Turn a spreadsheet into a vba executable. 2 86
Include multiple hostnames in this command? 3 55
Host to IP 7 78
sum67 challenge 35 98
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question