3

I'm writing a script to automate the installation of BizTalk Server and then apply the configurations through the BizTalk "configuration.exe" utility. When I run the configuration.exe utility locally and supply it with the config xml, it works fine, and it displays a dialog during the configuration that shows the progress without the need for any user interaction.

The issue I'm having is when I try to remotely execute configuration.exe via Powershell. The configurations are not been applied and the configuration.exe process appears for a few seconds in the process explorer then it exits.

I examined the error logs and it seems like configuration.exe is crashing as it is trying to show its progress windows, but it's not able to do that remotely. The 3 errors that come up in the error log are:

Windows Error Reporting:

            - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
            - <System>
              <Provider Name="Windows Error Reporting" /> 
              <EventID Qualifiers="0">1001</EventID> 
              <Level>4</Level> 
              <Task>0</Task> 
              <Keywords>0x80000000000000</Keywords> 
              <TimeCreated SystemTime="2012-12-03T13:24:10.000000000Z" /> 
              <EventRecordID>3956</EventRecordID> 
              <Channel>Application</Channel> 
              <Computer>HOSTNAME</Computer> 
              <Security /> 
              </System>
            - <EventData>
              <Data /> 
              <Data>0</Data> 
              <Data>CLR20r3</Data> 
              <Data>Not available</Data> 
              <Data>0</Data> 
              <Data>configuration.exe</Data> 
              <Data>3.0.1.0</Data> 
              <Data>4c5479ac</Data> 
              <Data>System.Windows.Forms</Data> 
              <Data>4.0.0.0</Data> 
              <Data>4f61a8cc</Data> 
              <Data>3e06</Data> 
              <Data>ee</Data> 
              <Data>System.InvalidOperationException</Data> 
              <Data /> 
              <Data /> 
            <Data>C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_configuration.ex_120852993cfe8d93d2aac7a1cea49f9a18b688_345a8b46</Data> 
              <Data /> 
              <Data>0</Data> 
              <Data>b823ff23-3d4c-11e2-ae6f-005056bc6ac0</Data> 
              <Data>4</Data> 
              </EventData>
              </Event>

Application Error:

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="Application Error" /> 
  <EventID Qualifiers="0">1000</EventID> 
  <Level>2</Level> 
  <Task>100</Task> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2012-12-03T13:24:10.000000000Z" /> 
  <EventRecordID>3955</EventRecordID> 
  <Channel>Application</Channel> 
  <Computer>HOSTNAME</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>Configuration.exe</Data> 
  <Data>3.9.469.0</Data> 
  <Data>4c5479ac</Data> 
  <Data>KERNELBASE.dll</Data> 
  <Data>6.1.7601.17651</Data> 
  <Data>4e211319</Data> 
  <Data>e0434352</Data> 
  <Data>0000b9bc</Data> 
  <Data>1be0</Data> 
  <Data>01cdd1597a111847</Data> 
  <Data>C:\Program Files (x86)\Microsoft BizTalk Server 2010\Configuration.exe</Data> 
  <Data>C:\Windows\syswow64\KERNELBASE.dll</Data> 
  <Data>b823ff23-3d4c-11e2-ae6f-005056bc6ac0</Data> 
  </EventData>
  </Event>

.NET Runtime error:

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name=".NET Runtime" /> 
  <EventID Qualifiers="0">1026</EventID> 
  <Level>2</Level> 
  <Task>0</Task> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2012-12-03T13:24:10.000000000Z" /> 
  <EventRecordID>3954</EventRecordID> 
  <Channel>Application</Channel> 
  <Computer>HOSTNAME</Computer> 
  <Security /> 
  </System>
- <EventData>
  <Data>Application: Configuration.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.InvalidOperationException Stack: at System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window) at System.Windows.Forms.Form.ShowDialog() at Microsoft.BizTalk.Configuration.Program.RunConfigProgressUIThread() at System.Threading.ThreadHelper.ThreadStart_Context(System.Object) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart()</Data> 
  </EventData>
  </Event>

I've checked the options that can be passed to configuation.exe as I know some MSI and EXE installers do have a /silent option but this EXE doesn't seem to have it.

enter image description here

I've also tried to run this through PSExec and I got a similar error.

Please let me know if there's anyway to run this remotely. Thanks.

