Cannot execute BizTalkHost task on a remote machine

Jan 31, 2011 at 6:42 PM
I'm trying to check if a BizTalkHost exists. 
BizTalk 2010 and BizTalk databases are on separate machines. 
I'm running the build script on BizTalk 2010 server with an account that is a sys_admin on the database server where BizTalk databases are housed.
I'm getting the UnauthorizedAccessException. The script and the error message are below.
Any suggestions?
Thanks.
.....
    <MSBuild.ExtensionPack.BizTalk.BizTalkHost TaskAction="CheckExists" HostName="%(Host.HostName)" MachineName="$(BtsDatabaseServer)">
      <Output TaskParameter="Exists" PropertyName="%(Host.HostNameExists)"/>
    </MSBuild.ExtensionPack.BizTalk.BizTalkHost>
......
PrepareHostAndHostInstances:
  CheckExists Host: SingleReceiveHost on: SERVER_NAME E:\ParameterizedBizTalkConfig\PrepareHostAndHostInstances.xml(27,5): error : UnauthorizedAccessException: Access is denied. (Exception from HRESULT:
0x80070005 (E_ACCESSDENIED))\r [E:\ParameterizedBizTalkConfig\ConfigureBizTalk.xml]
E:\ParameterizedBizTalkConfig\PrepareHostAndHostInstances.xml(27,5): error :  [E:\ParameterizedBizTalkConfig\ConfigureBizTalk.xml]
Done Building Project "E:\ParameterizedBizTalkConfig\ConfigureBizTalk.xml" (default targets) -- FAILED.
Coordinator
Jan 31, 2011 at 8:48 PM

Can you run that with /v:diag and post the log.

Thanks

Mike

Coordinator
Feb 1, 2011 at 8:19 AM

... please note I've closed your other issue: http://msbuildextensionpack.codeplex.com/workitem/8032

Does the account you are using now have appropriate access?

Feb 1, 2011 at 1:42 PM

Hi Mike,

The account I'm using has sysadmin access to the database that is on DATABASE_SERVER. However, I could not log in to the box remotely with the same account. ManagementScope sounds like WMI. Do you think

I need admin access to the box that houses BizTalk databases? Note that BizTalk 2010 is not installed on the DATABASE_SERVER.

I think this is relevant section of the log.

Target "PrepareHostAndHostInstances" in file "E:\ParameterizedBizTalkConfig\PrepareHostAndHostInstances.xml" from project "E:\ParameterizedBizTalkConfig\ConfigureBizTalk.xml" (target "Default" depends on it):
Using "MSBuild.ExtensionPack.BizTalk.BizTalkHost" task from assembly "E:\ParameterizedBizTalkConfig\MSBuildExtensionPack\MSBuild.ExtensionPack.BizTalk.dll".
Task "MSBuild.ExtensionPack.BizTalk.BizTalkHost"
  Connecting to BtsCatalogExplorer: Server: DATABASE_SERVER. Database: BizTalkMgmtDb
  ManagementScope Set: \\DATABASE_SERVER\root\MicrosoftBizTalkServer
  CheckExists Host: SingleReceiveHost on: DATABASE_sERVER
E:\ParameterizedBizTalkConfig\PrepareHostAndHostInstances.xml(27,5): error : UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))\r [E:\ParameterizedBizTalkConfig\ConfigureBizTalk.xml]
E:\ParameterizedBizTalkConfig\PrepareHostAndHostInstances.xml(27,5): error :  [E:\ParameterizedBizTalkConfig\ConfigureBizTalk.xml]
Done executing task "MSBuild.ExtensionPack.BizTalk.BizTalkHost" -- FAILED.
Done building target "PrepareHostAndHostInstances" in project "ConfigureBizTalk.xml" -- FAILED.
Done executing task "CallTarget" -- FAILED.
Done building target "Default" in project "ConfigureBizTalk.xml" -- FAILED.
Done Building Project "E:\ParameterizedBizTalkConfig\ConfigureBizTalk.xml" (default targets) -- FAILED.

Thanks for looking into the other issue. As a workaround, I copy the extensionpack dll references into the folder where my script is and zip the entire folder, move that folder to the server on which I need to run the

script and execute on the server. It worked beautifully in DEV where BizTalk Server and databases were on the same box. I'm getting the UnauthorizedException in STAGE as explained above.

 

Thanks.

Coordinator
Feb 2, 2011 at 12:39 PM
Edited Feb 2, 2011 at 12:40 PM

Ah, ok the problem lies with WMI. The server you are running from does not have the MSBTS_HostSetting class installed. We query that in the \root\MicrosoftBizTalkServer namespace. A great tool for seeing what WMI funcationality is available is the WMI Code Creator: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en

i.e. the UnauthorizedAccessException exception has nothing to do with security.

Mike

Feb 3, 2011 at 4:42 AM

Well, I think the problem lies with my gigantic oversight. After looking over my script again I realized that I did not provide the DatabaseServer property.

Changing

    <MSBuild.ExtensionPack.BizTalk.BizTalkHost TaskAction="CheckExists" HostName="%(Host.HostName)" MachineName="$(BtsDatabaseServer)">
      <Output TaskParameter="Exists" PropertyName="%(Host.HostNameExists)"/>
    </MSBuild.ExtensionPack.BizTalk.BizTalkHost>


to
 
    <MSBuild.ExtensionPack.BizTalk.BizTalkHost TaskAction="CheckExists" HostName="%(Host.HostName)" DatabaseServer="$(BtsDatabaseServer)">
      <Output TaskParameter="Exists" PropertyName="%(Host.HostNameExists)"/>
    </MSBuild.ExtensionPack.BizTalk.BizTalkHost>
resolved the issue.
Thanks and apologies for having wasted your time.
Alper