Perl-script  Net::SMTP and iMS. How To? :(

How to configure iMS to send mail with Perl-script using Net::SMTP module?
Script and iMS must run in different hosts.

Thats more a topic for perl and smtp than it is for IMS. Anyway, you could do:
unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , 'mailserver.host.com';
%mail = (
          To => '[email protected]',
From => '[email protected]',
Message => 'this is my message!,
          Subject => 'Test Subject',
sendmail(%mail) or die "Mail Not Sent!";

Similar Messages

  • ANM VA - run perl script to obtain and genarate reports.

    Good day,
    We have a customer who has an ANM deployment at a site. This is a HA deployment on RedHat. The customer created a perl script to run off an external host to generate reports. This was acheievd by querying the sqldatabase (dcm_ems). ANM version is 3.2. No problems.
    An additional ANM deployment was done on another site. ANM version 4.2. This deployment is the VA edition. They would like to deploy and run the same perl script.
    Is this possible on the VA Edition? Even with the RootPatch? Not sure of the level of access the patch provides, or if it is even recommened or would then still allow for the ANM to be supported? If possible, has the sqldatabase structure changed (suppose would need this for the guy's to ammend the script)? How would we obtain the "sqluser" and "sqlpwd" info for the perl script to use?
    Appreciate any guidance or feedback.
    Thank you in advance.
    Paul.

    Hi esteemed forum members,
    Any ideas or feedback anyone?
    Thanks.
    Paul.

  • Run perl script on remote server

    Hello
    I have 2 servers, server 1 and server2.
    I have a perl script on server2 and I want to execute that perl script so my code is like
    $command= { param($p1,$p2) cmd /c test.pl $p1 $p2 }
    Invoke-Command -session $sesion -ScriptBlock $command -ArgumentList 1,2
    session is already created with server2 from server1. 
    perl script kept on server2 spawn another cmd which interacts with server3.
    When I run above code that perl script start executing but it stays in executing step for infinite time..as per observation, I have found that it stucks when it tried to spawn another cmd which interacts with server3 from server2.
    How can I handle this?

    Second hop restriction and some issue in the perl script that prevents it from honoring the error.
    Run script interactively to test results.
    Enter-PsSession $session
    Type your command and see if you see an error.
    \_(ツ)_/

  • Perl script to extract SAP table

    Hi everyone,
    Is that possible to use Perl script to access and extract SAP table ? Is there any documentation for this ?
    Thanks

    Here's a bit of script using SAP::Rfc to read the table TBTCO, which stores background job information.  You can find the whole script here: http://www.sapdba.com/forums/viewtopic.php?f=3&t=6.  I've removed most of it so that the following is just an example of reading the table and printing the results to stdout:
    (note, this was written on a 4.6B system)
    #!/usr/bin/perl -w
    use SAP::Rfc;
    ### Variable Declarations
    $DEBUG = 0;
    $OUTPUT = "sm37.csv";
    $JOBCOUNT = 0;
    @ICONFIG = ();
    $CFGCTR = 0;
    ### End of variable declarations
    open(OUTFILE, ">>$OUTPUT") || die ("cannot open output file ", $OUTPUT, "\n");
    my $RFC = new SAP::Rfc(
                 ASHOST   => 'servername',
                 USER     => 'username',
                 PASSWD   => 'password',
                 LANG     => 'EN',
                 CLIENT   => '010',
                 SYSNR    => '01',
                 TRACE    => '0' );
    my $IT = $RFC->discover("RFC_READ_TABLE");
    $IT->QUERY_TABLE('TBTCO');
    $IT->OPTIONS( ["ENDDATE = $MAXDATE AND ENDTIME > $MAXTIME OR ENDDATE > $MAXDATE"] );
    my @FLDARRAY = qw(JOBNAME JOBCOUNT JOBCLASS PERIODIC REAXSERVER RELUNAME SDLUNAME AUTHCKMAN EVENTID SDLSTRTDT SDLSTRTTM STRTDATE STRTTIME ENDDATE ENDTIME STATUS);
    $IT->FIELDS([@FLDARRAY]);
    $RFC->callrfc( $IT );
    print "Num Rows in PRD matching selection criteria: ".$IT->tab('DATA')->rowCount()." \n";
    for my $ROW ( $IT->DATA ) {
            print "\n\nRaw row: $ROW";
            $JOBNAME = trim(substr($ROW, 0, 32));
            $JOBID = substr($ROW, 32, 8);
            $JOBCLASS = substr($ROW, 40, 1);
            if (substr($ROW, 41, 1)) {
                    $PERIODIC = 1;
            } else {
                    $PERIODIC = 0;
            $SERVER = trim(substr($ROW, 42, 20));
            $CREATOR = trim(substr($ROW, 62, 12));
            $USERNAME = trim(substr($ROW, 74, 12));
            $MANDT = substr($ROW, 86, 3);
            $EVENT = trim(substr($ROW, 89, 32));
            $SCHDATE = substr($ROW, 121, 8);
                    $SYEAR = trim(substr($SCHDATE, 0, 4));
                    $SMONTH = trim(substr($SCHDATE, 4, 2));
                    $SDAY = trim(substr($SCHDATE, 6, 2));
            $SCHTIME = substr($ROW, 129, 6);
                    $SHOUR = trim(substr($SCHTIME, 0, 2));
                    if ($SHOUR == 24) {
                            $SHOUR = "00";
                    $SMINUTE = trim(substr($SCHTIME, 2, 2));
                    $SSECOND = trim(substr($SCHTIME, 4, 2));
            $STRDATE = substr($ROW, 135, 8);
                    $BYEAR = trim(substr($STRDATE, 0, 4));
                    $BMONTH = trim(substr($STRDATE, 4, 2));
                    $BDAY = trim(substr($STRDATE, 6, 2));
            $STRTIME = substr($ROW, 143, 6);
                    $BHOUR = trim(substr($STRTIME, 0, 2));
                    if ($BHOUR == 24) {
                            $BHOUR = "00";
                    $BMINUTE = trim(substr($STRTIME, 2, 2));
                    $BSECOND = trim(substr($STRTIME, 4, 2));
            $ENDDATE = substr($ROW, 149, 8);
                    $EYEAR = trim(substr($ENDDATE, 0, 4));
                    $EMONTH = trim(substr($ENDDATE, 4, 2));
                    $EDAY = trim(substr($ENDDATE, 6, 2));
            $ENDTIME = substr($ROW, 157, 6);
                    $EHOUR = trim(substr($ENDTIME, 0, 2));
                    if ($EHOUR == 24) {
                            $EHOUR = "00";
                    $EMINUTE = trim(substr($ENDTIME, 2, 2));
                    $ESECOND = trim(substr($ENDTIME, 4, 2));
            $STATUS = substr($ROW, 163, 1);
            if ($SCHTIME && $STRTIME && $SYEAR && $BYEAR) {
                    ($LY,$LM,$LD, $Lh,$Lm,$Ls) = Delta_YMDHMS($SYEAR,$SMONTH,$SDAY, $SHOUR,$SMINUTE,$SSECOND,
                                                              $BYEAR,$BMONTH,$BDAY, $BHOUR,$BMINUTE,$BSECOND);
                    $DELAY = ($Ls + ($Lm * 60) + ($Lh * 3600) + ($LD * 86400));
                    $LY = ""; $LM = "";
            if ($ENDTIME && ($ENDDATE >= $STRDATE) && $BYEAR && $EYEAR) {
                    ($DY,$DM,$DD, $Dh,$Dm,$Ds) = Delta_YMDHMS($BYEAR,$BMONTH,$BDAY, $BHOUR,$BMINUTE,$BSECOND,
                                                              $EYEAR,$EMONTH,$EDAY, $EHOUR,$EMINUTE,$ESECOND);
                    $DURATION = ($Ds + ($Dm * 60) + ($Dh * 3600) + ($DD * 86400));
                    if ($DURATION < 0) {
                            $DURATION = 0;
                            print "Duration less than zero, set to zero\n";
                    $DY = ""; $DM = "";
            } else {
                    $DURATION = 0;
            print OUTFILE ("$SAPSID,$JOBNAME,$JOBID,$JOBCLASS,$PERIODIC,$SERVER,$CREATOR,$USERNAME,$MANDT,$EVENT,$SCHDATE,$SCHTIME,$STRDATE,$STRTIME,$ENDDATE,$ENDTIME,$DELAY,$DURATION,$STATUS\n");
           $JOBCOUNT ++;
    $RFC->close();
    close OUTFILE;

  • Is there any possibility running a Perl Script in JSP?

    Is there any possibility running a Perl script in JSP and get the value of the JSP variable? The JSP page is running in TOMCAT 5.0 server.

    i am created one script .... i want to replace it the older one ... it is possible in development server ..... is there any possibility to assingn the form in quality server ?????
    is there any other way to assign the form to transaction with out using NACE?.
    Well regarding you question about the system to have it assigned, ideally you need to assign it in development and mopve it up stacks. However, i aint sure of the roles you are assigned with for doing any config changes in QS. and the config needs to be done through NACE. Following is the process.
    You need to first find the Output type and the standard form attached to the existing program/ tcode. This info can be fetcehd from TNAPR table. Once you have got the details, you can then get into NACE tcode to configure your new custom form instaed of the existing Standard one. Get the application type, output type from TNAPR table. Then select the particular outpput type in NACE nad click on processing routine. This is the place where the new form name needs to be updated.
    Hope this helps!
    Cheers!
    Varna
    Edited by: Varna17 on Sep 24, 2009 7:10 AM

  • Runtime.exec("Perl Script writing and reading on I/O"), handling Streams

    Hi all !!
    In a first place : sorry for my english if it's not really understandable but I try to do as good as possible !
    I'm writing a GUI with Swing that will allow (in one of my multiple tables) the user to run a Perl Script.
    This Perl Script ask the user to choose a Folder ... then read all the files in this folder and for each file (xml File), extract the datas and put them in a database. But when a file that has to be inserted in the database contains this line : <Template_Used name="ST1.mtt"> and if the Template table in my database doesn't have the "ST1.mtt" stored ... the Perl Script ask to the user to give him the path of the file "ST1.mtt" so that the script can put the "ST1.mtt template" datas in the database.
    This script runs well when it is from a windows console.
    But I need a graphic interface !!!
    So I created a JButton "Process a folder".
    When the button is pressed, a JFileChooser appears and ask the user which Folder has to be processed.
    Then a Process is created with the command : ("cmd.exe /C \"C:\\Program Files\\Fluke\\Ansur\\ProcessFolder.bat\").
    The BatFile :
    {code}cd C:\Documents and Settings\tsd\Desktop\Gael-Project\Project_Files
    perl Process.pl
    exit{code}
    At this moment everything is working well.
    But my Process.pl (which is 300 lines long ... and that you don't even want to hear about), ask in a first time the Path of the folder to process and sometimes ask the path to a file (a template file).
    So I need to read and wirte on the STDIN/STDOUT during the exec of the Process.
    In order to handle this I created two different threads : one reading the Process.getInputStream with a BufferedReader and one other writing on the Process.getOutputStream with a PrintWrinter.
    What I need to do is :
    When I read a line from the InputStream saying "I need the path of the ST1.mtt file", I should run a JFileChooser ... the user find the file in the computer ... and I write in the OutputStream the path of the file, so that my Perl Script doesn't have un Unitialised value on <STDIN> and can continue to process !!
    I'm pretty sure it's possible ... because at the moment I just used a trick :
    When the user push the "process a folder" button, I write the paths in the OutputStream before than the script needs it and it works !
    But I need to write in the OutputStream only when it is time !!!
    Any idea ??
    Here are some parts of my code :
    {code}
    String filename = File.separator+"tmp";
              JFileChooser fc = new JFileChooser(new File(filename));
              fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY );
              // Show open dialog; this method does not return until the dialog is closed
         fc.showOpenDialog(null);
         Folder = fc.getSelectedFile();
              new GoodExec(cmd);
    {code}
    {code}
    public class GoodExec {
         public static Process proc;
         public static StreamGobbler errorGobbler;
         public static StreamGobbler inputGobbler;
         public static StreamGobbler outputGobbler;
         public GoodExec(String cmd)
         try
                   Runtime rt = Runtime.getRuntime();
              proc = rt.exec(cmd);
         // any error message?
         errorGobbler = new
         StreamGobbler(proc.getErrorStream(), "ERROR");
         // any input?
         inputGobbler = new
         StreamGobbler(proc.getInputStream(), "INPUT");
         // any output?
              outputGobbler = new
              StreamGobbler(proc.getOutputStream(), "OUTPUT");
         // kick them off
         errorGobbler.start();
         inputGobbler.start();
         outputGobbler.start();
         // any error???
         int exitVal = proc.waitFor();
         System.out.println("ExitValue: " + exitVal);
         } catch (Throwable t)
         t.printStackTrace();
    {code}
    {code}
    public class StreamGobbler implements Runnable
    InputStream is;
    OutputStream os;
    String type;
    Thread thread;
    public static String chaine;
    StreamGobbler(InputStream is, String type)
    this.is = is;
    this.os=null;
    this.type = type;
    StreamGobbler(OutputStream os, String type)
    this.os = os;
    this.is=null;
    this.type = type;
    public void start () {
         thread = new Thread(this);
         thread.start ();
    public void run()
    try
    if (is == null){
         PrintWriter toProgram = new PrintWriter(os);
         File FolderToProcess = ProcessFolder.Folder;
    String Folder = FolderToProcess.getPath();
    toProgram.write(Folder);
    toProgram.close();
    else {
         if (os == null){
         InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line=null;
    String comp = "Please enter the exact path of the directory that contains the files you want to process.";
    while ( (line = br.readLine()) != null){
         if (type.equals("INPUT")){
              chaine+=line+"\n";
         if (line.equals(comp)) {
              System.out.println("give directory");RUN A JFILECHOOSER AND GIVE THE DIRECTORY TO THE OUTPUTSTREAM
    System.out.println(type + ">" + line);
    is.close ();
    catch (IOException ioe){
         ioe.printStackTrace();
    {code}
    And here is an example of a simple perl script that could be used (it s a simple one !!) :
    {code}
    #!/usr/bin/perl -w
    use strict;
    print "Please enter the exact path of the directory that contains the files you want to process.\n";
    my $dir= <STDIN>;
    chomp ($dir);
    print "titallala $dir";
    if (the template of the file is not in the database){
    print "Please give me the template so that I can put it in the database";
    $dir= <STDIN>;
    chomp ($dir);
    {code}
    Thank you for your help ... if it's possible to help me !!
    Gael

    BalusC -- The line that gives me my NullPointerException is when I call the "DisplayProduct()" method. Its a dumb question, but with NetBeans how do I find out which reference could be null? I'm not very familiar with how NetBeans works with finding out how to debug. Any help you can give me would be greatly appreciated.The IDE is com-plete-ly irrelevant. It's all about the source code.
    Do you understand anyway when and why a NullPointerException is been thrown? It is a subclass of RuntimeException and those kind of exceptions are very trival and generally indicate an design/logic/thinking fault in your code.
    SomeObject someObject = null; // The someObject reference is null.
    someObject.doSomething(); // Invoking a reference which is null would throw NPE.

  • Under a GUI, I need to run a perl script, how to do this?

    Hi - I am writing a GUI for my clients and one of the things my program must do is run a perl script. I am able to run perl.exe but it seems like perl.exe is not running the script. I also tried to put the perl script in a batch file and then call the batch file from my java GUI program. I still get the same issue of just perl.exe running but thats not running the script. My last attempt was to write a small class to test if perl.exe can run the script under a command line. I got the perl.exe to run the perl script but how do I but implement that class in my GUI if my test class needs a command line? How can I run a command line in my GUI so the perl script can be run.
    The Runtime.getRuntime.exec(RunPerlScript) is not working like I want it.
    I also tried Runtime r = Runtime.getRuntime();
    Process p = r.exec(RunPerlScript);
    How can I run the MS-DOS prompt from my program if the Runtime Environment is running already. The Runtime Environment seems to not allow another prompt to be opened and from there I can run the perl script manually or automatically from my program.
    What does the "cmd /c start..." or "c:\\windows\\command.com..." do? I have seen that in the forum but it doesn't seem to be running the perl script. The perl.exe runs, but not the perl script. I need anyones help desperately. Damn microsoft, why did they remove completely the functionality of DOS. I have a feeling my program will run perfectly under a UNIX environment, because I needed to do was open another shell. Thats what I need in windows!
    Thank you for your help.
    Seigot

    hi
    I am working on this perl scripts do run on GUI's well the process command is fine try java 1.3 it works fine. if u need more help let me know
    all the best

  • How to run the perl script from java ?

    Hi , I need to run the pearl script from the server and to get the result of the script thro' java using SSH
    Is there any 3rd party SSH API in java ?
    Please help me out
    thanks in advance
    karthik

    This seems like a very strange thing to want to do.
    What is the perl script doing?
    Do other programs (not some shell script) access this server-side perl script from a different machine?
    If so how do they do it?
    What currently triggers the perl script to execute?
    What currently handles the output from the perl script?
    If you can answer these questions (and understand the answers) you should be able to come up with a different approach to this.
    You do not really want to call a remote perl script from a Java program, you want to achieve the effect you think that would have if you could do it.
    So find the answers to the above questions, write them on 3" x 5" cards and lay them out on your desk.
    What flow of control needs to happen? Which piece of code needs to produce or consume which piece of data?
    If that fails, ask you self or who ever is making you do this what are the use-cases?
    If you do not know what use-cases are or do not understand them well enough try reading
    Use Case Modeling (The Addison-Wesley Object Technology Series) by Kurt Bittner and Ian Spence (Paperback - Aug 30, 2002)
    http://www.amazon.com/s/ref=nb_ss_gw/002-7908514-4043267?url=search-alias%3Dstripbooks&field-keywords=use+cases&x=0&y=0
    It is a short and easy to read book on the subject and also one of the best.
    You MUST understand WHAT you are trying to achieve before you can decide HOW you are going to achieve it.

  • Geany Trouble: Compiling Perl Scripts (and general Perl questions)

    I'm brand new to Perl because I hear it's one of the best and so far I've found that it is.  I used to program a little C++ here and there and a while ago taught myself python but I'd have to say Perl is better than both of them.  At any rate, that's neither here nor there.  I use Geany and love it, so I didn't see a reason to switch to something new for Perl.  Unfortunately I'm having some trouble with compiling.  Geany flat out refuses to.  I looked around and didn't find anything on here or in the wiki or on the Ubuntu forums other than one person who said to replace the compile command with the execute command. 
    So, do I even need to compile my Perl scripts or is there something else I'm missing?
    On a somewhat related note, the same user on the Ubuntu forums said that at the top of the code there should be:
    #!/usr/bin/perl -w
    I'm curious if I need the "-w" or what it even does since as of right now I have
    #!/usr/bin/perl
    and executing the program poses no problems.
    Any help is greatly appreciated,
    --Wes

    Well, for one, perl is not a compiled language. You can if you want to, but it gains you few benefits. Google for "perl compiler" if you really must.
    As for the second, do you know how the shebang line works in unix, and do you know what the -w option does for perl? The answer should reveal itself to you.
    Make sure you "use strict;", it will catch many errors.

  • How can I get firefox to execute perl scripts from local files

    I have created perl scripts on my local host (file type ".pl").
    In MS Windows I have associated that type to a perl interpreter installed on my local host.
    IE allows me to create links to them and to execute them (after asking for permission).
    How can I get firefox to do the same? It doesn't seem to allow me to add application types, only to change those that are already defined. As a result, in firefox, they just show up as text, instead of being executed.

    First guess is that you did not use an .html extension on the file. The file may well be ''name.html.txt''
    * see http://www.bbc.co.uk/webwise/guides/file-extensions
    *http://windows.microsoft.com/en-gb/windows/show-hide-file-name-extensions#show-hide-file-name-extensions=windows-vista
    Forum Note
    This is normally offtopic for this forum. I say normally because now we cover webmaker questions. I wonder if this is therefore on topic as a webmaker question?
    I have tagged with webmaker-contribution

  • I'm trying to execute and possibly terminate a PERL script from Labview.

    I am currently using the system exec.vi to run my perl script. I would like to be able to terminate it as well. Any suggestion?
    I'm running from windows xp.

    Try looking at http://www.jeffreytravis.com/lost/labperl.html
    The download (LabPerl) gives you comms between Labview ' Perl and viceversa.
    And doesn't take too long to fathom out how it all works.
    The perl program is set running (manually or by labview command window - don't wait for completion) followed by labview control etc.
    N.B.
    Each labview write string requires a Linefeed - then chomp at perl end
    The secret is to  have a good handshake method - each LabView read returns to perl an "ok"

  • HT2488 How to I insert text into a this command in automator wine "Text goes here" this is a perl script

    I have spent hours trying to figure this out, automator is the hardest thing to figure out. All I want to do is emulate me doing this
    -Open terminal
    -type wine
    -drag and drop the location of an .exe file
    -hit enter
    Now this should be easy as all I have to do is do run shell script, insert argument and done, BUT IT DOESNT RECOGNIZE WINE!?!?! Pleas help me.
    Let me clarify.
    If I make an automator application that that runs the command "wine" and then inserts text into the space after that Then i will be set. But no matter what I do nothing works. If i set the shell to perl and pass input as argument....It doesnt work the $f and $@ stuff doesnt work.
    Wine is likely not recognized because is is pearl based so I set it to pearl, but how do i pass and argument over to it?

    Try
    /opt/local/bin/wine "$@"
    The "..." will protect the white space, but still allow $variable subsitutions.
    The $@ will substitute all the files you drag as a group to your Automator app.
    The notation "$@" does the substitution with each file properly quoted to protect the white space in the file path, but provide each file as its own quoted argument to the 'wine' command line.
    If you need to invoke 'wine' once for each file of a group of files you drag on to your automator app, then use
    for f in "$@"
    do
         /opt/local/bin/wine "$f"
    done
    This will loop through each file of a group of files you drag onto your automator app, and invoke 'wine' once for each file in the group.

  • Perl Script to Verify a Database is up and running

    Hi there,
    Can any one suggest a way how to verify if the database is up and running from unix using a perl script? If not ,ofcourse the script will fail. Getting the following error ..
    ERROR: ORA-12203: TNS:unable to connect to destination
    Any suggestions are most valuable to me.
    Thank you,
    Kiran

    Cant we test it with any user other than sysdba? Yes..
    $dbh = DBI->connect("dbi:Oracle:", 'some_user', 'password') or die "Connect E
    rror $DBI::errstr\n";
    can we add this in the existing perl scripts? yes you can but DBI and DBD::Oracle need to be added to perl
    How to execute this? Create a script with your perl code and make it executable e.g. chmod 700 myscript.pl
    How do we know we have DBI module is present to use it? Once you create a script and try to execute it you will get errors on your use DBI statement.
    DB server and unix should be on the same machine right? In this example yes... But you can connect to any db through sqlnet using the tnsnames or with DBI you can do dynamic connections as well. So it will completly bypass tnsnames.ora.
    I would strongly suggest looking at "programming the Perl DBI"
    HTH
    Frank

  • How to call PERL Scripts from JavaFX?

    Hi to all,
    Does any one knows how to call a perl script with or without parameters from JavaFX?
    Thanks in advance.
    Kind Regards.

    If I need to pass some parameters to the perl script, how I do so?
    java.lang.Runtime.getRuntime().exec(['cmd', '/c', 'start',  "c:\\helloperl.pl"]);
    What's   'cmd', '/c', 'start'
    The cmd stands for command prompt from xp and prior and /c is stands for the command to be passed to command promt.
    I don't have good experience of perl but if it's like java then you can pass the parameter like this
    java.lang.Runtime.getRuntime().exec(['cmd', '/c', 'start',  "c:\\helloperl.pl param1 param2"]); Thanks,
    narayan

  • How to launching a perl script by the "begin" script of a jumpstart

    Hi all,
    i have an urgent pb with my solaris jumpstart, let me explain to you :
    i want that the begin script launch some perl script, but i have a problem
    here is my "begin" script:
    echo "Begining ISO FLAR based jumpstart."
    echo ""
    echo "Starting Ullink Configuration"
    env > /tmp/env
    /bin/sh << EOF
    /usr/bin/perl /cdrom/.archives/admin-scripts/sethostname.pl
    EOFmy perl script use a STDIN
    with this configuration, the perl script is launching but it runs in a loop indefinitely with an error "use of uninitialized value", because (i think) a value is return to the begin scritp and not to the perl script.
    well, on a pre-installed solaris, if a launch the begin script, it happens the same thing, it runs in a loop, BUT if i comment the line "/bin/sh <<EOF" and "EOF", it works.
    at this step, i say "ok it's cool my script is working", but when i use it during the jumpstart instalaltion, the perl script does not start, without any particular error.
    here is my perl script, if you want to test :
    #!/usr/bin/perl -w^M
    # Set Hostname for Ullink Jumpstart^M
    ^M
    use strict;^M
    ^M
    sub hit_enter {^M
        print "Hit enter to continue\n";^M
        <STDIN>;^M
        print "\033[2J";^M
    }^M
    ^M
    sub get_hostname {^M
        my %towns_list = (^M
            'Paris' => 'PA',^M
            'New-York' => 'NY',^M
        );^M
    ^M
        my %sites_list = (^M
            'Office' => 'OFC',^M
            'Redbus' => 'RED',^M
            'Telehouse' => 'TLH',^M
            'DTC' => 'DTC',^M
            'iAdvantage' => 'IAD',^M
            'Nutley' => 'NUT',^M
            'Level3' => 'LV3',^M
            'Equinix' => 'EQX',^M
            'Tata' => 'TAT',^M
            'Switch-data' => 'SWI',^M
            );^M
    ^M
        my %usage_list = (^M
            'Production' => 'PRD',^M
            'UAT' => 'UAT',^M
            'DMZ' => 'DMZ',^M
        );^M
    ^M
        sub select_list {^M
            my $counter=-1;^M
            my %hash_list = @_;^M
            my @keys = keys %hash_list;^M
    ^M
            # Clear screen^M
            print "\033[2J";^M
            print "In which country this machine is hosted or will be host and will be used ?\n\n";^M
    ^M
            # Get all keys from hash^M
            my $key;
            while ($key = each %hash_list ) {^M
                $counter++;^M
                print "$counter - $key\n";^M
            }^M
    ^M
            print "\nChoose the number corresponding to your choice :\n";^M
            my $choice_number;
            chomp ($choice_number = <STDIN>);^M
    ^M
            # Verify answer^M
            if (($choice_number =~ /\d+/) and ($choice_number <= $counter)) {^M
                # Add choice to chosen hostname^M
                my $chosen=$hash_list{$keys[$choice_number]};^M
                return $chosen;^M
            } else {^M
                print "\nYour answer is not correct, you need to enter a number between 0 and $counter\n";^M
                &hit_enter;^M
                &select_list;^M
            }^M
        }^M
    ^M
        sub srv_number {^M
            print "\033[2J";^M
            print "What is the server number ?\n";^M
            my $server_number;
            chomp ($server_number = <STDIN>);^M
            if ($server_number =~ /\d+/) {^M
                return $server_number;^M
            } else {^M
                print "\nYour answer is not correct, you need to enter a number\n";^M
                &hit_enter;^M
                &srv_number;^M
            }^M
        }^M
    ^M
        my $full_hostname = &select_list(%towns_list).'-';^M
        $full_hostname = $full_hostname.&select_list(%sites_list).'-';^M
        $full_hostname = $full_hostname.'SRV-';^M
        $full_hostname = $full_hostname.&select_list(%usage_list).'-';^M
        $full_hostname = $full_hostname.&srv_number;^M
    ^M
        sub write_hostname2tmp {^M
            open (HOSTNAME, ">/tmp/set_hostname") or warn "Couldn't write $_[0] to temp file : $!\n";^M
                print HOSTNAME "$_[0]\n";^M
            close (HOSTNAME);^M
        }^M
    ^M
        print "\033[2J";^M
        print "Is $full_hostname the correct name for this server ? (y/n)\n";^M
        if (<STDIN> =~ /y|yes/i) {^M
            &write_hostname2tmp($full_hostname);^M
        } else {^M
            print "Would you like to retry (r) or set manually the hostname (s) ? (r/s)\n";^M
            if (<STDIN> =~ /s/i) {^M
                print "Type the full required name and hit enter when finished :\n";^M
                chomp ($full_hostname = <STDIN>);^M
                &write_hostname2tmp;^M
            } else {^M
                &get_hostname;^M
            }^M
        }^M
    }^M
    ^M
    # Start configuration^M
    print "\033[2J";^M
    print "\n########################################################\n";^M
    print "#\t\t\t\t\t\t       #\n";^M
    print "#\t\t\tULLINK\t\t\t       #\n";^M
    print '#  Solaris Environnement Installation for Datacenters  #';^M
    print "\n#\t\t\t\t\t\t       #";^M
    print "\n########################################################\n\n";^M
    print "Before starting installation, you need to enter a set of informations.\n(answer to all questions, you can Ctrl+C to stop now)\n\n";^M
    &hit_enter;^M
    ^M
    &get_hostname;^Mthank for your help
    Edited by: ullink on Jun 25, 2009 6:05 AM

    Hi Manju,
    You can try the following command and check if any helps:
    Get-Exchangeserver |where-object{$_.AdminDisplayVersion -like "Version 15*"} |Get-MailboxStatistics | Ft -auto -wrap DisplayName,database,servername,*size*,*time*
    Best regards,
    Niko Cheng
    TechNet Community Support

Maybe you are looking for