Connect internal in shell script not working

Oracle: 11.2.0.1 in AIX env
I export ORACLE_SID and then try to connect internal but I get connected to idle instance. What am I missing???
this block is in a .sh script
export ORACLE_SID=ufms203
$ORACLE_HOME/bin/sqlplus /nolog <<EOF
connect / as sysdba
WHENEVER SQLERROR EXIT;
select instance_name from v$instance;
OUTPUT *********************
SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 29 09:43:05 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> Connected to an idle instance.
SQL> SQL> SQL> select instance_name from v
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
Disconnected

The instance is started:
k801ora@jd1su143 in /a0143/d01/scripts : ps -ef | grep ufms203
k801ora 8794340 1 0 12:32:46 - 0:00 oracleufms203 (LOCAL=NO)
k801ora 8929434 1 0 09:33:52 - 0:00 ora_w001_ufms203
k801ora 10248348 1 0 Mar 22 - 2:24 ora_pmon_ufms203
k801ora 10359024 1 0 Mar 22 - 0:15 ora_gen0_ufms203
k801ora 10379478 1 0 Mar 22 - 7:50 ora_vktm_ufms203
k801ora 10399748 1 0 Mar 22 - 0:40 ora_dbw0_ufms203
k801ora 10408158 1 0 Mar 22 - 1:19 ora_psp0_ufms203
k801ora 10420478 1 0 Mar 22 - 0:16 ora_mman_ufms203
k801ora 10428426 1 0 Mar 22 - 0:16 ora_diag_ufms203
k801ora 10436840 1 0 Mar 22 - 0:17 ora_dbrm_ufms203
k801ora 10440938 1 0 Mar 22 - 12:00 ora_dia0_ufms203
k801ora 10445048 1 0 Mar 22 - 2:51 ora_ckpt_ufms203
k801ora 10449134 1 0 Mar 22 - 0:38 ora_dbw1_ufms203
k801ora 10453232 1 0 Mar 22 - 0:35 ora_dbw2_ufms203
k801ora 10457330 1 0 Mar 22 - 0:35 ora_dbw3_ufms203
k801ora 10461428 1 0 Mar 22 - 0:47 ora_lgwr_ufms203
k801ora 10465530 1 0 Mar 22 - 0:04 ora_reco_ufms203
k801ora 10469624 1 0 Mar 22 - 0:55 ora_smon_ufms203
k801ora 10473726 1 0 Mar 22 - 4:42 ora_mmnl_ufms203
k801ora 10477820 1 0 Mar 22 - 2:43 ora_mmon_ufms203
k801ora 10485770 1 0 Mar 22 - 0:08 ora_q002_ufms203
k801ora 10489864 1 0 Mar 22 - 0:07 ora_qmnc_ufms203
k801ora 10506270 1 0 Mar 22 - 0:04 ora_q000_ufms203
k801ora 10530842 1 0 Mar 22 - 0:04 ora_q001_ufms203
k801ora 10588214 1 0 Mar 22 - 0:19 ora_smco_ufms203
k801ora 11124888 10510484 2 09:54:04 pts/0 0:00 grep ufms203
k801ora 11796592 1 0 09:35:19 - 0:00 ora_w000_ufms203
k801ora 12431386 1 0 09:53:53 - 0:00 ora_w002_ufms203
k801ora 12484794 1 0 12:32:41 - 0:11 oracleufms203 (LOCAL=NO)
k801ora 16023576 1 0 12:32:04 - 1:12 oracleufms203 (LOCAL=NO)
k801ora 16629976 1 0 09:25:21 - 0:00 ora_w005_ufms203

