Server Deployment via TFS

Topics: Server Deployment
Aug 15, 2011 at 10:12 PM

I have been doing some server deployment via TFS and I am getting an error when running the build project.

The TFS build template calls a powershell script that executes the build command as follows in principle.

$session = new-pssession -computername $server
invoke-command -session $session -scriptblock $biztalk_deploy_script -ArgumentList $bindingPath, $projectPath, $batchFile, $btsAccount
Remove-psSession $session

The output of the script though gives me a problem with the various WMI Commands.

Using settings file C:\Program Files (x86)\Quanis.ErrorHandlingEngine\1.0\Dep
loyment\EnvironmentSettings\Exported_IntegrationSettings.xml
StopBizTalk:
iisreset.exe /noforce /restart /timeout:60

Attempting stop...

Internet services successfully stopped

Attempting start...

Internet services successfully restarted

StopAllBizTalkHosts:
Host list (BizTalkHosts ItemGroup) not customized.
"C:\Program Files (x86)\Quanis.ErrorHandlingEngine\1.0\Deployment\Framework\D
eployTools\cscript64.exe" /nologo "C:\Program Files (x86)\Quanis.ErrorHandlingE
ngine\1.0\Deployment\Framework\DeployTools\StopBizTalkHost.vbs" ALL
EXEC : Microsoft VBScript runtime error 1A8: Object required [C:\Program Files
(x86)\Quanis.ErrorHandlingEngine\1.0\Deployment\Quanis.ErrorHandling.Deployment
.btdfproj]
C:\Program Files (x86)\Quanis.ErrorHandlingEngine\1.0\Deployment\Framework\BizT
alkDeploymentFramework.targets(1031,5): error MSB3073: The command ""C:\Program
Files (x86)\Quanis.ErrorHandlingEngine\1.0\Deployment\Framework\DeployTools\cs
cript64.exe" /nologo "C:\Program Files (x86)\Quanis.ErrorHandlingEngine\1.0\Dep
loyment\Framework\DeployTools\StopBizTalkHost.vbs" ALL" exited with code -1. [C
:\Program Files (x86)\Quanis.ErrorHandlingEngine\1.0\Deployment\Quanis.ErrorHan
dling.Deployment.btdfproj]
Done Building Project "C:\Program Files (x86)\Quanis.ErrorHandlingEngine\1.0\De
ployment\Quanis.ErrorHandling.Deployment.btdfproj" (default targets) -- FAILED.

Build FAILED.

I have made sure that all accounts (e.g. the Build Account) are members of the BizTalk Server Administrative Group; but the deployment still fails.

Thank you

-martin

 

 

Coordinator
Aug 16, 2011 at 4:43 AM

I don't think it's the issue here, but are you executing 32-bit MSBuild.exe?

I'm assuming that you're on Windows Server 2008.  You'll probably need to do some VBScript testing from an Administrator Command Prompt to isolate the problem.  For one, you can copy the exact cscript64.exe command line from the output and run it separately from the deployment script.  See if it fails with the same error.  Inside StopBizTalkHost.vbs, there are only a couple of object references, and they should all be valid on Server 2008 -- but perhaps there is a Windows component that is not installed on your server (not sure what it would be though).  One object is WScript, the scripting host engine, and the other is a WMI object from Winmgmts:!root\MicrosoftBizTalkServer and then the query Select * from MSBTS_HostInstance where HostType=1.  There are free WMI test apps available that you could use to further diagnose the WMI portion.

I hope that gives you some ideas.  Please post any new information that you discover.

Thanks!
Tom

Aug 16, 2011 at 6:41 PM

Thank you Tom,

I have been doing some troubleshooting on this issue.

  1. Run Script and Build as Admin (cmd run as Administrator) on Deployment Server
    1. Run VBS Script Locally                 - Works
    2. Run Full Build/Server Deployment - Works. 
  2. Run Script and Build as Admin (regular cmd) on Deployment Server
    1. Run VBS Script Locally                 - Failure
    2. Run Full Build/Server Deployment - Failure
  3. Run Script and Build as Admin (regular cmd) from Build Server using winrs
    1. Run Full Build/Server Deployment - Failure

Overall it seems this has something to do with remote connection privileges, although I cannot pinpoint the exact problem. The credentials being used have administrative rights on the Deployment Server and have all necessary access rights to BizTalk WMI.

-martin

 

Aug 16, 2011 at 7:21 PM

Some further steps I have taken with the operations guy to resolve this issue further (see step 2) above.

By Disabling User Access Control (UAC) I was able to overcome the issues in Step 2.

  1. Run Script and Build as Admin (regular cmd) on Deployment Server
    1. Run VBS Script Locally                 - Works
    2. Run Full Build/Server Deployment - Works

On the other hand though, the setting change didn't affect the winrs command.

-martin

 

 

Coordinator
Aug 18, 2011 at 6:43 PM

Have you seen this thread which also involved winrs toward the end?

Did you disable UAC on the remote target server or on the source server?

Tom

Aug 18, 2011 at 6:51 PM

Hi Tom,

I have solved the issue by using PsExec instead of remote powershell and/or winrs. This allowed me to run the remote process with elevated privileges so that the WMI commands that were failing are now executed properly. I can further post the BizTalkBuild template that performs the deployment if anybody needs to solve the same problem.

Thanks for your help

-martin

Coordinator
Aug 22, 2011 at 4:38 AM
Edited Aug 22, 2011 at 4:39 AM

What would we do without the SysInternals tools??  Thanks for the update!

Tom