« Previous Next »

Thread: Active Directory Output Problem

Last post 10-30-2009 4:32 PM by pjcollier. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 10-27-2009, 3:02 PM

    • hg363
    • Top 100 Contributor
    • Joined on 09-04-2007, 7:44 PM
    • Posts 54

    Active Directory Output Problem

    Hi to all forum members. Please can some one kindly help me with this slight problem.

    I am running a query using LP and it works fine, except that the data when written to a CSV file is all on one line. Here is the query

     output_path = "'C:\WINDOWS\Temp\joop\" & user_name & "\Group Membership.csv'"

    Set objinputformat = CreateObject("MSUtil.LogQuery.ADSInputFormat")

    Set objoutputformat = CreateObject("MSUtil.LogQuery.CSVoutputFormat")

    objinputformat.objClass = "user"


    strQuery = "SELECT cn, memberOf  INTO " & output_path & " FROM 'Domain Name' where sAMAccountName='HG363'"

    objLogParser.ExecuteBatch strQuery, objInputFormat , objOutputFormat

    Please can some one show me what I need to do to fix this, kind regards HG363 London UK

  • 10-30-2009, 4:32 PM In reply to

    Re: Active Directory Output Problem

    This is the correct output.  You specified one account name, thus you got one output.  The memberOf attribute in active directory is a multi-valued string.  You can process the output separately to get the individual groups -- a split function (on the pipe character) would work well for this.
Page 1 of 1 (2 items)
Microsoft Communities