Similar Messages

  • Shell script not working

    Hi
    All,
    I have oracle 9i and 10g on unix. now i have 920.env and 1020.en file to set p respective enviornment.
    when I excecute this commnad
    . $HOME/920.env from the shell prompt it is working fine. and also same for 1020.env .
    Now same command . $HOME/920.env i am putting in shell script and trying to execute that script but it is not executing.
    i don't know what to do.
    Thank you
    vishal

    now as i understand that statement is executing but it's scope is only with in the script. when it complete it's execution all varialble reset to it's by defualt .profile so that statement in the script set variable with in the scope of the script only.
    Thanks for your help
    Vishal

  • Hardcode password in a do shell script not working

    I have been trying to solve something i have wanted to do for a long time, that is get a script that changes the ammount of time before the display goes to sleep. I tried GUi scripting but in system preferences the changes made to the slider did not stay. So i have now come onto a do shell script. Found below. I would prefer to just hardcode my password into it however this does not seem to work. Any ideas ?
    set exitflag to false
    try
    repeat until exitflag is true
    set {text returned:Sleeptime, button returned:sleepstate} to (display dialog "Minutes before display sleep" & return & "Between 1 and 180 mintues" & return & "Greater than 180 means never sleep" default answer "1" buttons {"Cancel", "OK"} default button 2)
    set Sleeptime to Sleeptime as number
    if Sleeptime is less than 1 then
    set exitflag to false
    else if Sleeptime is greater than 180 then
    set Sleeptime to 0
    set exitflag to true
    else
    set exitflag to true
    end if
    end repeat
    end try
    set Sleeptime1 to Sleeptime as string
    set Sleeptime1 to quoted form of Sleeptime1
    set psswd to quoted form of "XXXXX"
    do shell script "sudo pmset -a displaysleep " & Sleeptime1 password psswd
    set pete to do shell script "sudo pmset -g"
    set xx to text -2 thru -1 of pete
    if xx - Sleeptime = 0 then
    tell application "SEC Helper"
    show screen message "Worked:" & return & xx & " mintues"
    end tell
    else
    tell application "SEC Helper"
    show screen message "Failed!"
    end tell
    end if

    1) don't use 'sudo' in a 'do shell script'. It isn't necessary and will sometimes break.
    2) do not use 'sudo' in a 'do shell script'
    3) do not use... I'm sure you get the idea.
    It is not necessary to use 'sudo' in a 'do shell script' command. 'do shell script' itself takes care of the authentication element when you use 'with administrator privileges'. Therefore the appropriate way of doing this is:
    <pre class=command>do shell script "pmset -g displaysleep " & sleeptime1 with administrator privileges password psswd</pre>
    If you omit the 'password psswd' element the user will be prompted to authenticate using the standard system authentication dialog.
    The problem you're running into is that the 'password' parameter is only valid when you use 'with adminitrator privileges', and is therefore getting ignored in your current script.

  • My cold backup shell script not working

    I have written a shell script for cold backup but. It says that line 42 has unexpected syntex error '{' and line 57 unexpected end of file. Please help
    BKUP_DIR=/u03/backups/abu/nightly_backup
    LOG_FILE=/u03/backups/abu/backup.log
    ORACLE_HOME= /u01/app/oracle/product/10.2; export ORACLE_HOME
    ORACLE_SID=SEED; export ORACLE_SID
    PATH="$PATH:$ORACLE_HOME/bin";export PATH
    # Execute the backup procedure
    echo ymd=`date +%Y%m%d` >> $LOG_FILE
    echo "Database BACKUP starting." >> $LOG_FILE
    ORACLE_HOME=/u01/app/oracle/product/10.2; export ORACLE_HOME
    ORACLE_SID=SEED; export ORACLE_SID
    PATH="$PATH:$ORACLE_HOME/bin";export PATH
    rman target=/ << EOF
    shutdown immediate
    EOF
    if [ $? -eq 0 ]
    then
    mkdir -p ${BKUP_DIR} # make directory
    echo "Database shut down.">> $LOG_FILE
    else echo "not shutdown".>> $LOG_FILE
    fi
    if [ ! -d ${BKUP_DIR} ]
    then
    echo "Not a directory: ${BKUP_DIR}">> $LOG_FILE
    exit 1
    fi
    echo "Previous Backup is being removed." >> $LOG_FILE
    rm ${BKUP_DIR}/${ymd-${seed}.gz >>$LOG_FILE
    echo "Cold backup being performed." >> $LOG_FILE
    cp /u01/app/oracle/admin/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz #copying database files into new dir
    cp /u02/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
    cp /u03/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
    echo "Cold backup of archive logs being performed." >> $LOG_FILE
    mv /u01/app/oracle/product/10.2/dbs/arch/* ${BKUP_DIR}/$ymd-${cmsv}.gz
    gzip ${BKUP_DIR}/$ymd-${cmsv}
    echo "Restarting Database" >> $LOG_FILE
    rman target=/ << EOF
    startup
    EOF
    else
    echo "Database will NOT start up." >> $LOG_FILE
    fi
    echo 'ymd='date +%Y%m%d' >> $LOG_FILE
    echo "Database BACKUP has completed." >> $LOG_FILE
    exit

    I trying to write that script for our new production database. My script will create a folder automatically and will copy all database files into the folder. Now my script dont copy the files into the direcory that automatically create. I want my directory name with timestamp that i already speciy in my code. The scripts now generate an error that now such files or directory. I mean when it tries to copy files from source to destination folder. Please give me some suggestions.
    if [ $? -eq 0 ]
    then
    mkdir -p ${BKUP_DIR} # make directory
    echo "Database shut down.">> $LOG_FILE
    else echo "not shutdown".>> $LOG_FILE
    fi
    if [ ! -d ${BKUP_DIR} ]
    then
    echo "Not a directory: ${BKUP_DIR}">> $LOG_FILE
    exit 1
    fi
    echo "Previous Backup is being removed." >> $LOG_FILE
    rm ${BKUP_DIR}/${ymd-${seed}.gz >>$LOG_FILE
    echo "Cold backup being performed." >> $LOG_FILE
    cp /u01/app/oracle/admin/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz #copying database files into new dir
    cp /u02/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gz
    cp /u03/oradata/SEED/* ${BKUP_DIR}/$ymd-${cmsv}.gzecho "Cold backup of archive logs being performed." >> $LOG_FILE

  • Process Flow - User Defined object calling Unix Shell script not working

    Hi, I have a User Defined Object in a Process Flow with the following parameters :-
    Command: /usr/bin/ksh
    Parameter List:
    Result Code:
    Script: cd /shell_scripts
    ./dwh_get_datafile.sh param1 param2 param3
    Success Threshold: 0
    The script executes but it does not correctly interpret all the Unix commands within it e.g command such as FTP, DATE, GREP etc.
    In the job details I can see :-
    ./dwh_get_datafile.sh: date: not found
    ./dwh_get_datafile.sh: ftp: not found
    ./dwh_get_datafile.sh: grep: not found
    ./dwh_get_datafile.sh: rm: not found
    ./dwh_get_datafile.sh: ls: not found
    ./dwh_get_datafile.sh: awk: not found
    Anyone know what I have done wrong ?
    The script runs fine when run as a Unix script while logged into Telnet.
    Thanks.
    Paul

    The shell script is executed by the oracle user in the unix environment so make sure that the directorie where you can find the unix commands exists in the path for the oracle user in .profile as you can se in my example below.
    PATH=$PATH:$ORACLE_HOME/bin:$OWBHOME/bin:/ASW/ora_script:/local/bstat:/usr/bin:/opt/bin:/usr/local/bin; export PATH
    /JZ

  • I have a macbook pro from 2006, my internal cd drive is not working and i'm trying to install factory definitions from an external cd drive. the problem is that when i press c nothing happens only appears an interrogation folder.

    i have a macbook pro from 2006, my internal cd drive is not working and i'm trying to install factory definitions from an external cd drive. the problem is that when i press c nothing happens only appears an interrogation folder. or sometimes appears the apple logo and than back again to the interrogation folder... Help please!!!!

    mcbsousa wrote:
    hm... Is there any chance of making the bootable usb file and send it by dropbox or something like that? than put it in a pen drive and connect to the mac??
    Sending by Dropbox where, To who, to what computer? As your does not start up.
    You need to take at least the OS disc to a work Mac computer and create DMG from the OS install disc then restore that DMG to USB thumb drive. Then you can boot the computer from that thumb drive and install the OS. That is if your hard drive is functioning correctly.
    Then you can use the App disc in the external CD/DVD drive to load up all the included Applications that come with your version of OS X.

  • The wi-fi on my ipod touch is connected but the internett is not working! Help

    Soo annoying, it's connected but the internett is not working. I don't know what to type in or what to do, so I need help.

    Are you 100% positive you are connected?  Head to Settings - Wi-Fi and tap the > next to the network you are connected to?  What is listed for an IP address?  If it's in the 169.x.x.x range, it means your iPod did not properly receive a valid IP address via DHCP from your modem/router. So the 169.x.x.x address is a self-assigned one.
    This can usually be resolved by a reboot of your router.  You can do this by unplugging it for about 30 seconds.  After it powers back up, try reconnecting it.  It wouldn't hurt to try a reset of your iPod as well.  To do this, press and hold both the Sleep/Wake and Home buttons together long enough for the Apple logo to appear.
    See here for more troubleshooting suggestions.
    iOS: Troubleshooting Wi-Fi networks and connections
    B-rock

  • How to retrive ip address of connected device in shell script or applescript

    Hi all,
    From Mac PC, how to get ip address of connected device in shell script or applescript.
    there is any way to launch an app on ipad in shell script or applescript.
    thank you in advance for your help
    Mickael

    Hi all,
    From Mac PC, how to get ip address of connected device in shell script or applescript.
    there is any way to launch an app on ipad in shell script or applescript.
    thank you in advance for your help
    Mickael

  • I get wireless connection but my internet does not work on my ipad 2

    I get wireless connection but my internet does not work on my ipad 2

    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are droping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    iOS 6 Wifi Problems/Fixes
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • How can I make sure an url to connect to a webinar will not work in another browser?

    How can I make sure an url to connect to a webinar will not work in another browser? The url is using a session cookie instead of username/password to authenticate the user and has the following form: /r5ygd62w5za/?session=breezrek22zu756wgzy8r&launcher=false&refresh_parent=true

    Try the [https://addons.mozilla.org/en-US/firefox/addon/2592/ NoSquint] add-on, it gives greater control over the zoom options.

  • How can I get my iPhone to show up on the panel to the right iTunes? I keep connecting it but it does not work.

    How can I get my iPhone to show up on the panel to the right iTunes? I keep connecting it but it does not work.

    http://support.apple.com/kb/TS1538

  • Hi, i am not able to connect to the internet. wifi not working.

    hi, i am not able to connect to the internet. wifi not working. not able to find proper drivers for 32 bit win.7 os. need urgent help..
    This question was solved.
    View Solution.

    Hi:
    I can give you the link to the wifi driver, if you do the following steps to post the hardware ID for the wireless card, so I can figure out what model wireless card the notebook has...
    To find the hardware ID, go to the device manager and click on the device labeled Network Controller.
    Then click on the Details tab at the top of the Network Controller window.
    Now you see a Property drop down list and it is defaulted to Device Description.
    Drop down on that list and select the second item (Hardware ID's).
    Post the top string of characters you see in the window.

  • Modify shell script to work with other folders

    i am trying to modify a shell script that sorts files in a course folder into sub folders by month. I have a shell script that works, but when i try to modify it for another course folder it quits working. can someone let me know what i am doing wrong?
    the working shell script:
    do shell script "
    for f in \"$HOME/Desktop/DWI Annual Report/\"*
    do if [ ! -d \"$f\" ]; then
    x=\"${f%%.*}\"
    i=$((${#x}-3))
    if [ -d \"$HOME/Desktop/DWI monthly/${f:$i:3}\" ]; then
    mv \"$f\" \"$HOME/Desktop/DWI monthly/${f:$i:3}\"
    fi
    fi
    done"
    the nonworking modified script:
    do shell script "
    for f in \"$HOME/Desktop/DOEP Annual Report/\"*
    do
        if [ ! -d \"$f\" ]; then
            x=\"${f%%.*}\"
            i=$((${#x}-3))
            if [  -d \"$HOME/Desktop/DOEP monthly/${f:$i:3}\" ]; then
                mv \"$f\" \"$HOME/Desktop/DOEP monthly/${f:$i:3}\"
            fi
        fi
    done"

    ok here is the applescript that works.
    property total_student : 1
    tell application "Finder"
      set master_path to alias "Users:macbook:Desktop:DWI Annual Report:Annual Report.xlsx"
      set filesWithDWI to get every file of folder ((path to desktop folder) & "DWI Annual Report" as string) whose name contains "DWI"
      repeat with f in filesWithDWI
      my transfer_data(f, master_path)
      end repeat
    end tell
    on transfer_data(child_path, master_path)
      tell application "Microsoft Excel"
      set child_book to (open workbook workbook file name (child_path as string))
      set child_doc to worksheet 1 of child_book
      set master to worksheet "sheet 1" of (open workbook workbook file name (master_path as string))
      set num to 15 --All lists start at index 12 or later, I'm putting 10 to be safe
      set students to {}
      tell child_doc --grab values from child document
      repeat until (value of cell (("A" & num) as string)) is 1
      set num to num + 1
      end repeat
      repeat until (value of cell (("B" & num) as string)) is ""
      set end of students to {namevalue of cell (("B" & num) as string)), driver_idvalue of cell (("C" & num) as string)), DOBvalue of cell (("D" & num) as string)), Ref_Recvalue of cell (("I" & num) as string)), pre_testvalue of cell (("J" & num) as string)), post_testvalue of cell (("K" & num) as string)), cert_idvalue of cell (("L" & num) as string))}
    set num to num + 1
      end repeat
      set startdate to range "C7"
      set classlocation to range "C11"
      set instructor to range "H7"
      end tell
      tell master
      set num to 7
      log (value of cell (("B" & num) as string))
      repeat until (value of cell (("B" & num) as string)) is ""
      set num to num + 1
      end repeat
      repeat with student in students
      set value of cell (("A" & num) as string) to total_student
      set value of cell (("B" & num) as string) to name of student
      set value of cell (("C" & num) as string) to driver_id of student
      set value of cell (("D" & num) as string) to DOB of student
      set value of cell (("H" & num) as string) to pre_test of student
      set value of cell (("I" & num) as string) to post_test of student
      set value of cell (("J" & num) as string) to cert_id of student
      set value of cell (("f" & num) as string) to startdate
      set value of cell (("E" & num) as string) to classlocation
      set value of cell (("G" & num) as string) to instructor
      set value of cell (("K" & num) as string) to Ref_Rec of student
      set num to num + 1
      set total_student to total_student + 1
      end repeat
      end tell
      save child_book
      close child_book
      save active workbook in master_path
      close active workbook
      end tell
    end transfer_data
    do shell script "
    for f in \"$HOME/Desktop/DWI Annual Report/\"*
    do
        if [ ! -d \"$f\" ]; then
            x=\"${f%%.*}\"
            i=$((${#x}-3))
            if [  -d \"$HOME/Desktop/DWI monthly/${f:$i:3}\" ]; then
                mv \"$f\" \"$HOME/Desktop/DWI monthly/${f:$i:3}\"
            fi
        fi
    done"
    It takes the class rosters and copies the information from the class roster to the annual report and then moves the file to the monthly  folder and files it in the appropriate months folder based on the last three letters of the file name.

  • BI Admin Tool - Setting connection pool via shell script - Is it possible?

    Hi,
    Here's the problem I am trying to solve.
    I am using a J2EE application that uses OBIEE for reporting.
    The *.rpd file is installed at a particular location when our J2EE product is installed.
    I then copy the *.rpd file to the BI home on a different server using a shell script.
    The shell script that deploys the *.rpd file does the following:
    1. Shuts down BI processes that are running
    2. Deletes the old *.rpd file
    3. Copies the new *.rpd file
    4. Starts all BI processes
    I am happy with the way we have automated this process, but would like to take it one step further.
    The *.rpd file does not have the connection pool hard-coded in it. And we want to keep it that way.
    What we would like to do is - pass the connection pool parameters to the shell script (that is used for *.rpd's deployment) and have it automatically update the *.rpd file. Is it possible to do this at all? How do we go about accomplishing this?
    Or in other words - Is there a way to update the connection pools WITHOUT hard-coding it in the *.rpd file or WITHOUT using the BI Administration Tool.
    Currently, we manually update the connection pools in the Physical Layer using the Oracle BI Administration Tool.
    The version of BI Administration Tool being used is 10.1.3.3.1 installed on a Microsoft Windows XP Professional SP2 machine. The BI Server itself is running on an Oracle Enterprise Linux 4.0 box.
    Do let me know if you need more information that would help answer this question.
    Thank you.

    Thank you - fiston and Gagan.
    I am going with fiston's solution - since it is easier to implement. I am on the QA team and the automated deployment is to lessen QA's deployment time.
    While one of our developer's said that she prefer's Gagan's solution - it would be over-kill to make changes to the application's schema for the said purpose.
    I will further make another post as to whether or not the automated deployment worked for us.

  • Powershell unzip with shell.application not working when launched from windows service

    I have a deployment agent on a machine implemented as a windows service. Service is 32-bit and runs on windows server 2008R2 x64 SP1 with powershell V2. Powershell script requires elevation and to run under x64 because of dependency to powershell module
    'IIS Administration'. To achieve this, the service starts a cmd file which in turn launches powershell x64 console:
    C:\WINDOWS\sysnative\WindowsPowerShell\v1.0\powershell.exe "Start-Process C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell -ArgumentList '-ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File C:\Temp\EndJobCmd\Install.ps1' -Verb RunAs"
    This seems to work well. The problem I have is that the script has a sequence where it unpacks a zip file to a destination folder using shell.application, this works fine when triggered manually on the server or through the task scheduler, but when triggered
    from the service it does not extract any files at all (cannot see any errors thrown by the script but it seems to continue to execute as it logs a successful message to the event log after finishing).
    Unzip sequence looks like:
    $shell = New-Object -com shell.application
    $pkg = $shell.namespace($sourceFile)
    $installDir = $shell.namespace($targetDir)
    $installDir.Copyhere($pkg.items(), 20)
    Any advice greatly appreciated. I have searched some and seen a few people with similar issue but have yet to find a solution.

    If it's still actual, I managed to fix this with having CopyHere params equal 1564. 
    So in my case extract zip function looks like:
    function Expand-ZIPFile{
    param(
    $file, $destination
    $shell = new-object -com shell.application
    $zip = $shell.NameSpace($file)
    foreach($item in $zip.items())
    $shell.Namespace($destination).copyhere($item,1564)
    "$($item.path) extracted"
    1564 description can be found here - http://msdn.microsoft.com/en-us/library/windows/desktop/bb787866(v=vs.85).aspx:
    (4) Do not display a progress dialog box.
    (8) Give the file being operated on a new name in a move, copy, or rename operation if a file with the target name already exists.
    (16) Respond with "Yes to All" for any dialog box that is displayed.
    (512) Do not confirm the creation of a new directory if the operation requires one to be created.
    (1024) Do not display a user interface if an error occurs.

Maybe you are looking for