+ Reply to Thread
Results 1 to 8 of 8

Active Directory Query with Macro

  1. #1
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Active Directory Query with Macro

    Hi All,
    I would like to check with you guys if any of you had a working Macro that could query Active Directory? I did some searches here and tested the solution that was given from previous request however it was not working for me.
    Basically, what I need is to query a LANID and return the Security groups that LANID is a Member of.

    Perhaps on Cell A1 I will put in the LAN ID and I like the result to be returned on Cell B1 onwards.

    Can this be done? Appreciate your help.
    Thanks in advance.

    Similar post also started on the below links:
    Mr. Excel
    VBA Express
    Last edited by Andrew.Trevayne; 09-06-2011 at 02:42 AM.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Active Directory Query with Macro

    IF you post the link or the code, you can probably get some help. Those types of things can be limited by your security.

    Here is a link to something that might help. http://www.mrexcel.com/forum/showthread.php?t=2252

    In this example, the data is put into c:\temp\MyExport.xls. I think that I got it from Microsoft's Active Directory help. Your IS people might not like you running this.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Active Directory Query with Macro

    Hi Kenneth,
    The below VBA is what I tried but nothing is happening. This is exactly what I want to accomplish but like the original TS, i also could not get it to work. What am I doing wrong here? Kindly advise.
    Many thanks

    Script

    Please Login or Register  to view this content.
    Similar post also started on the below links:
    Mr. Excel
    VBA Express
    Last edited by Andrew.Trevayne; 09-05-2011 at 10:43 AM.

  4. #4
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Active Directory Query with Macro

    See if this code helps any. If not active directory then the code needs to check for that as shown here.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Active Directory Query with Macro

    Hi Kenneth,
    Thanks. Although this is not really what I am looking for. I only need the Security group a User is a member of. The code you posted is quite complicated and too advance for me. ^^
    (I am posting on behalf of my colleague from the IT Security group)

    I hope someone could have a look at the code I posted and help us find out what could possibly be wrong with it. Thank you very much in advance.

  6. #6
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Active Directory Query with Macro

    I am making a little progress. Apparently the script can query those on the OU
    Name.com\Users but could not read those on the OU Name.com\Company Users

    My guess is that the script is looking on the Users OU instead of the Company Users OU.
    Hope you could advise.

    Once more here is the script I am trying to modify:

    Please Login or Register  to view this content.
    Similar post also started on the below links:
    Mr. Excel
    VBA Express
    Last edited by Andrew.Trevayne; 09-05-2011 at 10:43 AM.

  7. #7
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Active Directory Query with Macro

    Appreciate any help or reference, I'm quite desperate. Thank you ^^

  8. #8
    Forum Contributor
    Join Date
    11-02-2010
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    353

    Re: Active Directory Query with Macro

    Hi everyone,
    I got help from a very nice guy on a diffent forum

    I am now closing this thread. Thank you very much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1