Send the results of a report PowerCLI

I would like to take this simple report and send it in two parts attached - one in html format and another to the .csv format using an SMTP server.  What is the correct format to do this?

Get - vm | Select the name numcpu vmhost, memorygb, record, comments

Thank you!

Try something like this

$report = Get-VM | select name, numcpu, vmhost, memorygb, folder, guest

$reportHtml = $report | ConvertTo-Html | Out-String$report | Export-Csv report.csv -NoTypeInformation -UseCulture

Send-MailMessage -To [email protected] -Subject Report `  -SmtpServer mail.lucd.info -From [email protected] `  -BodyAsHtml -Body $reportHtml -Attachments report.csv 

Tags: VMware

Similar Questions

  • The course does not send the results of the tests and reports system (Saba) after trial. The course remained "incomplete". What can you recommend?

    The course does not send the results of the tests and reports system (Saba) after trial. The course remained "incomplete". What can you recommend?

    Ok.  So you're screenshot compared to SCORM clouds now shows you're scoring 100% in the quiz, but your state of completion will still come out incomplete.  Then of course, your quiz notification settings not award success based on passing the test.

    Try to set your quiz the way I show this screenshot using SCORM 1.2 instead of 2004.

  • How to send the result of a function as an input to another function

    Hello

    I wrote a function wich return string. I want to send string returned as an input to another function. How can I integrate these two functions.

    Thank you...

    I want to send the result of the first function as input for another function

    It's what do all these examples.

    Do not get hung up on BOM - function1 and function2 - the one call it first (with or without argument) returns a value that is passed in a second and even, in my example, the output of the last second in a third (dbms_output).

    select function72727347(function9596943 (argument)) from dual
    

    Published by: Dom Brooks on February 18, 2011 12:08

  • In SQL Developer, is it possible to send the results of a sql statement?

    In SQL Developer, is it possible to send the results of a sql statement?

    Right-click on the query results pane, select "Export data" in the context menu, then select "xls".

  • Send the results of the script by email

    OK, time to reach out for a little help;

    I'm looking to receive a daily report or weekly at the time stated on all of my guests. I restored code (below), but at this point, I get an empty email for each host. The script runs and displays in the ok command window, but I want to receive an email, with the result declared all hosts. When executing this now, the command window reports 'Time on $host1 in the allowed range' if it is understood naturally, or offer lag.

    I have serached and tried various methods of the call to this function to send mail, but can someone take a look and recommend a better way?

    script:

    > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

    $allowedDifferenceSeconds = 20

    Notice-EEG - ViewType HostSystem-Property Name, ConfigManager.DateTimeSystem. %{
    datetime #get host system
    $dts = get-view $_. ConfigManager.DateTimeSystem

    time to host #get
    $t = $dts. QueryDateTime()

    #calculate time difference in seconds
    $s = ($t - [DateTime]: UtcNow). TotalSeconds

    #check so lag is too much
    {if ([Math]: ABS ($s) - gt $allowedDifferenceSeconds)}
    #print host difference and the time in seconds
    $row = "" | Select the host name, seconds
    $row. Hostname = $_. Name
    $row. Seconds = $s
    $row
    }
    else {}
    Write-Host "time on" $_. Name "to the bosom of the beach permit"

    $smtpSrv = "SMTP.domaine.com".
    $from = "[email protected]".
    $to = "[email protected]".
    $subject = "VM host time report.


    $msg = new-object Net.Mail.MailMessage ($from, $to, $subject, $body)

    $smtp = new-object Net.Mail.SMTPclient ($smtpSrv)

    $smtp.send ($msg)

    }

    > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

    Try something like this

    $allowedDifferenceSeconds = 20 $body = $null 
    
    get-view -ViewType HostSystem -Property Name, ConfigManager.DateTimeSystem  | %{
        #get host datetime system    $dts = get-view $_.ConfigManager.DateTimeSystem
    
        #get host time    $t = $dts.QueryDateTime()
    
        #calculate time difference in seconds    $s = ( $t - [DateTime]::UtcNow).TotalSeconds
    
        #check if time difference is too much    if([math]::abs($s) -gt $allowedDifferenceSeconds){
            #print host and time difference in seconds        $body += ("On " + $_.Name + " the time difference is "  + $s + " seconds`r" | Out-String)
        }
        else{
            $body +=  ("Time on " + $_.Name + " within allowed range`r" | Out-String)
        }
    }
    
    $smtpSrv = "smtp.domain.com"$from = "[email protected]"$to = "[email protected]"$subject = "VM Host Time Report"
    $msg = new-object Net.Mail.MailMessage($from,$to,$subject,$body)
    
    $smtp = new-object Net.Mail.SMTPclient($smtpSrv)
    
    $smtp.send($msg)
    
  • Send the results by email

    My colleague wants to know if there is a way to implement email report function Captivate quizzes so that e-mail will also indicate which course reports on e-mail. We use Captivate 3. In his own words:
    - - - - -
    I have five modules of separate courses that make up a class together. Each module contains a quiz. I use the feature to e-mail results so that the results are sent by e-mail to a person for the purpose of follow-up.

    Unfortunately, the results of email are generic and do not reference the names of five of the course modules. So the person who receives the e-mail will get five emails (one for each module) with "results: Date" in the line object and status, location, notes gross, Max, Min Score Score and time in the body.

    How can it be put in place so that the person who receives the results of email can easily know which module each e-mail is for?

    Here is an example of what gets the person email and he or she will not be able to tell where modules each e-mail is for.

    Topic: Results: 02/09/2009

    Results =
    Basic data
    'Status', 'Place', 'Raw score', 'Score Max', 'Score Min', 'time '.
    'impossible', '18' '20', "100', '0',"00:01:03 "

    - - - - -

    Thank you!

    Janatwork,

    Yes, it is possible. If you edit the HTM with Captivate, you can
    include the document.title or hardcode the course for electronic mail.

    For example, if you change the model for email for Captivate 3 HTM
    (there's usually: C:\Program Files\Adobe\Adobe Captivate)
    3\Templates\Publish\email_body.htm)

    You can change the "padMail" method such as:

    gstrEmailSubject = document.title + '-' + strSubject;

    I just published an article that * may * help to provide a better
    mechanism for sending e-mail messages via a script on the server side (if it of)
    your needs prise_en_charge / environments). It is published:
    http://www.ConnectUsers.com/tutorials/2009/02/proprietary_tracking/index.php.

    Who help me?

    Kind regards

    Andrew

  • Include the results in "Batch report" instead of "report USE".

    Hi all

    I modified the ProcessSetup TS 4.0 reminder to perform a test of the preliminary material before testing 8 DUT using batch processing model. Since this is a reminder, the results are not registered by default, so I store it in a global table of results. Then I copy this table of results into my results MainSequence table.

    The problem is that this means that these preliminary results will be saved for UUT0 (if I use "A thread only" synchronization") or to the DUT (if I use the synchronization of batch processing model). How can I add my ProcessSetup test results to the "Results of the batch" section of the results page rather than the sections "USE results? The test checks the shared material and is thus applied to the DUT. I prefer not repeated it for each USE or make it look like, it applies only to WEAR it first.

    Thank you

    Chris

    Tomahawk,

    Al is correct that is whether you use HTML or ASCII report formats, you can override the ModifyReport... Reminders to get what you want. Unfortunately, with the XML declaration, you can use the ModifyReport... Reminders. In order to accomplish the functionality that you want to see everything and still use the report XML form, you will need to change the BatchReport reminder, as well as the XML style sheet you use.

    TestStand 4.2, we have created tutorials and provided better material for our XML Style sheets. With a little effort, I am convinced that with TestStand 4.2, you would be able to reach your goal.

    I suggest to take a look at customization of Style TestStand sheets of TestStand 4.2 help (available online). Unfortunately, Style XML TestStand 4.0 sheets do not have the same quality of literature as the TestStand 4.2 Style sheets, so you don't will not commented sections in the leaves of Style 4.0 as explained in the help.

    For this particular case, you do not want to change the reminder of BatchReport to store the data that you want to place in your report batch section. Then, you change the section batch report of the Style XML with XPath map appropriate to display these data in the batch report.

  • Failed to get the results of a report from beep with a SQL with like ' %: Parameter.

    Hello

    I am trying to create a beep with sql like query report below:

    Example:

    Select usr_key from usr where usr_login like ' %: Parameter.

    In above query parameter before the user.

    The above query returns not all the results in the report.

    If I hard top query below it returns the result-code:

    Select usr_key from usr where usr_login like '% Test % '.

    Please let me how can know we use % with a parameter in the NOSE?

    Thank you

    Hi I had the solution how to do this at RANDOM.

    CONCAT function should be used for the same

  • The Millionaire (CP9) game can send the results of SCORM 2004?

    This is the game of interaction. Can you follow the score and the results of each question?

    No, sorry. Although some training interactions have a variable associated with the score that can be attached to a game interaction is acquired when the game is played. That's all. More information in my blog:

    Advice - Training interaction - Captivate blog

  • Need help to send the result of the query via utl_stmp

    11.2.0.3
    got the code of http://www.oracle-base.com/articles/misc/email-from-oracle-plsql.php#multiline send e-mail
    CREATE OR REPLACE PROCEDURE send_mail (p_to        IN VARCHAR2,
                                           p_from      IN VARCHAR2,
                                           p_subject   IN VARCHAR2,
                                           p_message   IN VARCHAR2,
                                           p_smtp_host IN VARCHAR2,
                                           p_smtp_port IN NUMBER DEFAULT 25)
    AS
      l_mail_conn   UTL_SMTP.connection;
    BEGIN
      l_mail_conn := UTL_SMTP.open_connection(p_smtp_host, p_smtp_port);
      UTL_SMTP.helo(l_mail_conn, p_smtp_host);
      UTL_SMTP.mail(l_mail_conn, p_from);
      UTL_SMTP.rcpt(l_mail_conn, p_to);
    
      UTL_SMTP.open_data(l_mail_conn);
      
      UTL_SMTP.write_data(l_mail_conn, 'Date: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') || UTL_TCP.crlf);
      UTL_SMTP.write_data(l_mail_conn, 'To: ' || p_to || UTL_TCP.crlf);
      UTL_SMTP.write_data(l_mail_conn, 'From: ' || p_from || UTL_TCP.crlf);
      UTL_SMTP.write_data(l_mail_conn, 'Subject: ' || p_subject || UTL_TCP.crlf);
      UTL_SMTP.write_data(l_mail_conn, 'Reply-To: ' || p_from || UTL_TCP.crlf || UTL_TCP.crlf);
      
      UTL_SMTP.write_data(l_mail_conn, p_message || UTL_TCP.crlf || UTL_TCP.crlf);
      UTL_SMTP.close_data(l_mail_conn);
    
      UTL_SMTP.quit(l_mail_conn);
    END;
    /
    I want to call send_mail to pass a query result to "p_message":
    as an example:
    Select the sid, program, module, session machine $ v where program = 'XXX ';

    And have struggled with the lack of experience in PLSQL.
    Give advice.
    TIA

    The simplest possible thing would be something like

    DECLARE
      l_message VARCHAR2(32000);
    BEGIN
      FOR i IN (your_query)
      LOOP
        l_message := l_message || i.col1 || ' ' || i.col2 || ' ' || ... || i.col3 || utl_tcp.crlf;
      END LOOP;
    
      <>
    END
    

    This assumes that the total amount of data we're talking about is reasonably low (which is small enough that you can use a VARCHAR2). And you want a text with a data dump email basically unformatted. You may be better served with an HTML message that includes the appropriate in the body HTML formatting. And you might need your procedure send_mail to accept a CLOB rather than a VARCHAR2.

    Justin

  • Sort the results of interactive report in no data found message

    Hello

    I have an interactive report that returns results based on the: bind variable QUERY - I have a list of navigation on the side where all the elements to link to the current page with different values of request. The IR works fine until I try to sort the columns by clicking on the heading and selecting increasing / decreasing, how it returns no data available.

    It starts to work again if I change the last line of GOLD: REQUEST IS NOT NULL but this breaks the functionality of the report, I would like to return only selected articles or all if no query variable is present. I'm guessing that sort sets: ASK something temporarily and divides. My query is below, any ideas?
    SELECT   id,
             job_number,
             appt_start,
             domain,
             pwa,
             status,
             tstamp_created 
      FROM   fail_jobs 
      WHERE  (status = 'NEW' AND userid_created != 'SYSTEM' AND :REQUEST = 'ARD') 
         OR  (status = 'ATR' AND :REQUEST = 'ATR')
         OR  (status IN ('ERR','REV') AND :REQUEST = 'REV')
         OR  (status = 'COM' AND :REQUEST = 'COM')
         OR  (status IN ('PCD','PCA') AND :REQUEST = 'PCD')
         OR  :REQUEST IS NULL
    Thank you

    There are problems with interactive reports referencing known: DEMAND value, probably due to an internal logic that manages also simultaneously - potentially cause a malfunction or blockages.

    A workaround that I learned is to create a calculation to assign: APPLICATION to a temporary element (a PXX_REQUEST, for example) and reference it in the query, instead of: ASK. This has worked well for me in my experience.

    I would like to know if this helps - pls sign the thread as 'Useful' or 'Correct' if so, so more people can benefit.

    TKS,
    Kléber

  • Display the results in a report on the APEX of two datepicker page elements

    Hi all

    I'm trying to get some data to display in a report by choosing between two dates. These two dates, I select by datepickers, then a button is pressed to submit and the report to appear.

    I made the conditional statement on the button, the button submit as "searchdates", then a branch that is conditional (when the button is pressed, the application is set to "searchdates") and the branch is: 'On Submit - after treatment.

    the query behind the report is:
    select * from desk_allocation
    where (DESK_ALLOCATION.DATE_FREE >= TO_CHAR((:P5_DATE_FROM), 'DD-MON-YY') 
          AND DESK_ALLOCATION.DATE_FREE < TO_CHAR((:P5_DATE_TO), 'DD-MON-YY') 
          AND :P5_DATE_TO IS NOT NULL AND :P5_DATE_FROM IS NOT NULL)
    AND DESK_ALLOCATION.ALLOCATED like 'No'
    and the sample data that I use to test:
    DESK_NO   DATE_FREE     ALLOCATED     ALLOCATED_TO 
    66         20-AUG-10       No             -  
    75         19-AUG-10       Yes            Superman  
    60         16-AUG-10       Yes            Spiderman 
    When I run the page, it is said no data displayed.

    Someone at - it ideas?

    Using APEX v3.2

    Thanks in advance :)

    I tried with your data with this query, remove the additional supports, SQLDeveloper. There is no record for 'No', then the data found was the correct result. Changed to 'Yes' and got results.

    select * from desk_allocation
    where DESK_ALLOCATION.DATE_FREE >= TO_DATE('10-AUG-10', 'DD-MON-RR')
          AND DESK_ALLOCATION.DATE_FREE < TO_DATE('20-AUG-10', 'DD-MON-RR')
         -- AND :P5_DATE_TO IS NOT NULL AND :P5_DATE_FROM IS NOT NULL)
    AND DESK_ALLOCATION.ALLOCATED = 'Yes'
    

    Kind regards

  • You can use 7 Captivate to send the results of the quiz managers?

    I create several trivia MC very basic for a small training audience. Their managers would like to be notified by e-mail, if the students passes/a failed the test. Is this possible with Captivate 7?

    Welcome to the forum,

    E-mail is no longer included because it was not reliable at all.

    You can take a look at this widget by Jim Leichliter: http://captivatedev.com/2012/11/12/adobe-captivate-6-x-widget-google-lms-with-email-report ing-2 /

    It is also possible if you are familiar with JavaScript to create such a solution.

    Lilybiri

  • Using results of a report as settings for another report to the Disco

    I was wondering is it possible to use the results of a report as parameters to another. For example, a report that produces a list of let say number of employees. Can these employees number then injected into another report, it's settings, instead of manually select employees. I use discoverer 4.1.

    Any help would be appreciated.

    Thank you

    Hello
    Because you are using Desktop it may be possible. Office has a way to transmit the results of one column to a second worksheet.

    Here is a simple workflow:
    1. create the spreadsheet that will generate the list of employee numbers
    2. create the worksheet (in the same workbook) that must use the list of numbers
    3 create a new condition on the number of employees and in the drop-down list, select Create subquery
    4. in the dialog box, select the worksheet, and the column that you want to use, and then click the OK button
    5 test that it works

    Discoverer 10 and 11 Oracle introduced what is called hyper exercises where a user can drill a pre-built map sheet to another pre-built, passing the values of parameter or the cell of the first sheet in the second as parameters. Both worksheets not even need to be in the same workbook.

    However, even this feature can be used to transmit the entire result set, so because you use Desktop I think you'll be fine.

    Furthermore, anyone reading what is using 10 g or 11 g the same feature exists in Desktop here too. The cool thing is that if you create a new workbook with a worksheet that uses a subquery in a different worksheet in the office 10g or 11g and then open the workbook in more or spectator the subquery will still work. The not so cool, is that you can only create and maintain these subqueries use of Google Desktop.

    Best wishes
    Michael

  • Send quiz results

    My LMS may not be ready for a few months, so in the meantime I want to send the results of the quiz myself whenever someone passes the quiz. It seems that in quiz preferences, in terms of success or failure, you can define an action to send an e-mail if there is a passing grade, but it does not work for me.

    Hello

    What is 6 Captivate? If so, indeed there no option to send an email that contains the result. That has been deleted. Fortunately

    What it will do is open the mail client for the user to compose the message.

    See you soon... Rick

Maybe you are looking for