Export-csv only generating the output only for single server

Hi Team,
From the below script I'm unable to generate the single output file for all the condition. The script only giving the last server output, It's skipping the all the other servers in the file.
$ScriptBlock = {
    param
        $Server,
        $ExportCSV
$Counters= import-csv "G:\testcounter.csv"
foreach($Counter in $Counters)
$ObjectName=$Counter.ObjectName
$CounterName=$Counter.CounterName
$InstanceName=$Counter.InstanceName
$Result=Get-Counter -Counter "\\$server\$ObjectName($InstanceName)\$CounterName"
    $CounterSamples = $Result | % {$_.CounterSamples}
    $MasterArray = @()
    foreach ($CounterSample in $CounterSamples)
        $TempArray = @()
        $TempArray = "" | Select Server, ObjectName, CounterName, InstanceName, SampleValue, DateTime
        $Split = $CounterSample.Path.Remove(0,2)
        $Split = $Split.Split("\")
        $TempArray.Server = $Split[0]
        $TempArray.ObjectName = $Split[1].Split("(")[0]
        $TempArray.CounterName = $Split[2]
        $TempArray.InstanceName = $CounterSample.InstanceName
        $TempArray.SampleValue = $CounterSample.CookedValue
        $TempArray.DateTime = $CounterSample.TimeStamp.ToString("yyyy-MM-dd HH:mm:ss")
        $MasterArray += $TempArray
    $MasterArray | Export-Csv $ExportCSV -NoType
$Servers = import-csv "G:\testcounter.csv"
foreach ($Server in $Servers)
    $server=$server.server
    If (Test-Connection -quiet -computer $server){
        $ExportCSV = "G:\PerformaneData.csv"
        Start-Job -ScriptBlock $ScriptBlock -ArgumentList @($server, $ExportCSV)

Hi RatheeshAV,
In addition, to export the result to csv file, please also try to wait for all the jobs to complete then retrieve all the data and write it to a file in one step:
$ScriptBlock = {
param ($Server)
#SCRIPT
$MasterArray }
$Servers = import-csv "G:\testcounter.csv"
Get-Job | Remove-Job
$jobs=@()
foreach ($Server in $Servers){
$server=$server.server
If(Test-Connection -quiet -computer $server){
Write-Host $Server -ForegroundColor green
$ExportCSV = "G:\PerformaneData.csv"
$job+=Start-Job -ScriptBlock $ScriptBlock -ArgumentList $server
$jobs | Wait-Job
$jobs | Receive-job | Export-CSV 'd:\temp.csv' -NoTypeInformation
Refer to:
PS3 Export-CSV -Append from
multiple instances to the same csv file
If there is anything else regarding this issue, please feel free to post back.
Best Regards,
Anna Wang

Similar Messages

  • Unable to generate the output for S_ALR_87012048

    Dear All,
    We are trying to execute the report  S_ALR_87012048 for the first period in 2015.  We have tried execute this report with report date 25.01.2015 (which is the last day in period 01), but it is giving no data was selected.
    Can anybody suggest whether I need to give any further inputs to generate the output apart from the below.
    Co.code : 9000
    Reporting date : 25.01.2015 (which is the last day in our fiscal period 01 /2015)
    Dep area : 01
    Sort Variant : 03 (co.code / bs  accounts / asset class)
    User able to execute this report in the last month successfully.
    We have completed all year ending process as well.
    I have tried execute this report in our quality system with reporting date as 31.12.2014 and 31.12.2015.
    Do we need to give reporting date as year ending date ? or last date of current period.
    Thanks in Advance.
    Prasad

    Hi Prasad,
    I do believe that you should consider the authorization side of the matter carefully as pointed out by Mahmoud on Feb 6th. Please check again the mentioned SAP Notes in that thread.
    For example, I just tested in my system, I can trigger a report even in a closed fiscal year with a report date end of each period. The only difference is that I get a information message:
    Report date is in a closed fiscal year
    Message no. AU172
    Diagnosis
    The report date is in the past.
    Here the report date is allowed to be the end of the year as well as any
    period end during the fiscal year.
    System Response
    In an asset report during the fiscal year (report date for a period end
    within the year) in a closed fiscal year, it can be the case that the results
    for depreciation or the net book value are different between the historical
    calculation and the current calculation for the report date. The reason for this
    are any changes to asset-related depreciation terms, such as the depreciation
    key, useful life, and so on. In the case of such changes, the asset values are
    recalculated with the currently entered depreciation terms.
    In an open fiscal year and a report date end of period I do not get AU172 and get an output.
    Beside above provided SAP Notes, also see another couple of SAP Notes with some interesting information are also:
    1566099  Reporting in Asset Accounting
    1491612  Authorization concept in FI-AA
    1394450  Reporting: Authorization check for report assignment
    929732    Authorization checks: Correction Note 856248
    856248   Authorization checks in asset reporting
    Regards,
    Brigitte

  • In OBIEE mobile apps designer there is no option for multi select prompts?The navigation page gives option only for single select?Is there a work around for this?

    In OBIEE mobile apps designer there is no option for multi select prompts?The navigation page gives option only for single select?Is there a work around for this?

    Nic, for me the iTunes window looks like this, when I connect my iPad 3:
    I select the iPad in the "devices" section of the Sidebar (use: "View > Show Sidebar" if the sidebar is hidden).
    Click the "Apps" tab in the "Devices" pane.
    Scroll all the way down in the Devices pane to "File Sharing" "Apps" section.
    Then do I click "GarageBand" to select the documents in the right panel.
    Which part is different for you? Perhaps you could post a screenshot?
    Regards
    Léonie

  • How to generate the output of a BSP application in PDF format?

    Hi,
    I need to modify one BSP application, which generates its output in the form of PDF. I have checked all the methods in the bsp pages and its corresponding controller class's. I couldn't find any relevant method, which deals with generating the output in PDF.
    Could you please share your valuable thoughts on this?
    Again it would be helpful, If anyone of you share some knowledge on Interactive Adobe Forms.
    Thanks,
    John

    >
    I am using oracle version 11.2.0.1, I have set a cronjob which will run on every 15 minutes and give us a log file mentioning the execution time taken for that SQL query:-
    The above query will return the output as well as the time taken for execution of the query. I want to suppress the output of the query and only want the time taken to be printed. Is it possible by set commands. I have marked the output as bold and made it Italic.
    >
    How would that even be useful?
    A query from a tool such as sql*plus is STILL going to send the output to the client and the client. You can keep sql*plus from actually displaying the data by setting autotrace to trace only.
    But that TIME TAKEN is still going to include the network time it takes to send ALL rows that the query returns across the network.
    That time is NOT the same as the actual execution time of the query. So unless you are trying to determine how long it takes to send the data over the network your 'timing' method is rather flawed.
    Why don't you tell us WHAT PROBLEM you are trying to solve so we can help you solve it?

  • Can we generate the output of SQL Query in XML format ..

    Hi Team,
    Can we generate an XML doc for an SQL Query.
    I've seen in SQL Server 2000.It is generating the output of an SQL Query in xml format.
    select * from emp for xml auto
    The output looks like
    <emp EMPNO="7369" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17T00:00:00" SAL="2800" DEPTNO="20"/><emp EMPNO="7370" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17T00:00:00" SAL="2800" DEPTNO="10"/>

    Just a little bit of short hand.
    Get the XML out of your database, via HTTP
    Of course the easiest method is just to return an XMLType from a stored procedure and let the calling routine figure out what to do with it. Instead
    of that way though, I'll show you how to do it via HTTP. It's all completely built into 10g and is super easy to use.
    CREATE OR REPLACE VIEW emps_and_depts AS
    SELECT e.employee_id AS "EmployeeId",
    e.last_name AS "Name",
    e.job_id AS "Job",
    e.manager_id AS "Manager",
    e.hire_date AS "HireDate",
    e.salary AS "Salary",
    e.commission_pct AS "Commission",
    XMLFOREST (
    d.department_id AS "DeptNo",
    d.department_name AS "DeptName",
    d.location_id AS "Location"
    ) AS "Dept"
    FROM employees e, departments d
    WHERE e.department_id = d.department_id
    Some people hear web and immediately start salivating about security issues. Let me address that quickly. Just because you have the HTTP and/or
    FTP servers running in the database, that does not mean you have a security problem. For one, I would hope your databases are behind a firewall.
    Second, with the correct architecture (DMZ, app servers, etc) you can make this data available outside the firewall fairly transparently and third,
    just because it's on the web does not mean the data MUST be available on the internet. This is a good way to make your data available on your
    intranet. If you are worried about people INSIDE your firewall, that still doesn't preclude web based access. Follow Oracle security guidelines.
    Before I show you how to get to your data, let's talk about URLs and URIs. A URL is a Uniform Resource Locater and URI is a Uniform Resource
    Identifier. A URL is the way you would identify a document on the net, i.e. http://www.oracle.com is a URL. A URI is a more generic form of a URL.
    Oracle supports three types of URI: HTTPURIType - basically a URL (which would be like the URL above), XDURIType - a pointer to an XDB resource
    (usually an XML document but can be other objects), and DBURIType - a pointer to database objects.
    It's the DBURIType that we're going to concentrate on here. The DBURIType let's us reference database objects using a file/folder paradigm. The
    format for a DBURI is /oradb/<schema>/<table>. Oradb is shorthand for the database; it is not the database name or SID. My database is named XE
    but I still use oradb in the DBURI. For example, the view we created above is in my XE database, is owned by HR (at least in my case) and is called
    EMPS_AND_DEPTS. This can be referenced as /oradb/HR/EMPS_AND_DEPTS.
    If the view had many rows and you wanted only one of them, you can restrict it by including a predicate. The documentation for XDB has a great
    write up on Using DBURIs.In our case, we are going to write out the entire document. Now that you understand that the DBURI is a pointer to
    objects in our instance, we can use that to access the data as a URL.
    The format for the URL call is http://<machinename>:<port>/<DBURI>
    In my case, my XE database is running on a machine called mach1 and is listening on port 8080. So to see the view we created above, I open my
    browser and navigate to: http//mach1:8080/oradb/HR/EMPS_AND_DEPTS
    The created URL will be as http//mach1:8080/oradb/PUBLIC/EMPS_AND_DEPTS
    If your database is set up correctly and listening on port 8080 (the default), your browser should ask you to login. Login as the user who created the
    view (in my case HR). You should now get an XML document displayed in your browser.
    And that's it. It doesn't get much simpler than that. If you get rid of the descriptive text above, it basically comes down to:
    Create a table or view
    Open your web browser
    Enter a URL
    Enter a user ID and password
    View your XML
    If you notice, Oracle formatted the data as XML for us. Our view returns scalar columns and an XML fragment called Dept. Oracle formatted the
    return results into an XML format.
    And as a side note, if you look closely, you'll see that my URL has PUBLIC where I said to put HR. PUBLIC is a synonym for all objects that your
    logged in user can see. That way, if your user has been granted select access on many schemas, you can use PUBLIC and see any of them.

  • How to generate the batch number for group of records

    Hi All,
    requirement: i have created one sequence to generate the batch numbers.i have to get the nextval of the sequence for batch number (this column is not part of the table. its dynamic column/alias column) only for every 50000 records of a table.
    detail description:
    for example, if i have 10 records in a table. And, if i want to generate the batch number for every 2 records, then the output should look like belo.
    batch-number qty
    1 10
    1 20
    2 30
    2 40
    3 50
    3 60
    4 70
    4 80
    5 90
    5 100
    Please help me on this. Please let me know if you need more info.

    one more update on the above request. this has to be done using SQL query only.

  • Cannot change the output medium for contract

    Hi Everyone,
    In the contract we have "Output" tab to change the output medium for the contract.
    So the issue is when I click on the change button and try to change e-mail address,I am not able to do that.
    The e-mail address is grayed out though I am in the change mode.
    This is happening for some contracts only.
    How should I change the e-mail address of the contract?
    Thanks & Regards,
    Khushbu.
    Edited by: Khushbu Brahmbhatt on Feb 25, 2011 9:01 PM

    Hi,
    Have a look at the foll thread for more pointers;
    Re: Change medium of output for Changed PO in SRM
    BR,
    Disha.
    Do reward points for useful answers.

  • Is xmlgen.insertxml used only for single table

    Is xmlgen.insertxml used only for single table or can be used to insert the xmldata into xle tables
    Thanks,
    Sudheer

    Hi Sudeesh,
    I am fetching data for PO details, GR details along with condition types of PO.
    All data is collected in ALV OUTPUT itab, after this I am trying to assign the values of VAT from another itab in ALV OUTPUT LOOP using READ TABLE with reference to PO-PO_ITEM-CONDITION_TYPE.
    Now, when the alv loop is getting executed and in that I am fetching data for VAT using READ statement, the program is assigning VAT to all records of output alv with comparison of PO-PO_ITEM-CONDITION_TYPE.
    see:
    LOOP AT it_alv ASSIGNING <fs-alv>.
         READ TABLE it_vat ASSIGNING <fs-vat>
              WITH KEY ebeln = <fs-alv>-ebeln
                               posnr = <fs-alv>-posnr
                                kschl = 'JVCS'.
         IF sy-subrc = 0.
              <fs-alv>-vat = <fs-vat>-kbetr / 10.
      <fs-alv>-vat_val = <<fs-alv>-vat * it_alv-menge.
         END IF.
    END LOOP.
    Please refer above.
    Thanks.
    Ritesh

  • How to generate the output of BSP application in PDF format?

    Hi,
    I need to modify one BSP application, which generates its output in the form of PDF. I have checked all the methods in the bsp pages and its corresponding controller class's. I couldn't find any relevant method, which deals with generating the output in PDF.
    Could you please share your valuable thoughts on this?
    Again it would be helpful, If anyone of you share some knowledge on Interactive Adobe Forms.
    Thanks,
    John

    okay, awesome
    i'd use DOM or some high level API for this (don't write it by hand using plain File IO)
    okay, try this site, it goes through building a document, adding elements, writing to file, etc.
    http://www.roseindia.net/xml/dom/

  • How to generate the deferent pdfs for deferent vendor ?

    Hi,
    i have requirement to generate the each pdf for each vendor and i need to mail those pdfs to respective vendor,
    here i am facing the prob to generate the no of pdfs for deferent vendors...please can any one help me in this how i generate the no of pdfs ?? using wrapeer program ....
    if possible any one can provide some example code..(Exmplae program)
    Thanks,
    PK..

    There are two function use one for convert PDF and second use to email, hope it will give u idea proper.
    Assigning the OTFDATA to OTF Structure table
      CLEAR gt_otf.
      gt_otf[] = gs_otfdata-otfdata[].
    Convert the OTF DATA to SAP Script Text lines
      CLEAR gt_pdf_tab.
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
          max_linewidth         = 132
        IMPORTING
          bin_filesize          = gv_bin_filesize
        TABLES
          otf                   = gt_otf
          lines                 = gt_pdf_tab
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          OTHERS                = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = gs_docdata
            put_in_outbox              = 'X'
            commit_work                = 'X'
          TABLES
            packing_list               = gt_objpack
            contents_bin               = gt_objbin
            receivers                  = gt_reclist
          contents_txt               = i_objtxt
            object_header              = objhead
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            document_type_not_exist    = 3
            operation_no_authorization = 4
            parameter_error            = 5
            x_error                    = 6
            enqueue_error              = 7
            OTHERS                     = 8.

  • Error generating the output preview

    Hi friends!
    Could you help me u2013 when I run Output Preview in bit invitation process Iu2019ve got a system error u201CError generating the output previewu201D. 
    What could be a reason?

    Note 1172470 - BBP_BID: Error generating the output preview
    Note Language: English Version: 3 Validity: Valid from 26.05.2008
    Summary
    Symptom
    From transaction "Process bid"(BBP_QUOT) when you click on print preview,
    you get the error "Error generating the output preview". Due to this error
    the preview is not displayed.
    More Terms
    BBP_BID 210, output preview, print preview, preview, bid, quotation, quot,
    BBP_QUOT, BBP_OUTPUT, SAPLBBP_OUTPUT, pdf, BBP_OUTPUT_QUOT_PREVIEW_SMART,
    SYSTEM_INSTALLED_LANGUAGES.
    Cause and Prerequisites
    This is caused by a program error.
    Solution
    Implement the attached corrections or import the corresponding support
    package
    Header Data
    Release Status: Released for Customer
    Released on: 26.05.2008 11:14:52
    Priority: Correction with medium priority
    Category: Program error
    Main Component SRM-EBP-CA-PRT Document Output / Forms
    Additional Components:
    SRM-EBP-QUO Quotation, Bid
    Valid Releases
    Software Component Release From
    Release
    To Release and Following
    SRM_SERVER 550 550 550
    Support Packages
    Support Packages Release Package Name
    SRM_SERVER 550 SAPKIBKT13
    SRM_SERVER 600 SAPKIBKU05
    Please raise customer message

  • How to use the Output clause for the updated statment

    How to use the output clause for the below update stament,
    DECLARE @MyTableVar table(
        sname int NOT NULL)
    update A set stat ='USED' 
    from (select top 1 * from #A 
    where stat='AVAILABLE' order by sno)A
    Output inserted.sname
    INTO @MyTableVar;
    SELECT sname
    FROM @MyTableVar;
    Here am getting one error incorrect syntax near Output
    i want to return the updated value from output clause

    see
    http://blogs.msdn.com/b/sqltips/archive/2005/06/13/output-clause.aspx
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Is there a way to change the output type for Email Remittance Program?

    Hello,
    We are trying to implement Separate Remittance Program.The seeded output type is PDF( I have checked the output type for send separate remittance concurrent program) however the
    email which we receive looks like a regular email I mean with a normal text .  Is there a way to get the output in different type like excel,attachment,pdf.
    Any inputs would be highly appreciated.
    Thanks,
    Sushma

    Currently there is a bug raised
    Bug 8208646 : R12 UNABLE TO SEND SEPARATE REMITTANCE ADVICE AS EMAIL ATTACHMENT IN PDF.
    If you want to customize this process you need to create data definition,new rtf template and bursting program to send pdf as attachment.

  • Sun ONE Studio 4 aka Forte: How to set the output path for classes ?

    Help !
    Beginner's question:
    Sun ONE Studio 4 aka Forte:
    How to set the output path for classes ?
    As default, the class files are created in the same directory as the
    sources.
    In opposite, both JBuilder and Together support that there is a tree
    with the sources and another tree with the classes.
    The first answer I got was "not possible with Forte, but just if you write your own "ANT Build script" !
    a) Please point me to a ready-to-use ANT script for this purpose, if such is available
    b) Is using ANT instead of the MAKE as comfortable ? Besides the separation of sourcecode and classes, I would like to keep everything else to be the same, i.e. I don�t want to edit the ANT file if I enlarge the project by directories or files.
    Tia
    Sincerely
    Rolf

    You can set S1S's options to place newly created .class files in a specific location.
    Identify the compiler that is being used - Open the S1S's Tools/Options window, expand Editing and select Java Sources. Note the Default Compiler value. (If it's one if the Ant options, you use Ant to specify this option, not S1S.)
    Open the S1S's Tools/Options window, expand Building/Compiler Types and select the appropriate compiler.
    The Properties tab of the compiler has the property Target, which sets the filesystem where the compiler output is directed. If you choose <not set>, the .class files are written to their source directory.
    When you set the Target, your change affects all classes that use this compiler.
    Very few options can't be set in S1S; the challenge is finding out where they're set!

  • The output file  for your concurrent request is not initialized

    Application: Application Object Library(FND)
    Component Type: SERVICE_INSTANCE
    Component Name: Standard Manager(STANDARD)
    /*The output file for your concurrent request is not initialized.
    Cause: Your concurrent program execution was not preceded by calls to standard
    Application Object Library routines to initialize concurrent processing. FDPFOP
    received a return code of failure.
    Action: Change your concurrent program to initialize files by calling standard
    Application Object Library routines. */
    I got the mail with the above message from System ( Oracle Applicaitons Release 12.1.1)
    I have checked the following metalink document
    The Output File For Your Concurrent Request is Not Initialized: FDPFOP received a return code of failure [ID 296830.1]
    I can not undestand, why the alert sends mail?
    Could you please let me know..what happened to standard manager? how to resolve the above issue? why the above alert happened?
    The above meatlink note did not help much....

    Hi;
    >
    /*The output file for your concurrent request is not initialized.
    Cause: Your concurrent program execution was not preceded by calls to standard
    Application Object Library routines to initialize concurrent processing. FDPFOP
    received a return code of failure.
    Action: Change your concurrent program to initialize files by calling standard
    Application Object Library routines. */
    The Output File For Your Concurrent Request is Not Initialized: FDPFOP received a return code of failure [ID 296830.1]
    I can not undestand, why the alert sends mail? Could you please let me know..what happened to standard manager? how to resolve the above issue? why the above alert happened?I checked related note and it mention its internal bug which mean we cant say too many thing about issue.
    The above meatlink note did not help much....It helped or not? Issue still appear or not?
    Please run adadmin utulity >> from Maintain Applications Files>> Relink Applications programs
    Be sure it wont through any error message than retest issue
    Regard
    Helios

Maybe you are looking for

  • System Image Restore in Window 8.1

    I have not been able to find a data migration application that works at cloning a Windows 8.1 hard drive to a new SSD.  With that in mind I want to go about moving the contents, data and operating system from my working C: to a new SSD.  I want to go

  • Video missing from recording

    Hello, one of our clients has a hosted recording with video that has been working fine until recently.  When playing back the recording, the video is now missing and just shows a black screen where the video footage should be. We have tried on both W

  • Passing Paramter Values to a Discoverer Worksheet

    Hi. I've set up a link from a measure in my OLAP workbook. It attempts to pass values from the OLAP workbook to parameters in the Discoverer workbook. This seems to work fine if I pass the dimension label (i.e. the descriptive name of the member). If

  • Automatically removing header segments from the existing LVM file

    Hello, I have a LVM file containing sampled data of two channels (sampled at a the same rate of 100Hz) without x values(time) with many header segments.I wonder is it possible 1) to change automatically (not manually because it contians so many heade

  • Errors setting up database mirroring

    The server network address TCP://jhjkasdgjkadg.asdg.sdg.sdfg.:5022 can not be reached or does not exist.  I have SQL 2008 R2 mirroring with another SQL 2008 R2 using a sql 2005 as the witness.  Trying to get HA mirroring.  The IP is there and reachab