Another powershell workflow script will run in powershell ISE but no powershell command prompt.

Hi,
Im having some issue with a few powershell workflow scripts that will work in powershell ISE but they will appear to not run in a Admin powershell command prompt session.
The script is simple.
Workflow NewUser
    Param (
            [Parameter(Mandatory=$True)]
            [string] $givenname,
            [Parameter(Mandatory=$True)]
            [string] $surname,
            [Parameter(Mandatory=$True)]    
            [string] $template
    "Param1 = $givenname"
    "Param2 = $surname"
    "Param3 = $template"
The saved file name is NewUser.ps1.
When I run .\NewUser.ps1 -givenname test -surname test -template test
Nothing happens.   In Powershell ISE, it outputs
Param1 = test
Param2 = test
Template = test
I can run .\NewUser.ps1 skdjfsdkfjsdkfjsdkfj in powershell command
and nothing happens.
I notice this behavior with a number of scripts that I get working with ISE and they dont work in powershell command prompt. 
We are using Powershell 4.0
Thanks Lance

When I run
Set-psdebug -step
then newuser.ps1 -givename test -surname test -template test
it gets to the line workflow newuser and quits
am I missing some dependency?
Running  [System.Threading.Thread]::GetDomain().GetAssemblies() in powershell commmand returns the following.
GAC    Version        Location                                                                                       
True   v4.0.30319     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll                                   
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.ConsoleHost\v4.0_3.0.0.0__31bf...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll      
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.C...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\Syst...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xm...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.DirectoryServices\v4.0_4.0.0.0__b03f5f7f11d5...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Management\v4.0_4.0.0.0__b03f5f7f11d50a3a\Sy...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Management.Infrastructure\v4.0_1.0.0.0__3...
False  v4.0.30319                                                                                                    
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration.Install\v4.0_4.0.0.0__b03f5f7f...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\Sy...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Security\v4.0_3.0.0.0__31bf385...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Activities\v4.0_3.0.0.0__31bf3...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\Sy...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Workflow.ServiceCore\v4.0_3.0....
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities.Presentation\v4.0_4.0.0.0__31bf38...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e3...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsB...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\Prese...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.X...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Core.Activities\v4.0_3.0.0.0__...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Diagnostics.Activities\v4.0_3....
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Management.Activities\v4.0_3.0...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Security.Activities\v4.0_3.0.0...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Utility.Activities\v4.0_3.0.0....
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.WSMan.Management.Activities\v4.0_3.0.0.0_...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.DurableInstancing\v4.0_4.0.0.0__31bf...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Internals\v4.0_4.0.0.0__31bf385...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Dat...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Utility\v4.0_3.0.0.0_...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\Syst...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Mic...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Management\v4.0_3.0.0...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Dynamic\v4.0_4.0.0.0__b03f5f7f11d50a3a\Syste...
and for the ISE it returns this 
GAC    Version        Location                                                                                                     
True   v4.0.30319     C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll                                                 
False  v4.0.30319     C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe                                                
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.ISECommon\v4.0_3.0.0.0__31bf3856ad364e35\Mic...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll                    
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Window...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll    
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\Syste...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll          
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.GPowerShell\v4.0_3.0.0.0__31bf3856ad364e35\M...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.Composition\v4.0_4.0.0.0__b77a5c561934e089\...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Editor\v4.0_3.0.0.0__31bf3856ad364e35\Micros...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\Presentation...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll          
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll  
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll          
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Config...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll            
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\Syste...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationProvider\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationP...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll      
False  v4.0.30319                                                                                                                  
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.DirectoryServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Di...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Management\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Managemen...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.Management.Infrastructure\v4.0_1.0.0.0__31bf3856ad364e3...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll  
False  v4.0.30319                                                                                                                  
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.AeroLite\v4.0_4.0.0.0__31bf3856ad364e35\Pre...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\UIAutomationTypes\v4.0_4.0.0.0__31bf3856ad364e35\UIAutomationType...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\Pr...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration.Install\v4.0_4.0.0.0__b03f5f7f11d50a3a\Syste...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transacti...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Security\v4.0_3.0.0.0__31bf3856ad364e35\Micr...
False  v4.0.30319                                                                                                                  
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.GraphicalHost\v4.0_3.0.0.0__31bf3856ad364e35...
False  v4.0.30319                                                                                                                  
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemCore\v4.0_4.0.0.0__b77a5c561934e089\P...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll            
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Utility\v4.0_3.0.0.0__31bf3856ad364...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemData\v4.0_4.0.0.0__b77a5c561934e089\P...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Commands.Management\v4.0_3.0.0.0__31bf3856ad...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceProcess\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Servi...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Activities\v4.0_3.0.0.0__31bf3856ad364e35\Mi...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activitie...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Workflow.ServiceCore\v4.0_3.0.0.0__31bf3856a...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities.Presentation\v4.0_4.0.0.0__31bf3856ad364e35\Sys...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Core.Activities\v4.0_3.0.0.0__31bf3856ad364e...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Diagnostics.Activities\v4.0_3.0.0.0__31bf385...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Management.Activities\v4.0_3.0.0.0__31bf3856...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Security.Activities\v4.0_3.0.0.0__31bf3856ad...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.PowerShell.Utility.Activities\v4.0_3.0.0.0__31bf3856ad3...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.WSMan.Management.Activities\v4.0_3.0.0.0__31bf3856ad364...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.DurableInstancing\v4.0_4.0.0.0__31bf3856ad364e35\S...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Internals\v4.0_4.0.0.0__31bf3856ad364e35\Syst...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll  
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e08...
True   v4.0.30319     C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Dynamic\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Dynamic.dll    
Thanks Lance

Similar Messages

  • Powershell script sends e-mail in ISE but not from powershell command line

    I have created a script that generates a report of all users who do not have photos in Active Directory. The script runs and sends an e-mail to a distribution list. It runs fine in ISE, but I cannot run it from command line or as a scheduled task. Any suggestions
    what I am doing wrong?
    #Starts Powershell Snap-In
    Start-Transcript -path c:\Scripts\StaffWithoutPhotos.txt
    add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010 -erroraction silentlyContinue
    $mailboxes = $null
    $mailboxes = @(Get-Mailbox -OrganizationalUnit "Staff User Accounts" -ResultSize Unlimited | Where {$_.HasPicture -eq $False})
    Write-Host $mailboxes
    $report = @()
    foreach ($mailbox in $mailboxes)
    $mbObj = New-Object PSObject
        $mbObj | Add-Member -MemberType NoteProperty -Name "Display Name" -Value $mailbox.DisplayName
        $report += $mbObj
    Write-Host "Diagnostic Output"
    Write-Host "Before Mailbox value check"
    Write-Host $report
    Write-Host "After Mailbox Value check"
    if ($mailboxes -ne $null)
        Write-Host $report
        #Send the report generated to the e-mail list specified above
        $style = "<style>BODY{font-family: Arial; font-size: 10pt;}"
        $style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
        $style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"
        $style = $style + "TD{border: 1px solid black; padding: 5px; }"
        $style = $style + "</style>"
        #Start-Sleep -Seconds 5
        $smtpserver = "MAIL.contoso.com"
        $msg = new-object Net.Mail.MailMessage
        $smtp = new-object Net.Mail.SmtpClient($smtpServer)
        $msg.From = "[email protected]"
        $msg.To.Add("[email protected]")
        #$msg.To.Add("[email protected]") #Used for testing
        $msg.Subject = "Staff without Photos report"
        $msg.Body = "This report contains the list of users who do not currently have photos."
        $msg.Body += "<p>"
        $msg.Body += "After photos are available for these users please submit a request to have their accounts updated or send an e-mail to <a href='mailto:[email protected]?Subject=Staff%20Photo%20Updates' target='_top'> [email protected]
    </a> with <b>Staff Photo Updates</b> in the subject."
        $msg.Body += "<p>"
        $msg.Body += "This report runs on Fridays and will only send a message if we have Staff without Photos. For more information please contact your systems administrator."
        $msg.Body += "<p>"
        $msg.Body += $Report | ConvertTo-Html -Head $Style
        $msg.IsBodyHTML = $true
        $smtp.Send($msg)
    Stop-Transcript

    So after researching further and not receiving any more replies I decided to rewrite the script and attempt to use the send-mailmessage function. I have been unable to determine the reason for the original not script not working. We use a very similar script
    to my original code which works to generate a report and e-mail that report as an attachment and it works without any problems.
    After re-writing the script and using the send-mailmessage function I was able to get this report to work as expected. This has now been set up as a scheduled task to run on a server once a week. Here is the final code:
    Start-Transcript -path c:\Scripts\StaffWithoutPhotos.txt
    #Starts Powershell Snap-In
    add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010 -erroraction silentlyContinue
    $mailboxes = $null
    $mailboxes = @(Get-Mailbox -OrganizationalUnit "contoso Staff User Accounts" -ResultSize Unlimited | Where {$_.HasPicture -eq $False})
    Write-Host $mailboxes
    $report = @()
    foreach ($mailbox in $mailboxes)
    $mbObj = New-Object PSObject
        $mbObj | Add-Member -MemberType NoteProperty -Name "Display Name" -Value $mailbox.DisplayName
        $report += $mbObj
    Write-Host "Diagnostic Output"
    Write-Host "Before Mailbox value check"
    Write-Host $report
    Write-Host "After Mailbox Value check"
    if ($mailboxes -ne $null)
        Write-Host $report
        #Send the report generated to the e-mail list specified above
        $style = "<style>BODY{font-family: Arial; font-size: 10pt;}"
        $style = $style + "TABLE{border: 1px solid black; border-collapse: collapse;}"
        $style = $style + "TH{border: 1px solid black; background: #dddddd; padding: 5px; }"
        $style = $style + "TD{border: 1px solid black; padding: 5px; }"
        $style = $style + "</style>"
        $smtpserver = "MAIL.contoso.com"
        $smtpFrom = "[email protected]"
        $smtpTo = "[email protected]
        $messageSubject = "Staff without Photos report"
        $Body = "This report contains the list of users who do not currently have photos."
        $Body += "<p>"
        $Body += "After photos are available for these users please submit a request to the Help Desk to have their accounts updated or send an e-mail to <a href='mailto:[email protected]?Subject=Staff%20Photo%20Updates' target='_top'> [email protected]
    </a> with <b><u>Staff Photo Updates</b></u> in the subject."
        $Body += "<p>"
        $Body += "This report runs on Fridays and will only send a message if we have Staff without Photos. For more information please contact your systems administrator."
        $Body += "<p>"
        $Body += $Report | ConvertTo-Html -Head $Style
        #Send the report
        send-mailmessage -from "$smtpFrom" -to "$smtpTo" -subject "$messageSubject" -body "$Body" -smtpServer "$smtpserver" -BodyAsHtml
    Stop-Transcript

  • [svn:fx-4.x] 14731: change the line ending to LF so this script will run properly on Mac and Unix .

    Revision: 14731
    Revision: 14731
    Author:   [email protected]
    Date:     2010-03-12 11:06:04 -0800 (Fri, 12 Mar 2010)
    Log Message:
    change the line ending to LF so this script will run properly on Mac and Unix.  Some testsuites were breaking because this script was not executing properly on mac
    QE notes: fix for testsuites
    Doc notes: no
    Bugs: no
    Reviewer: no
    Tests run: no
    Is noteworthy for integration: no
    Modified Paths:
        flex/sdk/branches/4.x/bin/fontswf

    On reflection, it seems much easier/safer to do something like this instead...
    When running in Arch, but viewing a partition with another installation's data on it, do directory listings like this:
    ls -l | FILTER
    where FILTER is a script that pulls out the Arch-announced users and groups, converts them to numeric if necessary (according to Arch's understanding), and then stuffs back in what the other installation thinks are the symbols corresponding to those numbers. This was easy enough to do, and doesn't risk breaking anything.
    Marking as SOLVED, but I'd still welcome feedback about the different ways different distributions understand the groups I cited. It's very hard to track this info down.

  • Scheduled Task will run on Windows 7, but will not run on Server 2008 R2

    So I have a scheduled task that uses nircmd to take a screenshot and then email it to a few company emails each night.  With our old Exchange 2003 server, everything works prefectly on the 2008 R2 server (using SMTP).  But since we upgraded to
    Exchange 2010 it no longer seems to work (at least it never sends the email anymore).
    What confuses me more is that this exact task (I exported it) runs perfectly fine on a Windows 7 Pro computer, even using the new Exchange 2010 SMTP address.
    Both machines are logged in as the same user.  I can even login as the domain administrator on each machine and still have the same issue.  Only the Windows 7 Pro machine will successful run the task.  To restate it, the Server 2008 R2 server
    will run the task successfully if I use the old Exchange 2003 SMTP address.
    Thanks for any advice!

    Hi joshz451z,
    Would you please let us know current situation of this issue? Did you refer to Dave's suggestion and check that relevant logs? If any update, please feel free to let us know.
    Best regards,
    Justin Gu
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Is it possible to run a java program without using the command prompt?

    Hi,
    I was wondering whether it is possible to run a Java program (not an applet) without using a command line in the command prompt?
    Basically I want to run a program that will be continually running in the background and hence I don't want to have a command prompt screen loaded up as well - I just want the program to be running in the task bar.
    I know how to run the program in the task bar - but I still need to launch the program from the command prompt - is there anyway I can get a program running without having to start it from the command prompt?
    Cheers

    Or create a desktop shortcut (in Windows) or an application launcher ( in Linux GUI).

  • Will launch in Eclipse, won't launch from command prompt

    I've got a project that works in Eclipse, but won't run from the command line prompt.
    The command line command that I'm using is this...
    java -cp /users/shared/RainfallSeriesTranslator/bin ui/LauncherThe error I get is this...
    Exception in thread "main" java.lang.ExceptionInInitializerError
    Caused by: java.lang.NullPointerException
         at ui.Launcher.getMethods(Launcher.java:37)
         at ui.Launcher.<clinit>(Launcher.java:15)and the class is this...
    import java.io.File;
    import java.io.FilenameFilter;
    import java.util.ArrayList;
    public class Launcher {
         private final static String name = "RainfallSeriesTranslatorPanel";
         private final static String[] methods = getMethods();
         private final static String fileExt = ".class";
         public static void main(String[] args) {
              new Panel(name, methods);
         public static String[] getMethods() {
              String workingDirectory = System.getProperty("user.dir");
              String fileSeparator = System.getProperty("file.separator");
              String methodDirectory = workingDirectory + fileSeparator + "bin" + fileSeparator + "methods";
              File dir = new File(methodDirectory);
              ArrayList <String> methodsAL = new ArrayList<String>();
              FilenameFilter filter = new FilenameFilter() {
                      public boolean accept(File dir, String name) {
                          return name.endsWith(fileExt);
              String []contents = dir.list(filter);
              for (int i = 0; i < contents.length; i++){
                   methodsAL.add(contents.replace(fileExt, ""));
              return methodsAL.toArray(new String[methodsAL.size()]);
         public String getPanelName() {
              return name;
         public String getFileExtensionName() {
              return fileExt;
    }BTW the purpose of getMethods is to dynamically list out the classes (files) in the directory 'methods', and to load the names into an array which is passed to a JComboBox in the Panel.  My intention is to permit users to select which method to use for the next step of the analysis.  If there's a better way to do it, I'd like to know.
    Having played around with the code, I can get it to run if I 'hardwire' the methodsAL arraylist to ...          methodsAL.add("Some method");...but that defeats the purpose of reading in the classnames dynamically.
    So, the nullpointerexception seems to do with the array 'contents' not getting populated, but I can't figure out why.  As I noted above, it works in Eclipse, so why doesn't it work from the command prompt?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Martin_J wrote:
    Sorry, I had cut out some comment lines at the top.
    Line 37 is the line
    for (int i = 0; i < contents.length; i++){So it looks like the nullpointerexception is generated because the array 'contents' has a null (zero?) length.
    On reflection, is this to do with the working directory? You will note that I have prepended the 'methods' directory with the working directory path. I'm thinking that this would work in Eclipse because the working directory is something, but it does not work when I execute from the command prompt because the working directory is something else.
    If this is the case, then what is the best way to find a directory at a relative location to a class?You get that error because the directory doesn't exist at the given location (the bin folder I guess). dir.list() returns null.
    Kaj

  • Run multiple SQL*Loader control files from command prompt

    I have written control files for 15 different tables with specific data files for each table. I have build the control files using toad for each one of them at once. Now I want to run the sql loader for all the tables one time. I know I cannot run multiple files from toad and not sure If I can run from the command prompt.
    Please let me know If I can.

    skvaish1 wrote:
    Hi,
    On unix you can create a script to runn all sqlldr at once like as followes.
    1. Create a script load_sqlldr.sh with following content.
    export ORACLE_SID=<YOUR DB_SID>
    export ORACLE_HOME=<Your Oracle Home>
    export PATH=$ORACLE_HOME/bin:$PATH
    sqlldr (Full command with parameter for 1st table) &
    sqlldr (Full command with parameter for 2nd table) &
    sqlldr (Full command with parameter for 3rd table) &
    sqlldr (Full command with parameter for 4th table) &
    sqlldr (Full command with parameter for 15th table) &
    2. Then execute the script.
    Regards1. Can I also write script load_sqlldr.sh with following content
    sqlldr user/psswd@db_name control=controlfile1.ctl
    sqlldr user/psswd@db_name control=controlfile2.ctl
    sqlldr user/psswd@db_name control=controlfile3.ctl
    sqlldr user/psswd@db_name control=controlfile15.ctl
    2. Then execute the script.

  • Script to run a DB query, but have multiple DB servers (for failover) I want to loop through until I find one that is available

    Conceptually I'm not sure the best way to go about this, looking for some guidance.  I'm running a MySQL query and I have the code working against a single MySQL server.  However I want to build some redundancy into the code so if it tries one
    DB and it's not available, it tries the next one.  I have come up with two ways to do this.
    First one is basically an If statement looking at error[0] as a condition.  Tries to connect to the first server and if throws an error, it tries the second and if that fails it exits the code.  This is less scalable as I have to code in connection
    strings for each server.
    Second one is a loop that goes through connection to each DB server I setup in an array until the connection.state = "open", then it should proceed to the rest of the code.
    Foreach ($MySQLHost in $SQLHostArray) {
    $error.clear()
    $ConnectionString = "server=" + $MySQLHost + ";port=3306;uid=" + $MySQLAdminUserName + ";pwd=" + $MySQLAdminPassword + ";database="+$MySQLDatabase
    $Connection.ConnectionString = $ConnectionString
    do {$connection.open()}
    until ( $Connection.state -eq "open" )
    However I don't know how to exit that loop if all servers fail. 
    Which is the best bet for building failover into the script, or is there a better way I haven't thought of yet?

    You could use a counter - 
    $lexit = 0
    $count = ($SQLHostArray.count -1)
    Foreach ($MySQLHost in $SQLHostArray) {
    $lexit++
    $error.clear()
    $ConnectionString = "server=" + $MySQLHost + ";port=3306;uid=" + $MySQLAdminUserName + ";pwd=" + $MySQLAdminPassword + ";database="+$MySQLDatabase
    $Connection.ConnectionString = $ConnectionString
    do {$connection.open()}
    until ( $Connection.state -eq "open" -or $lexit -eq $count)

  • How to run a Powershell workflow with WinPE 5.0?

    I have a powershell workflow script to validate a tool. It worked well with Windows 8.1 system. As the tool can be used with both Win8.1 and WinPE 5.0 environment, I would like the workflow script to run with WinPE environment to make sure
    the tool works well.  I created a WinPE UFD with Powershell module and the workflow script and the tool. And I run it and got the error message below.  I guess powershell workflow is not supported in WinPE 5.0, am I right?
    X:\Windows\61ProductInformationWinPE>ProdInfoWTool.cmd
    ワークフローを作成できません。'PSWorkflow' モジュールの型 'Microsoft.PowerShell
    .Workflow.AstToWorkflowConverter, Microsoft.PowerShell.Activities, Version=3.0.
    0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' を読み込むことができませ
    んでした。
    発生場所 X:\Windows\61ProductInformationWinPE\ProdInfoWTool.ps1:1 文字:1
    + # Standard BIOS Product Information Writing Tool Support検証項目 スクリプト
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : OperationStopped: (:) [], NotSupportedException
        + FullyQualifiedErrorId : System.NotSupportedException

    Hi DN_KOno,
    Based on my research, there is a limited build-in powershell module and cmdlets in WinPE.
    We could find more details about what Optional components of Powershell under WinPe, please go through the below link:
    http://technet.microsoft.com/library/hh824926.aspx
    I hope this helps.

  • Report script will not finish

    We are running EAS report script via batch scripts using mxl. These report scripts have not changed and at the time of running, nothing else is runnign onthe server. The report scripts will run for about 10minutes (which nroamlly take about 15 to complete) and it stops and says "administrator has temporarily disables commands". we have ran the unlock utility and stopped and restarted the application and still face the same issue. No settings have been changed on the server and the same reports ranthis morning, yet error out this afternoon with no change. We are on 11.1.2 planning. Any ideas?

    kplum12 wrote:
    We are running EAS report script via batch scripts using mxl. These report scripts have not changed and at the time of running, nothing else is runnign onthe server. Did you checked the CPU memory usage while executing Report..?
    Is server busy with many connections (User sessions) ??
    (or)
    Did you feel slow when you are trying to retreive that time?
    Some times every thing works slow..like when we are trying to retreive the data it is processing forever..In that case,I have restarted my server and every thing works fine....
    Edited by: Prabhas on Aug 3, 2011 11:41 AM

  • Slow script when run as an application

    I have created a script for processing images with Photoshop. When I run the script from Script Editor it completes its task literally twice as fast as when I run it as an application. Does any one have an explanation as to why this would be the case?
    The script in summary asks the user for 2 folders, it then pairs up images from the folders, opens them both in Photoshop, copies the paths from one image to the other, crops the image and saves a copy in the appropriate place, then moves on to the next pair of images.
    I don't understand why it woud run twice as sluggishly as an application?
    Any suggestions much appreciated.

    Rien,
    I have also consistently seen the same problem, and asked a similar question a couple of years ago without a satisfactory response. If you write an AppleScript studio application your script will run at about the same speed as when running the script from script editor.
    To observe the problem you just need an application script that is communicating information back and forth betweent the script and the application it is driving, and then check out the performance difference between running it as an application or not. If you run Activity Monitor you can see that the cpu spends plenty of its time idle when running the script as an application.
    If you grab a copy of iMagine Photo from:
    http://www.yvs.eu.com/downloads/iMaginePhoto.dmg
    and get PhotoScript1 from about 1/2 down the following page:
    http://www.yvs.eu.com/documentation/readingandwritin.html
    Run the script from both within script editor and as the application droplet.
    It demonstrates the problem. But I have seen worse, this was just the first script on my website that I found that demonstrates the problem.
    Kevin

  • EBS Forms functional script runs fine in OpenScript but not from OTM

    Hi,
    I have an EBS forms functional test script which runs fine in OpenScript, but when scheduled from OTM, the web part runs fine but when it comes to forms, the script fails with the following error:
    Forms Object Not Found! XPath: //forms:window[(@name='NAVIGATOR')], Type: oracle.oats.scripting.modules.formsFT.helper.test.FormWindow, Cause: No Matches <Less>
    I have performed all the steps below already:
    1) Stopping the OATS Agent service and changing it to manual.
    2) Starting the command prompt and running the AgentManagerService command as mentioned in your forum.
    3) The console displays
    C:\>C:\OracleATS\agentmanager\bin\AgentManagerService.exe -c AgentManagerService
    .conf
    wrapper  | --> Wrapper Started as Console
    wrapper  | Launching a JVM...
    jvm 1    | Wrapper (Version 3.0.3)
    jvm 1    |
    4) I have added the test in the OTM with the following command line settings:
    -browser.type InternetExplorer -formsft.startup_timeout 30 -formsft.action_timeout 20 -formsft.response_timeout 10 -delayPercentage -1 -delayMin 0 -delayMax 5 -FormsAutomationEnabler.bat -enableForms true
    But each time the script fails, please note that my script has assets and they are placed within the script folder.
    Please help me on this at earliest.
    Thanks,
    Aarti

    Hello Aarti!
    I had the same problem and this steps help to solve the problem:
    You need to enable Forms Automation under agent. Please follow by below steps.
    1.open command prompt
    2.cd C:\OracleATS\agent
    3.FormsAutomationEnabler.bat -enableForms true
    4. Run script from OTM
    Attila

  • Running Java without Command prompt support

    Hi,
    Can I run my class file without showing the command prompt in background.
    I tried with javaw, but its not working. I have jdk1.5 installed.
    please help me

    Jar files (<wavey subliminal type effect>search button</wavey subliminal type effect>) are on most modern OSes double clickable.
    http://java.sun.com/docs/books/tutorial/jar/index.html

  • Unable to Configure a PowerShell Script to Run as a Scheduled Task

    Hi ,
    I have a powershell script from Dieters blog http://scug.be/dieter/2011/07/06/scom-2007-how-to-backup-your-unsealed-management-packs/#comment-1058 which backups the unsealed management packs in SCOM. I am able to run the script successfully in the powershell
    prompt but when i schedule it as a task it fails with an error code 1.
    "Task Scheduler successfully completed task "\Backup Unsealed Management Pack" , instance "{xxxxxxxxxxxxxxxxxxxxxxxxxxxx}" , action "Powershell.exe" with return
    code 1."
    I am running the task using the highest privilages and have tried bypassing the script using and have configured the script as per http://www.metalogix.com/help/Content%20Matrix%20Console/SharePoint%20Edition/002_HowTo/004_SharePointActions/012_SchedulingPowerShell.htm
    -ExecutionPolicy Bypass c:\scripts\myscript.ps1
    Still i am unable to run the task without errors. Kindly assist.
    Jesty

    Hi Jesty,
    Please make sure you have followed these steps to schedule a powershell script task:
    1.  Save the powershell script as .ps1 in local computer.
    2.  Right click the .ps1 file and run with powershell and check if the script can run successfully.
    3.  schedule task->action:Start a program->Program/script:powershell.exe->Add argument:-ExecutionPolicy Bypass c:\scripts\myscript.ps1
    Best Regards,
    Anna

  • Installer launching command prompt that should run a powershell script and remain open

    I am using the Microsoft Visual Studio Installer Projects extension for VS 2013. This installer is designed to place a windows app in a directory and then launch a powershell script to prompt the user to sideload the application. From what I read online,
    you can make a windows console application and then add that .exe under the install custom actions to have the exe run after the installation is done. My installer is running the executable, but not in the way I want it to. This is the code that the console
    application has:
    static void Main(string[] args)
    Process.Start(@"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe", @"-ExecutionPolicy bypass -NoExit -File Application\Add-AppDevPackage.ps1");
    One key thing to note here is the -NoExit. I want the prompt to remain open. If I run this console application directly, the powershell console does indeed stay open. You can see here where I have added the .exe as part of the install custom action.
    One additional thing to note is when I looked at the exe in the directory after the install, it is different than the one generated when I compile the console application project. I wouldn't know why the installer is physically changing the binary when I
    expect it to just copy the output from that compiled project/copy that file.
    If anyone has any additional input on how to make this process easier to have an installer (.msi) to place my windows app in a directory and run a powershell script to prompt the user to sideload it, then I welcome that too.

    Hello,
    I am afraid this issue is beyond the scope of our support.
    The current forum you posted to is used to discuss general issues about developing applications for Windows.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Purchase order reprints when entering header note in change mode

    Hi All, We want to use header note in PO as a worklog. PO should not print when a note is entered but whenever we enter any text in the header note in PO change mode, a change output gets triggered and the PO is getting printed. How can we avoid this

  • Import failed with canon 6d footage after latest update

    After I updated to Final Cut X 10.0.8, I've been getting "Import Failed" messages during the import process when taking in footage from my Canon 6D The import process also seems to be going very slow (slower than usual) I've tried duplicating the SD

  • AWTimage error when using getImage() through https

    I am trying to display an image on an applet but I am getting an awtimage type of error. I am using the following code: URL newLoc = new URL("https://202.124.142.223/test/data/images/"); filename = "sample.jpg"; Image i = applet.getImage(newLoc,filen

  • Looking for a 60s / 70's reverb sound

    Hello, I am new to Logic express and I am having trouble finding a reverb sound that sounds right to me. I feel the reverb plug-ins available within logic express are perhaps too sophisticated, ie room modelling reverbs, and so I guess I am looking f

  • Editing Colour Profiles

    Hi all Can anyone tell me if there is a way to edit an existing Monitor colour profile rather than having to go through the whole calibration process from scratch? Thanks in advance. Derek.