Attempting to perform the InitializeDefaultDrives operation on the 'BizTalk' provider failed

纵然是瞬间 提交于 2020-01-05 04:22:10

问题


I'm getting the error:

"Attempting to perform the InitializeDefaultDrives operation on the 'BizTalk' provider failed.".

I got this working on our BizTalk Dev system several months ago; just installed the Production server today, and getting the error.

Using BizTalk 2016 on Win 2012.

I ran the command:

  %windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe
 .\BizTalkFactory.PowerShell.Extensions.dll

and I'm using PowerShell 4 in 32-bit mode:

Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.

PS C:\Users\myusername> get-pssnapin -registered


Name        : BizTalkFactory.PowerShell.Extensions
PSVersion   : 4.0
Description : Windows PowerShell CmdLets and Provider for Microsoft Biztalk Server

Name        : WDeploySnapin3.0
PSVersion   : 2.0
Description : This is a PowerShell snap-in that contains cmdlets for managing Microsoft Web Deployment infrastructure.



PS C:\Users\myusername> Add-PSSnapIn -Name BiztalkFactory.PowerShell.Extensions
Attempting to perform the InitializeDefaultDrives operation on the 'BizTalk' provider failed.
PS C:\Users\myusername> Add-PSSnapIn -Name BiztalkFactory.PowerShell.Extensions
PS C:\Users\myusername> Get-ExecutionPolicy
RemoteSigned

回答1:


In my Development environment, BizTalk and SQL were on the same sever, but in Production environment, they are on different servers.

Apparently if on different servers, you have to add this line:

New-PSDrive -Name BizTalk -Root BizTalk:\ -PsProvider BizTalk -Instance MySqlServer -Database BizTalkMgmtDb

Just replace "MySqlServer" with your server name.

Got the idea/solution here: Installing the BizTalkFactory PowerShell Provider on BizTalk 2013, where he talks about creating a Profile.ps1 file. Or possibly I created that Profile.ps1 in Dev, and just forgot about it; checking on that now.




回答2:


In case anyone stumbles over this old post, to stop the error, just set this variable before hand:

$InitializeDefaultBTSDrive = $false

It also makes it a lot faster.

An alternative to adding the snapin is to just import the module, so your script becomes:

$InitializeDefaultBTSDrive = $false
Import-Module "$env:BTSINSTALLPATH\SDK\Utilities\PowerShell\BizTalkFactory.PowerShell.Extensions.dll" -WarningAction Ignore
New-PSDrive -Name BizTalk -PSProvider BizTalk -Root BizTalk:\ -Instance mybiztalksqlservername.mydomain -Database BizTalkMgmtDb


来源:https://stackoverflow.com/questions/45089732/attempting-to-perform-the-initializedefaultdrives-operation-on-the-biztalk-pro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!