Executing commands in Powershell over SSH does not work

0
I'm trying to simulate Outlook email traffic over a testbed, so I am using a Powershell script to send the emails. The testbed is controlled by a Linux master server, which sends commands over a socket that are then executed on Windows 7 clients. The problem
I'm having is that when I run the script from a Remote Desktop session, the script works perfectly. However, when the script is run from an SSH session or through the testbed code, the process hangs, usually upon the call to CreateItem(0).
Here is the skeleton of the code (the remaining code just randomly generates text to fill the email body and assigns a subject):
ClearHost
Add-Type -assembly "Microsoft.Office.Interop.Outlook"
$Outlook = New-Object -ComObject Outlook.Application
$Mail = $Outlook.CreateItem(0) # Problem usually happens here
$Mail.To = "$Address"
$Mail.Subject = $Subject
$Mail.Body = $Body
$Mail.Send()
I call the script using "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass .\sendmail.ps1 <email_address>"
Other issues I've encountered include "There is no data file for sending or receiving data", which asked me to edit the profile. However, this error has only showed up infrequently. It usually just hangs.

Read it again.
Office products are NOT
designed to run without a UI.  It is well documented.
¯\_(ツ)_/¯

Similar Messages

  • ACS V 4.1.1 build 23 Password Aging over SSH does not work.

    Hi, my name is Elias and I have problems with ACS Password Aging over SSH does not work and there is no password aging meseges sent by ACS to de console when I use SSH. I know that there is problems with this but I can't find any workaround or documentation that says that there is no workaroun. Can you help me with this??
    King Regards.

    Hey Elias,
    SSHv1 does not support password changes as you can do in telnet. You will need to be
    running a version of IOS that supports SSHv2.
    The following site explains what versions support this:
    http://www.cisco.com/en/US/partner/products/sw/iosswrel/ps5207/products_feat
    ure_guide09186a00802045dc.html
    Rgds,
    somishra

  • Playing Slowmotion video over airplay does not work with ios update!!!!!

    after upgrading last ios , airplay to shoot slowmotion video does not work.
    I was expecting it to be fixed with recent update, but still not working!!!
    I use it for education at my clinic - which is essential, and how come apple does not fix it at all?
    or apple should give downgrade option at least.
    FIx it, fix it, fix it!
    Main purpose of puchasing ipad air2 was to airplay slowmotion video to big screen and i  am quite disappointed with my purchsing ipad air 2.

    As the original poster, I too had issues with my iPhone 4 (4.2.1) and Apple TV 2 playing nice. The Airplay icon was visible for music, and worked perfectly. However, when watching a video, purchased through iTunes, only the "audio" option would be selectable for Airplay. After updating the Apple TV software, everything works perfectly well. When watching a video on my iPhone and selecting the Airplay icon, one of the options is to play "video" through the Apple TV, not simply audio.
    It would have been nice to know that my Apple TV needed an update when I updated my iPhone 4 to 4.2.1.

  • IOS 6 ibooks voice over funtionality does not work

    Ibooks voice over activation behavior not the same as in 5.1.  Once voice over is activated I am unable to select the text much less get it to scroll.  Single clicking does not select the text line. Double clicking doesn't either. Swiping two finger down doesn't (auto scroll) function either.  Is this a hiccup or has enabling it changed?

    New release of IBooks 2 fixes the problem.  It is the IOS 6 release.  

  • Hyper V over SMB does not work on non-Microsoft Samba servers

    I want to use for Hyper V (2012 R2 Standard) over SMB. I tried to move a virtual machine from local storage over to the SMB share and receive the error: "Remote SMB share does not support resiliency."
    I have verified the SMB share is SMB 3.0. According to Microsoft, this should be supported:
    "Using Hyper-V with SMB has the following requirements:
    One or more computers running Windows Server 2012 R2 or Windows Server 2012 with the Hyper-V role installed. You can also use non-Microsoft file servers that implement the SMB 3.0 protocol."
    http://technet.microsoft.com/en-us/libr ... 34187.aspx
    But according to others, this is an ongoing issue with Samba. (http://www.readynas.com/forum/viewtopic.php?f=119&t=77809)
    Microsoft, is this supported or not? If so, what else can I try to get this to work?

    I understand Samba will always be in catch-up mode, and I would not blame MSFT for developments within Samba. But, Microsoft does specifically state in their support documents "You can also use non-Microsoft file servers that implement the
    SMB 3.0 protocol."
    The fact the the 3.0.x *nix versions may not in fact include the features Microsoft needs means Hyper V is not in fact able to be used as identified. So, Microsoft should not promote this as being a supported feature. They should simply stop after saying "One
    or more computers running Windows Server 2012 R2 or Windows Server 2012 with the Hyper-V role installed." 
    It's not MSFT problem some people understand SMB spec too "freely"... There are some known working SMB3 non-MSFT implementations (EMC, NetApp and maybe Nutanix) and at least few of them are indeed BASED on an open source SAMBA. But these companies
    did a huge amount of work to make their fork-outs from SAMBA actually work. Unfortunately nobody bothered to back-contribute their fixes to original code base. Again, it's not MSFT problem. 
    StarWind VSAN [Virtual SAN] clusters Hyper-V without SAS, Fibre Channel, SMB 3.0 or iSCSI, uses Ethernet to mirror internally mounted SATA disks between hosts.

  • REPLACE command using passed variable values does not work

    Hi SDN Community
    Are you aware of the replace command not working when passing strings as opposed to a variable containing the string.
    For example:
    This works:
         replace '>JUL 2008</a>' with I_TEXT_VALUE into
                    I_TEXT_VALUE_REPLACE.
    This dosen't work:
         replace I_TEXT_VALUE_MATCH with I_TEXT_VALUE into
                     I_TEXT_VALUE_REPLACE.
    where I_TEXT_VALUE_MATCH = '>JUL 2008</a>'
    where I_TEXT_VALUE =  '>JUL 2008<BR>Actual</a>'
    Thank you.
    Simon

    Hi SDN Community,
    The following method was used to derive the same outcome required as per the REPLACE command.
          LEN_REPLACE = STRLEN( C_CELL_CONTENT ) - 12.
          I_TEXT_VALUE_REPLACE = C_CELL_CONTENT.
        replace I_TEXT_VALUE_MATCH with I_TEXT_VALUE into
                    I_TEXT_VALUE_REPLACE.
          I_TEXT_VALUE_REPLACE = I_TEXT_VALUE_REPLACE+0(LEN_REPLACE).
          CONCATENATE I_TEXT_VALUE_REPLACE I_TEXT_VALUE INTO
                        I_TEXT_VALUE_REPLACE.
          C_CELL_CONTENT = I_TEXT_VALUE_REPLACE.
    Thank you.
    Simon

  • Need help getting rid of Trovi virus on Safari and Chrome. Cannot use the instructions Apple sent because the copy command under the edit tab does not work.

    I use OS X 10.9.5. I have a trovi virus on Safari and Chrome. Yesterday I thought I had gotten rid of Trovi, but it's back on both my search engines. The directions Apple sent yesterday do not work; the copy function under the edit tab is grayed out and non-responsive. Can anyone help me to get rid of this virus? Thanks.

    Are you referring to these instructions?
    Remove unwanted adware that displays pop-up ads and graphics on your Mac - Apple Support
    If so, be sure to read the instructions carefully, and note that you will need to repeat the numbered steps in the Conduit/Trovi/SearchProtect removal instructions for each line shown, not all together.
    If those instructions aren't working for you, for whatever reason, try my Adware Removal Guide. It provides similar instructions, worded differently, as well as an app (AdwareMedic) that can help you do the removal automatically.
    (Fair disclosure: I may receive compensation from links to my sites, TheSafeMac.com and AdwareMedic.com, in the form of buttons allowing for donations. Donations are not required to use my site or software.)

  • SSH does not work in inside interface in ASA

    I am able to run ASM but I can't run SSH from inside interface. Does anyone know how can I start to debug the problem? I checked all the setting for enable ssh, I setup it the same way as an instruction.
    aaa authentication ssh console LOCAL
    ssh 192.168.0.0 255.255.255.0 inside
    crypto key generate rsa modulus 1024
    What I am missing here? I also have username and password for admin.
    Thanks                  

    Here is the show ver
    Result of the command: "show ver"
    Cisco Adaptive Security Appliance Software Version 8.2(3)3
    Device Manager Version 6.2(5)53
    Compiled on Wed 25-Aug-10 21:43 by builders
    System image file is "disk0:/asa823-3-k8.bin"
    Config file at boot was "startup-config"
    ciscoasa up 207 days 6 hours
    Hardware:   ASA5510, 1024 MB RAM, CPU Pentium 4 Celeron 1599 MHz
    Internal ATA Compact Flash, 256MB
    BIOS Flash Firmware Hub @ 0xffe00000, 1024KB
    Encryption hardware device : Cisco ASA-55x0 on-board accelerator (revision 0x0)
                                 Boot microcode   : CN1000-MC-BOOT-2.00
                                 SSL/IKE microcode: CNLite-MC-SSLm-PLUS-2.03
                                 IPSec microcode  : CNlite-MC-IPSECm-MAIN-2.04
    0: Ext: Ethernet0/0         : address is 5475.d050.7f46, irq 9
    1: Ext: Ethernet0/1         : address is 5475.d050.7f47, irq 9
    2: Ext: Ethernet0/2         : address is 5475.d050.7f48, irq 9
    3: Ext: Ethernet0/3         : address is 5475.d050.7f49, irq 9
    4: Ext: Management0/0       : address is 5475.d050.7f45, irq 11
    5: Int: Not used            : irq 11
    6: Int: Not used            : irq 5
    Licensed features for this platform:
    Maximum Physical Interfaces    : Unlimited
    Maximum VLANs                  : 50       
    Inside Hosts                   : Unlimited
    Failover                       : Disabled
    VPN-DES                        : Enabled  
    VPN-3DES-AES                   : Enabled  
    Security Contexts              : 0        
    GTP/GPRS                       : Disabled 
    SSL VPN Peers                  : 2        
    Total VPN Peers                : 250      
    Shared License                 : Disabled
    AnyConnect for Mobile          : Disabled 
    AnyConnect for Cisco VPN Phone : Disabled 
    AnyConnect Essentials          : Disabled 
    Advanced Endpoint Assessment   : Disabled 
    UC Phone Proxy Sessions        : 2        
    Total UC Proxy Sessions        : 2        
    Botnet Traffic Filter          : Disabled 
    This platform has a Base license.
    Serial Number: JMX1420L3JW
    Running Activation Key: 0x8b0edb7c 0x4cee2474 0x34813190 0x90e01484 0x0d2211b2
    Configuration register is 0x1
    Configuration last modified by cdinh at 15:36:53.519 PDT Mon Jul 29 2013

  • Glow over bitmap does not work

    Hello
    I have put an effect on a path: stylise > outer glow.
    The pass is partly over a bitmap. The part of the path that's not over the bitmap has a normal glow, but the part of the path that is over the bitmap has a glow so weak , it's almost invisible.
    Please check the following link for a picture that shows the problem: http://david.saber.free.fr/bazaar/problems/illustrator-glow-over-bitmap.jpg
    How can I fix this?
    Thanks in advance,
    David

    I have created the FX with the Appearance palette,using the "FX button" at its bottom.
    I think you both nailed it with the color mode.
    My source image is a Photoshop CS6 file set to CMYK.
    My Illustrator document is also set to CMYK.
    When I went to file > document color mode > and switched from "CMYK" to "RGB", the problem disapeared! So thank you both for the help.
    But the problem is: this document is intended for printing.
    Should I work in RGB in Illustrator, then export to Photoshop and then convert to CMYK before printing?
    Perhaps I could just export to PDF from Illustrator, as I beleive exporting to PDF automatically converts to CMYK?
    Thanks again and see you,
    David

  • ASR9K access with ssh does not work.

    Hi all, I have a ASR9001 enabled SSH server, it was working fine but when I try to access these messages appear:
    P/0/RSP0/CPU0:Apr 21 05:31:41 : SSHD_[65747]: %SECURITY-SSHD-3-ERR_GENERAL : Failed to allocate pty
    RP/0/RSP0/CPU0:Apr 21 05:31:43 : devc-vty[181]: %MGBL-TTY-3-KERNEL : Unexpected internal error encountered 'Resource temporarily unavailable'  : pkg/bin/devc-vty : (PID=557258) :  -Traceback= 4bc37e70 4de37b0c 4de3c3d4 4bc3a2d0 4bc3df28 4bc3540c 4bc3cd00 4ba74650 4ba7514c 4ba702c8 4bc5754c 4bc58464 40000130 40000d18
    RP/0/RSP0/CPU0:Apr 21 05:31:43 : devc-vty[181]: %MGBL-VTY-3-SESSION : Error performing TTY session operation 'Checking access parameters for VTY': a194060d, ''tty-server' detected the 'fatal' condition 'TTY SERVER INTERNAL: Unknown error condition': Permission denied'
    In the cisco page gives no recommendation for this, any comments for this?
    regards

    While I can not explain the details of the messages, it is very clear that there is some type of error (probably a software issue more likely than a hardware issue). This relates to the part that says "Unexpected internal error" and to the presence of traceback information. In my experience traceback is always related to a software issue.
    Is this perhaps a transient (temporary) problem and after a while SSH worked again? Or is the problem continuing?
    As a workaround it might help to reload the router. That might restore normal function for SSH. I believe that a longer term solution will involve upgrading to different code. If the router is covered by a maintenance contract it would be good to open a TAC case on this and get a more authoritative explanation than I am able to give.
    HTH
    Rick

  • Cancelling Screen Sharing over Bonjour does not work

    I have a MacBook and an iMac on the same local network. Both are running updated OS X 10.5 (Leopard).
    Here's the situation:
    1. Let's say I'm at my MacBook and I want to see my iMac's screen. I open screen sharing.
    2. For whatever reason, I later am sitting at my iMac, and I see the screen sharing icon in the menu bar. I select it and tell it to disconnect.
    3. A few seconds later, the icon returns.
    The same thing happens if the computers are reversed.
    Why is this?

    This issue remains unresolved, but since Apple Discussions decided to archive my question it is impossible to receive any replies.
    GRR.

  • Photos local sync over itunes does not work

    Hey, works for me to sync new photos of the new Photos app via iTunes to the iPhone until I restart iTunes. Example: I import from the camera a new image in photos and pack it into an album. iTunes is open and I want the new image to the iPhone. Unfortunately, it transmits only the new images from photos when previously I conclude iTunes and reboot again. Has anyone even seen such a thing? With iPhoto, which went smoothly! best regards, Uli

    Update iTunes to the latest version, 12.1.2 from here: iTunes 12.1.2. It fixes them sync issue with mobile devices.

  • My ipod shuffle voice over button does not list the song/artist or give battery status.  I am following direions but it doesn't respond wether I push it once or twice.  Any ideas?

    ?The voice over button does not work per directions (press once for title/artist; press twice for battery status.  Any ideas how to make this work?

    I discovered that if I push the button quickly (twice), I get the battery status.  But I still do not have any title artist data.  The music get quieter but no info.

  • Why listeners does not work?

    I have the problem with starting sqlplus session.
    I have created database mybase.
    When I start listener with command:
    lsnrctl startand then I try to log into ma database with the command:
    sqlplus SYSTEM/MYPASSWORD@mybaseit does not work, although the listeners claims it's OK.
    BUT
    if the listener the application 'dbca' is started and I choose in it to modify my database without any changes (I suppose it just raises the oracle engine up),
    then every think works fine.
    Could anyone help me with the problem? How to work without the calling 'dbca' each time?
    Thank you.
    Waldemar

    It is an error! It should be added BEFORE:
    ...BUT
    if BEFORE the listener the application 'dbca' is started ...
    Waldemar

  • Sorting does not work  with ROW_NUMBER () OVER (ORDER BY

    CREATE OR REPLACE PROCEDURE SP_SALES (
    p_sales_id IN VARCHAR2,
    p_rownnum_from IN NUMBER,
    p_rownnum_to IN NUMBER,
    p_sort_by IN VARCHAR2,
    p_query OUT SYS_REFCURSOR,
    AS
    v_query VARCHAR2 (32000);
    v_sort_list VARCHAR2(32000) ;
    BEGIN
    IF p_spv_sort_by IS NULL THEN
    v_sort_list := 'given_name ASC ' ;
    ELSE
    v_sort_list :=p_spv_sort_by;
    END IF ;
    DBMS_OUTPUT.PUT_LINE ('v_sort_list '||v_sort_list);
    OPEN p_query FOR
    SELECT sales_id,
    item_id,
    order_num,
    employee_name
    ,given_name
    dept_id,
    manager_name,
    ROW_NUM
    FROM
    (SELECT x.*,
    ROW_NUMBER () OVER (ORDER BY v_sort_list ) ROW_NUM
    FROM (sales_id,
    item_id,
    order_num,
    employee_name
    ,given_name
    dept_id,
    manager_name,
    FROM order rvw,
    sales pol,
    emp ca,
    WHERE pol.id = rvw.pr_order_id
    AND ca.empid =pol.employee_id
    AND status = 'SUP') x )
    WHERE ROW_NUM BETWEEN p_rownnum_from AND p_rownnum_to;
    -- ORDER by v_sort_list ;
    DBMS_OUTPUT.PUT_LINE ('v_sort_list '||v_sort_list);
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE ('EX ');
    END;
    END;
    SHOW ERRORS
    Sorting does not work. Am I doing something wrong here?
    executing procedure using below
    declare
    x SYS_REFCURSOR;
    y number;
    BEGIN
    SP_SALES('70159_502',1,5, 'GIVEN_NAME'||' ASC' ,:x);
    --dbms_output.put_line (:x);
    END;

    Hello
    Depending on how many different columns you can sort on and the data types of them, it may be feasible for you to include the conditional logic in the existing statement without the need for dynamic sql...
    DTYLER_APP@pssdev2> var p_spv_sort_by varchar2(100)
    DTYLER_APP@pssdev2>
    DTYLER_APP@pssdev2> exec :p_spv_sort_by:='some other column'
    PL/SQL procedure successfully completed.
    P_SPV_SORT_BY
    some other column
    DTYLER_APP@pssdev2>
    DTYLER_APP@pssdev2> WITH source AS
      2  (   SELECT 'a' given_name, 'z' other_column from dual UNION ALL
      3      SELECT 'b' given_name, 'y' other_column from dual UNION ALL
      4      SELECT 'c' given_name, 'x' other_column from dual
      5  )
      6  SELECT
      7      given_name,
      8      other_column,
      9      ROW_NUMBER ()
    10     OVER (
    11        ORDER BY
    12           CASE
    13              WHEN :p_spv_sort_by IS NULL THEN given_name
    14              WHEN :p_spv_sort_by = 'some other column' THEN other_column
    15           END)
    16        ROW_NUM
    17  FROM
    18      source
    19  /
    G O    ROW_NUM
    c x          1
    b y          2
    a z          3
    3 rows selected.
    DTYLER_APP@pssdev2> exec :p_spv_sort_by:=NULL;
    PL/SQL procedure successfully completed.
    P_SPV_SORT_BY
    DTYLER_APP@pssdev2> WITH source AS
      2  (   SELECT 'a' given_name, 'z' other_column from dual UNION ALL
      3      SELECT 'b' given_name, 'y' other_column from dual UNION ALL
      4      SELECT 'c' given_name, 'x' other_column from dual
      5  )
      6  SELECT
      7      given_name,
      8      other_column,
      9      ROW_NUMBER ()
    10     OVER (
    11        ORDER BY
    12           CASE
    13              WHEN :p_spv_sort_by IS NULL THEN given_name
    14              WHEN :p_spv_sort_by = 'some other column' THEN other_column
    15           END)
    16        ROW_NUM
    17  FROM
    18      source
    19  /
    G O    ROW_NUM
    a z          1
    b y          2
    c x          3
    3 rows selected.
    DTYLER_APP@pssdev2>But that would depend on the columns you're sorting on being of the same data type or at least having the ability to convert them to the same data type without loosing the sort order.
    DTYLER_APP@pssdev2> WITH source AS
      2  (   SELECT 'a' given_name, sysdate - 2 other_column from dual UNION ALL
      3      SELECT 'b' given_name, sysdate - 1 other_column from dual UNION ALL
      4      SELECT 'c' given_name, sysdate  other_column from dual
      5  )
      6  SELECT
      7      given_name,
      8      other_column,
      9      ROW_NUMBER ()
    10     OVER (
    11        ORDER BY
    12           CASE
    13              WHEN :p_spv_sort_by IS NULL THEN given_name
    14              WHEN :p_spv_sort_by = 'some other column' THEN other_column
    15           END)
    16        ROW_NUM
    17  FROM
    18      source
    19  /
                WHEN :p_spv_sort_by = 'some other column' THEN other_column
    ERROR at line 14:
    ORA-00932: inconsistent datatypes: expected CHAR got DATE
    DTYLER_APP@pssdev2> WITH source AS
      2  (   SELECT 'a' given_name, sysdate - 2 other_column from dual UNION ALL
      3      SELECT 'b' given_name, sysdate - 1 other_column from dual UNION ALL
      4      SELECT 'c' given_name, sysdate  other_column from dual
      5  )
      6  SELECT
      7      given_name,
      8      other_column,
      9      ROW_NUMBER ()
    10     OVER (
    11        ORDER BY
    12           CASE
    13              WHEN :p_spv_sort_by IS NULL THEN given_name
    14              WHEN :p_spv_sort_by = 'some other column' THEN TO_CHAR(other_column,'YYYYMMDDHH24MISS')
    15           END)
    16        ROW_NUM
    17  FROM
    18      source
    19  /
    G OTHER_COLUMN            ROW_NUM
    a 12-SEP-2011 15:04:19          1
    b 13-SEP-2011 15:04:19          2
    c 14-SEP-2011 15:04:19          3
    3 rows selected.HTH
    David

Maybe you are looking for

  • How to transfer passwords encrypted from client to server?

    Hello dear community, I have already some experience with programming and did a lot of web-software, but I never was facing the problem that passwords are transfered as plain text to the server when using a login-form. For my front-end, I use Java Se

  • New window manager (with prototype!) [wmii-like] --- looking for help

    I have a prototype for a new window manager in the style of wmii. It is called cakewm. I currently have a prototype version implemented in pygame, and would like help moving this to use X---making it a real window manager. Disclaimer: I have a very l

  • Business Partner Transfer using ALE/IDOCS

    Dear Gurus, I am using S.R.M. 5.0 system. I am encountering scenario of transferring the business partners from S.R.M sytem to C project which is again add-on module provided by SAP. I have created Distribution Model and have assigned the message typ

  • Problemns with JTree

    Hi! I'm having problems with the Tree cell renderer. I must render a tree that have leafs that is also JPanels compounded by a checkbox, an icon and a the text label. It's supposed to alter the state of the checkbox when clicked or when press the spa

  • Media converter and stuff

    Can anybody help? I can link my 6680 no problem to my pc all ok connection is fine. But when ever i try to update too phone with pics or sound it dont work for example,every image i have tryed in every format i get the same error message. >>>nokia im