Musaab Al-Okaidi
  • 3,734
  • 22
  • 21
  • Did you try running it from the server by logging in to it? If it ran fine, then it might be something to do with the windows credentials, while running in remotely. – user1826905 Dec 05 '12 at 10:44
  • It does work when I run it locally, and when I run it remotely I'm using the same credentials, so I don't think there's a problem with the user authentication. Also, the event logs don't show any user authentication errors. – Musaab Al-Okaidi Dec 05 '12 at 11:54
  • Try running some other script remotely just to make sure you have the right settings and to narrow down the issue. – user1826905 Dec 05 '12 at 11:58
  • I have run various other commands remotely and they're all successfully executing. – Musaab Al-Okaidi Dec 05 '12 at 12:37
  • In the error message **System.Windows.Forms.Form.ShowDialog** appears. This indicates it needs to display something, which is not possible when executing remotely. – user1826905 Dec 05 '12 at 13:02
  • Yes this is what I believe the problem is. The prompt is a simple progress bar and it does not require any user interactions, so I want to know if there's anyway of suppressing this window or allowing it to popup in the console session if possible. – Musaab Al-Okaidi Dec 05 '12 at 13:15
  • Can you post your Configuration.exe commandline parameters used? Did you try with **/S** – user1826905 Dec 05 '12 at 13:21
  • I've update the original post to include a screenshot of the options that the configuration.exe accepts. The /s operator is used to specify the path for the XML file which contains the configuration parameters. The command I'm executing is: "c:\Program Files (x86)\Microsoft BizTalk Server 2010\Configuration.exe" /s C:\Temp\BiztalkConfig.xml /l C:\Temp\BiztalkConfigLog.log" – Musaab Al-Okaidi Dec 05 '12 at 13:26
  • 1
    Just to be clear, since I'm running the command remotely through Powershell, this is how I'm running it: $Command = "& 'c:\Program Files (x86)\Microsoft BizTalk Server 2010\Configuration.exe' /s C:\Temp\BiztalkConfig.xml /l C:\Temp\BiztalkConfig$(Get-Date -f ddMMyyyy_HHmmss).log" $PSSession = New-PSSession -ComputerName BizTalkServer Invoke-Command -Session $PSSession -ArgumentList $Command -ScriptBlock { Invoke-Expression $args[0] } – Musaab Al-Okaidi Dec 05 '12 at 13:32
  • Can you try running it without creating a persistent connection i.e. **Invoke-Command -ComputerName BizTalkServer -ArgumentList $Command -ScriptBlock { Invoke-Expression $args[0] }** – user1826905 Dec 05 '12 at 14:04
  • I'm still getting the same error. – Musaab Al-Okaidi Dec 05 '12 at 14:33
  • did you run the configuration.exe, while on the server using the powershell or commandline? – user1826905 Dec 05 '12 at 15:38
  • I've used both powershell and the commandline, and it successfully executes from both shells. – Musaab Al-Okaidi Dec 05 '12 at 16:25
  • Try running your script through [this](http://www.windowsitpro.com/article/scripting/get-to-know-the-powershell-ise-136036) – user1826905 Dec 05 '12 at 16:45
  • Do you mean run it through the Powershell ISE? or have I missed something? I did try running it through Powershell ISE, but I get the same error again. – Musaab Al-Okaidi Dec 06 '12 at 09:27
  • FYI: I don't know if you knew but there's already an open source project to deploy biztalk projects using msbuild: http://biztalkdeployment.codeplex.com/ – Jay Dec 18 '12 at 15:40
  • Thanks for this Jay, I'll have a look into it. – Musaab Al-Okaidi Dec 25 '12 at 15:08

2 Answers2

2

I know this is a very old post but just an update .. If any one is trying to configure BizTalk 2013 remotely .. please install the latest update for BizTalk (currenlty CUW3 BizTalk2013CU3-KB3088676-ENU).This will provide an option of /noprogressbar. This will fix the issue

Dheer
  • 91
  • 4
1

I don't know if it is too late for you but I'm facing the same issue. This is du to the fact that Configuration.exe use a Form Component that realize some MessageBox.Show() and this is incompatible with non-interactive mode. If you look at the information message in the event viewer, you will see a dump file with the following Waston Report :

<?xml version="1.0" encoding="utf-16"?>
<WatsonInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <osVersion>Microsoft Windows NT 6.2.9200.0</osVersion>
  <AppName>Microsoft ® BizTalk ® Server 2013</AppName>
  <AppVersion>3.10.229.0</AppVersion>
  <exceptionString>System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at System.Windows.Forms.Form.ShowDialog()
   at Microsoft.BizTalk.Configuration.Program.RunConfigProgressUIThread()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()</exceptionString>
  <exceptionMessage>Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.</exceptionMessage>
  <exceptionStackTrace>   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   at System.Windows.Forms.Form.ShowDialog()
   at Microsoft.BizTalk.Configuration.Program.RunConfigProgressUIThread()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()</exceptionStackTrace>
  <targetSite>System.Windows.Forms.DialogResult ShowDialog(System.Windows.Forms.IWin32Window)</targetSite>
  <HResult>80131509</HResult>
</WatsonInfo>

You will see this error exception :

System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

If you're always interested in this process (configure biztalk in command line remotely), I've just wrote a post on this here Azure BizTalk One Touch Configuration.

I wrote an extendedconfiguration.exe component to not use modal dialog and enable the configuration from powershell in remote. I use schedule task after to by-pass double hop issue, but if you are on premises network, I think you could configure trusted connection between you computers and use -Authentication CredSSP when you create you pssession and it shoud be work.

Hope this help

Jérémie MVP Integration

  • Hi Jeremie, thank you very much. It is too late as I've moved from the place where I needed it, but thank you very much for helping out, I will certainly keep this as a reference in case I ever needed to do such a thing again. Cheers – Musaab Al-Okaidi May 07 '13 at 10:46