How do I output MemberOf so it lines up in one column in my output?

Hi,The goal of the code below is to output the MemberOf info in the same column for each user.So if a user is a member of 5 groups, I need to output the 5 groups so they will all fall under the MemberOf columnheading in my output. Now, they fall to a new line, but in Column 1. Thanks for the help.Get-aduser -Filter * -property * |
Sort Surname |
Select @{n="UserName";e={$_.SamAccountName}},@{n="First Name";e={$_.GivenName}},@{n="Last Name";e={$_.SurName}},@{n="Date of Last Login";e={$_.LastLogonDate}},@{n="Date Created";e={$_.Created}},@{n="Account Active";e={$_.Enabled}}, @{name="MemberOf";expression={$_.memberof -join ";"}} |
Export-csv $env:Homepath\MyUserAccts2.csv -NoTypeInformation "
Thanks for your help! SdeDot

Try:
Write-Output """User Name"",""First Name"",""Last Name"",""Date of Last Login"",""Date Created"",""Account Active"",""Member Of""" |
Out-File .\MyUserAccts2.csv -Encoding ascii
foreach ($User in (Get-ADUser -Filter * -Properties memberOf | Sort Surname)) {
if ($User.MemberOf) {
$FirstGroup = $true
foreach ($Group in $User.MemberOf) {
$GroupName = (Get-ADGroup -Identity $Group).Name
if ($FirstGroup) {
Write-Output """$($User.SamAccountName)"",""$($User.GivenName)"",""$($User.SurName)"",""$($User.LastLogonDate)"",""$($User.Created)"",""$($User.Enabled)"",""$GroupName""" |
Out-File .\MyUserAccts2.csv -Encoding ascii -Append
$FirstGroup = $false
} else {
Write-Output """ "","" "","" "","" "","" "","" "",""$($GroupName)""" |
Out-File .\MyUserAccts2.csv -Encoding ascii -Append
} else {
Write-Output """$($User.SamAccountName)"",""$($User.GivenName)"",""$($User.SurName)"",""$($User.LastLogonDate)"",""$($User.Created)"",""$($User.Enabled)"","" """ |
Out-File .\MyUserAccts2.csv -Encoding ascii -Append
Sam Boutros, Senior Consultant, Software Logic, KOP, PA http://superwidgets.wordpress.com (Please take a moment to Vote as Helpful and/or Mark as Answer, where applicable)

Similar Messages

  • HOw to I get thumbnails to show in more than one column in Finder?

    When viewing images in Finder - they only show up in one column when I am in the thumnail view - how can I get them to show in multiple columns?
    Thanks

    This is Column view. When you select any item in any column, another column comes up on the right until an icon - with no content - is displayed in the far right column.

  • How to display mapviewer labels in two lines instead of one?

    Hi,
    I have been using the addJDBCTheme to display the map along with the labels as follows:
    mapviewer.addJDBCTheme("aaa","a", "SELECT geom, col1 || ':' || col2 label_value from table_name","GEOM","","styleName","label_value","T.ROAD NAME" ,false);
    So the label is displayed as col1Value:col2Value.
    Now I need to display the label as follows:
    col1Value
    col2Value
    I tried using this
    mapviewer.addJDBCTheme("aaa","a", "SELECT geom, col1 || chr(10) || col2 label_value from table_name","GEOM","","styleName","label_value","T.ROAD NAME" ,false);
    But it doesnt work. This displays col1Valuecol2Value
    So I tried using this:
    mapviewer.addJDBCTheme("aaa","a", "SELECT geom, col1 label_value from table_name UNION ALL SELECT geom, col2 label_value from table_name","GEOM","","styleName","label_value","T.ROAD NAME" ,false);
    This actually works. Meaning it displays the label in two lines. But the two lines are almost attached together, there is no space between them at all. It is sometimes very difficult to read.
    Would really appreciate any suggestions to resolve this issue.
    Is there any other solution to display a label in two lines? I tried changing the label style to set the line-height. But that does'nt work either.
    Lakshmi

    Multiline label aren't supported as yet.
    JayantDoes MapViewer 10.1.3 (the latest version for present) support it?

  • Display column values as a series/legend on a line chart where one column value can be more than one category

    Hi Everyone
    I don't know if this is possible or not, so I will describe it. I have a column in a table called Filing. There are currently three values in it ("Abuse", "Neglect", "Voluntary") and each record has this populated. I also have
    the below slicer for the column also.
    I would like to add a fourth value called "Abuse/Neglect" that would identify instances where both an Abuse and Neglect petition was filed, which is a subset of the Abuse and Neglect records in the Filing column.
    My question is, is it possible to create a line chart that has the 4 Filing possibilities: "Abuse", "Neglect", "Voluntary", "Abuse/Neglect" as the Series/Legend in the line chart?
    The problem is that there are records that are more than one category: Abuse or Neglect records can also be Abuse/Neglect.
    Paul

    Hi Paul,
    According to your description, there is a column with the values ("Abuse", "Neglect", "Voluntary") in your table, now what you need to is that add another value "Abuse/Neglect" in this column, and then use it
    as Series/Legend in the line chart, right?
    In this case, you can add calculated column to your table based on your logic. A calculated column is a column that you add to an existing PowerPivot table. Instead of pasting or importing values in the column, you create a DAX formula that defines
    the column values. The calculated column can be used in a PivotTable, PivotChart, or Power View report as you would any other data column. Please refer to the link below to see the details.
    https://msdn.microsoft.com/en-us/library/gg413492%28v=sql.110%29.aspx?f=255&MSPPError=-2147217396
    Regards,
    Charlie Liao
    TechNet Community Support

  • ALV grid display the subtotal not getting for one column at the output

    Hi,
    I am working one report ALV grid display and subtotal is not getting for one paricular coulumn.
    Eventhough that column has some values.
    So can anyone give the proper solution.
    Waiting quick response.
    Best Regards,
    Bansi

    Hi
    see this link .
    https://wiki.sdn.sap.com/wiki/display/ABAP/SUBTOTALinALV
    or try this program.
    REPORT zalv.
    DATA:
    t_sflight TYPE TABLE OF sflight,
    fs_sflight TYPE sflight.
    DATA:
    r_container TYPE REF TO cl_gui_custom_container,
    r_grid TYPE REF TO cl_gui_alv_grid.
    *FIELD CATALOG
    DATA:
    t_fcat TYPE lvc_t_fcat,
    fs_fcat TYPE lvc_s_fcat.
    *SORTING THE BASIC LIST
    DATA:
    t_sort TYPE lvc_t_sort,
    fs_sort TYPE lvc_s_sort.
    fs_fcat-fieldname = 'PRICE'.
    fs_fcat-do_sum = 'X'.
    APPEND fs_fcat TO t_fcat.
    fs_sort-spos ='1'.
    fs_sort-fieldname = 'CARRID'.
    fs_sort-down = 'X'.
    fs_sort-group = '*'.
    fs_sort-subtot = 'X'.
    APPEND fs_sort TO t_sort.
    SELECT * FROM sflight INTO TABLE t_sflight.
    CALL SCREEN 100.
    *& Module STATUS_0100 OUTPUT
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'SCREEN1'.
    SET TITLEBAR 'TITLE1'.ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    MODULE user_command_0100 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    **& Module HANDLER OUTPUT
    MODULE list OUTPUT.
    CREATE OBJECT r_container
    EXPORTING
    container_name = 'CONTAINER'.
    CREATE OBJECT r_grid
    EXPORTING
    i_parent = r_container.
    CALL METHOD r_grid->set_table_for_first_display
    EXPORTING
    i_structure_name = 'SFLIGHT'
    CHANGING
    it_fieldcatalog = t_fcat
    it_outtab = t_sflight
    it_sort = t_sort.
    ENDMODULE. "list OUTPUT
    Regards
    Hareesh Menon

  • Line chart with one line per distinct column value

    Hi,
    For example I have a task dataobject with three fields
    type
    timeCompleted
    duration
    I would like to have a line chart that plots the average duration of tasks over time. With a separate line for each task type. Is this possible? All the examples seem to have one line correspond to one column on the dataobject.
    Jeremy

    Hi Alexandre,
    Thanks for the reply. I understand now, I didn't realise you could add the same data object multiple times with different filters. So for each task type I add the task data object to the view with a filter on the task type and this creates a new line in the chart.
    I was hoping that when data for a new task type reached the bam then I could make it automatically create a new line in the graph for that type. Oh well, I guess the creation of a new task type will be relativly rare.
    Jeremy

  • How To Insert Cells Into One Column Only

    Can anyone advise me, how to insert a cell (or multiple cells) into +just one column+ whilst leaving everything else on the sheet exactly as it is?
    I'm migrating from Excel and can't find this functionality in Numbers
    Thanks in advance for any help

    Thank you for taking the time to reply, thereby removing the misery of me continuing to search for this absent function!
    I really wanted to like the iWork apps! I recently rebuilt one of my rigs and had the intention of making it a Microsoft-free computer - hence the purchase of iWork.
    However, the last few days of 'learning curve' I have stumbled upon an increasing number of incompatibilities and limitations when compared to Excel, and the lack of the function to insert a single cell into a sheet is the final deal-breaker for me, sadly.
    So, reluctantly, I am going to install my Microsoft Office 2008 suite and get back to where I was before. I will continue to look at the iWork apps but I suspect they'll fall to the wayside.
    Once again, many thanks for confirming what I was reluctantly concluding.

  • How make "Scanner" not printing the output in a new line?

    Hi!
    I'm Jordi from Barcelona and I'm new on Java and on this Forum. I have a question to you. I'm developing a testing application that uses the "Scanner".
    Before using it, the app asks a question to the user:
    String strInput;
    Scanner sc = new Scanner(System.in);
    System.out.print("* Please, write your name: ");
    strInput = sc.next();Running this, the app asks me for the options and after pressing "Enter" prints the input string in a new line like this:
    * Please, write your name:
    Jordi
    And I would to get the next:
    * Please, write your name: Jordi
    Does anybody know how to make the "Scanner" print the output in the same line as the question?
    Thanks for your help!
    Jordi

    Running the code,
    import java.util.Scanner;
    public class Test {
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            System.out.print("* Please, write your name: ");
            System.out.println("* Hi, "+sc.next());
    }results in the following output:
    * Please, write your name: Bart
    * Hi, BartWhere the first "Bart" is the input I gave.
    If this is not the case, then it has something to do with your IDE or perhaps you didn't recompile and it previously was
    System.out.println("* Please, write your name: "); // println instead of printbut it's all guesses.
    Good luck.

  • How to avoid output file and error lines when condition does not match

    Hi Experts
    A customer want to send purchase order files to several vendors and each vendor has their own requirement to content and file format. I have prepared scenarios for each vendor and a template is (conditionally) called when CardCode matches. It works fine, - PO file is generated when CardCode matches, but error lines are written to SAP B1 Control Center each time CardCode does not match the one defined in a scenario (100 or more times per day). Problem is that these error lines does not get automatic deleted. Conditional processing are made in this way:
    Result Message in SAP B1 Control Center when CardCode does not match:
    I tried to avoid an error line in SAP B1 Control Center when CardCode does not match in this way:
    Then no error lines are written to SAP B1 Control Center, but an output file is generated each time (order file when CardCode matches and an empty file when CardCode does not match).
    Any suggestions on how to avoid both errors types (error lines in SAP B1 Control Center and empty output files)?
    Or - can lines in SAP B1 Control Center be automatic deleted?
    Regards
    Steen

    Hi Steen,
    using <b1im_skip> should be the right approach, if you're working with B1 OUTBOUND.
    Following extract form the B1i help describes the usage to skip the outbound processing:
    1.1 Skipping Outbound Processing
    If you do not want to hand over the message to the receiver system, the scenario step can create a special tag that indicates to generic processing in the integration framework to skip the message processing.
    Add the following to the final transformation atom (atom0):
    <b1im_skip xmlns= ”” info=”my info” msglog=”true” msgout="yes">
    If the integration framework skips the message, it puts the message log information to the Filtered section, if the message log is switched on. The result message contains the Message skipped by vBIU logic information.
    info
    To display an individual message, define it using the info attribute.
    msglog
    If you want to avoid an entry in the message log, introduce the msglog attribute and set it to false.
    msgout
    To display the skip information in the Success section of the message log, use the msgout attribute and set it to yes.
    In case you don't want any MsgLogEntry in case of a skipped message, please enter the following in final atom0:
    <xsl:template name="transform">
    <xsl:attribute name="pltype">xml</xsl:attribute>
    <xsl:choose>
    <xsl:when test="$msg/BOM/BO/Documents/row/CardCode=&apos;C20000&apos;">
    <xsl:call-template name="transform2"/>
    </xsl:when>
    <xsl:otherwise>
    <b1im_skip info="skipped" msglog="false"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    Best regards
    Bastian

  • How to execute some code in command line, and read its output?

    I'v found here http://www.sap-advisor.com/abap-coding/how-to-execute-operating-system-commands-from-within-sap/ that I can execute commands from the windows command line for example inside SAP.
    But I want to take it one step further and read its output. is it possible?

    Hi RagnaRock,
    one possible approach can be outputting the results of the command into a text file (i.e. "command >result.txt"), and then read this file from SAP/ABAP.
    I hope this helps. Kind regards,
    Alvaro

  • JDev 10.1.3 how to invoke oc4j_remote_deploy.jar from command line?

    Hi, does anyone know how to invoke the JDev 10.1.3 oc4j_remote_deploy.jar from the command line? We have it working for 10.1.2, for automated deployment scripts.
    If I try the same thing for 10.1.3, I get an error.
    See below my command line and the output.
    I think the error is in the Oc4jDcmServlet URL, the format seems to have changed from 10.1.2 to 10.1.3.
    I tried to reverse-engineer by using an HTTP tracer, but that did not help.
    Any help would be much appreciated.
    Regards, Maarten Brugman
    ======================== command line: ==================
    "C:\j2sdk1.4.2_09\bin\java.exe" -Djava.protocol.handler.pkgs=HTTPClient -jar C:\jdev-work\ebrp-new\ear\target\installer\oc4j_remote_deploy.jar http://lnvx0027:29805/Oc4jDcmServletAPI/ oc4jadmin ***** listApplications /oracle/oaedv03/oracle/oas/10.1.3/ontwj2e1013 UNDEFINED UNDEFINED OC4J_OEBRP
    ============ output: ====================================
    Initializing log
    Servlet interface for OC4J DCM commands
    Command timeout defined at 600 seconds
    Executing DCM command...
    Executing command listApplications /oracle/oaedv03/oracle/oas/10.1.3/ontwj2e1013
    UNDEFINED UNDEFINED OC4J_OEBRP
    Command = LISTAPPLICATIONS
    Opening connection to Oc4jDcmServlet
    Setting userName to oc4jadmin
    Sending command to DCM servlet
    **** Could not check HTTP response code
    ** Thread[main,5,main] ** Fri May 11 17:18:13 CEST 2007 ** ** EXCEPTION: java.
    net.SocketException: Unexpected end of file from server
    java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:822)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:711)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:820)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:711)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:635)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:272
    at oracle.j2ee.tools.remote_deploy.Oc4jDcmClient.isHttpResponseOk(Unknow
    n Source)
    at oracle.j2ee.tools.remote_deploy.Oc4jDcmClient.sendCommand(Unknown Sou
    rce)
    at oracle.j2ee.tools.remote_deploy.Oc4jDcmCommand.execute(Unknown Source
    at oracle.j2ee.tools.remote_deploy.Oc4jDcmCommand.listApplications(Unkno
    wn Source)
    at oracle.j2ee.tools.remote_deploy.Oc4jDcmMain.main(Oc4jDcmMain.java:71)
    #### HTTP response is NOT ok
    Closing connection to Oc4jDcmServlet
    #### DCM command did not complete successfully (-1)
    #### HTTP return code was -1
    ============ end output =================================

    In my opinion, you will succeed in handling linefeeds in output texts by using an <tt><af:outputFormatted></tt> tag in conjuction with a JSF converter that replaces the linefeeds with a <tt>&lt;br></tt> tag in the text. You will have to implement a custom converter class (this is quite simple, see below) and to set it to the <tt>converter</tt> attribute of the <tt><af:outputFormatted></tt>. The converter class should look like:
    public class MyLinefeedConverter implements javax.faces.convert.Converter
      public MyLinefeedConverter() {
      public Object getAsObject(FacesContext context, UIComponent component, String value) {
        return value;
      public String getAsString(FacesContext context, UIComponent component, Object value) {
        if (value==null) return "";
        if (value instanceof String) return ((String)value).replace("\n", "<br>");
        return value.toString();
    }In this way the linefeeds in your text values will be replaced by <tt>&lt;br></tt>, which will be rendered by the corresponding <af:outputFormatted> tag as line breaks.

  • Can I color a line of "standard text" in adobe forms output?

    Simple question: Can I color a line of "standard text" in adobe forms output?
    My standard text (SO10) has multiple lines. 
    Can I make one of the lines red?
    Ollie

    Hi Oliver,
    I believe you standard text is a table type of TDLINES.
    On the form you would display it with a table of 1 column 1 row with repeat row ticked.
    Have the like below code on the fomr ready event of your table.
    for(var i =0; i<this.Row1.nodes.length;i++)
         if(i == 1){
         this.Row1.Cell1.font.fill.color.value = "255,0,0";
         this.Row1.xx.font.fill.color.value = "255,0,0";
    Note: in my example I had a table with one row names Row1 and 2 fields cell1 type textbox,  & xx as text / label.
    If its like you have it in a text box with multiple entries, we need to spli the value such that 1st row is displayed in a text box whose parameters are by defeult set to font red, and rest of them to this text area.
    If your procedure is table the code sud work, else let me know how you get data and how do you display it on the screen.
    Cheers,
    Sai

  • Combining all line items in one output of material Document...

    HI All,
    We have created one new output type for the material document.
    If we have multiple line items in the material document, the output must be assigned once in the document. But In our case it is assigning for each of the line item. Can any one help how to handle this issue.
    Regards
    Sukant
    Edited by: sukanta patro Chinari on Jan 7, 2010 2:33 AM

    Hi,
    The issue solved. Needed to add some codes in the routine to restrict multiple assignments. For reference take the help of Routine number 173.
    Regards
    Sukant

  • How to configure Team explorer 2010 command-line tool in Mac x os. configure shell or system path to include the folder to which (TF client) unzipped archive available.

    How to configure Team explorer 2010 command-line tool in Mac x os.
    Hot to configure shell or system path to include the folder to which (TF client) unzipped archive available. I am new to Mac X OS. Please help.

    Dmitry,
    Thanks for the great writeup!
    I think I've got my universal instant client libraries built correctly.
    I too am using MacBook Pro but I'm getting stuck at building the 32 bit oci8.so
    First problem is my pecl download (ver 1.4.1) did not contain a "configure" file so ./configure failed.
    I used configure from /sw/....... to try to continue.
    Second problem. Using existing configure from /sw/.... I used an appropriate variation of your example command
    (./configure --with-oci8=instantclient,/usr/local/oracle/instantclient_10_2 && make).
    Things look like everything ran OK but The output does NOT include an oci8.so file
    So I guess my question is: Which "configure" should I be using? And if it is not the one on the system under /sw/...
    where would I get it since it doesn't come in the pecl download?

  • How to measure frequency when no static line

    Hi. I think to directly measure frequency using DAXmx function my input signal should be connceted to DAQ PFI Lines but in my application the clock frequency is outputted on P0.0 line . Is there any way to directky measure frequency uding DAQmx function or I should do it manually?
    Thanks

    Hi tintin,
    you really should have learned to post good ( read as: meaningful, with sufficient explanations and background information) questions after more than 200 posts in this forum…
    What frequency do you want to measure?
    What is the relation to outputting your own "clock frequency" on some DO pin?
    Which hardware do you use?
    Why do you need to measure a signal frequency when you know that frequency as you output that signal?
    How do you measure frequencies "manually"?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

Maybe you are looking for

  • How make display only the amount field in table control(infotype 0008)

    Dear Freinds, have to make display only the amount field (Q0008-bet01) on table control in infotype 0008 , could you tell me how to make it display only. i have tried the below coding it is not working in PBO & PAI of the user exit ZXPADU01 and ZXPAD

  • I need soem assistance with adobe captivate

    I currently tried to bring in a powerpoint slide and transfer into captivate 3. but my graphics did not transfer in correctly. the 3D eddect did not transfer into captivate - I NEED HELP!!

  • Preview folder content

    I use Bridge CS5 for more intenssive organizing/RAW photo management fairly often. Like most people I assume I have the content tab open as well as the preview tab. When I click on an image it shows up in the preview nicely. I'm wondering why when cl

  • Cant burn audio cd

    When I populate the burn screen in windows media player and click burn CD button it quickly ejects my blank CD  from the drive. I have burned Cd,s in the past but havent had this problem. Could it be the format is wrong ? I'm using the wave format.

  • Why isn't my phone number an option for imessage?

    I just switched providers with my phone and for some reason, imessage stopped working for me, so I reactivated it and I can't see my phone # as an option, just my email. I tried every single thing possible, nothing worked.