How do I install Microsoft.SqlServer.SqlManagementObjects (SMO) for SQL 2017 without Visual Studio? - smo

Here's the scenario, we're installing Microsoft Dynamics 365 (Formerly CRM) v9 On Prem on SQL 2017. RTM is only compatible with SQL 2016, but as of update 0.03 it does support SQL 2017. Using a Setup script I can install the latest update (0.22) during installation, but the installer only installs the SQL components for SQL 2016 and not 2017. So when using it I get errors about missing CLR Type and SMO for Sql 2017. I was able to get CLR Type installed using SQL 2017 Feature Pack, but they have removed SMO from this, it's only installable through a Nuget package in Visual Studio from what I'm seeing.
I would rather not install Visual Studio on our Dynamics 365 web servers just to get this package. One work around I found was I installed SSMS 18 which added it, but again I'd rather not install any dev tools on the web servers just to get SMO. Does anyone have other options on how to satisfy this requirement? I tried some PowerShell scripts that supposedly would install it, but nothing worked.
Thanks.

If you have both admin and web access on the target host you can simply install SMO via PowerShell package manager:
Install-Package Microsoft.SqlServer.SqlManagementObjects -Version 161.44091.28
Alternatively you can download the NuGet package manually from:
https://www.nuget.org/api/v2/package/Microsoft.SqlServer.SqlManagementObjects/161.44091.28
move it to "-o$env:ProgramFiles\PackageManagement\ProviderAssemblies" and register by:
Register-PSRepository -Name "SMO" -SourceLocation "location" -InstallationPolicy Trusted
Install-Module SMO

Related

OPS-008: OpsHub Visual Studio Migration Utility requires Team Foundation Server 2012 Update 1 Object Model or above

This tool looks promising when I went through the available information on website. But when I downloaded free version and when I am trying to install in my local I came across the following error.
OPS-008: OpsHub Visual Studio Migration Utility requires Team Foundation Server 2012 Update 1 Object Model or above.
Do I need to install this software on the server ? No where I could find instructions for installing this software.
Can I get this explained please, we are planning to migrate our project to VSTS.
If you want to migrate from TFS on premise to VSTS, I would suggest you to evaluate which of the three options listed by Microsoft documentation suite your need.
The easier way would be to chose option 2, especially if you already have TFS2015update3 or TFS 2017, as you need to upgrade your TFS collection to one of those version anyway before migrating (and you save the upgrade hassle).
If you want to use OpsHub tool, then you need to install the standalone TFS Object Model for TFS 2012 update 4 where you run the OpsHub tool, not on any of the TFS servers.
In order to run OVSMU, you will have to install TFS Object Model 2012 on the machine where you are installing the tool. This is a pre-requisite and be rest assured this version of OM will not conflict with any other (newer) version of Object Model already existing (which comes bundled with Visual Studio installer) on that machine.

Powershell Import-Module SqlServer Error

I am trying to download the 'SqlServer' module, I recently upgraded Powershell from 4.0 to 5.0. I have set the execution policy to RemoteSigned. This is on a Windows 2012 R2 Server. I am getting this error.
Import-Module : The specified module 'SqlServer' was not loaded because no valid module file was found in any module directory.
I want to download the SqlServer module.
I cannot use comment right now so I'll just write it down here. Nowadays SQLServer module is shipped with SSMS releases and SQLPS module is shipped with SQL Server itself. I would suggest you download latest SSMS and it should work fine. Note that there's an earlier version of SQLServer module available in SQL Server 2016 Feature Pack.

TFS Build: `Microsoft.TeamFoundation.PowerShell' is not installed on this computer

When I'm logged in to tfs build server using local account and execute following powershell command:
Add-PSSnapin Microsoft.TeamFoundation.PowerShell
it loads the tfs cmdlets correctly. However, when I trigger a build on tfs server that invokes the script, it fails with message:
'Microsoft.TeamFoundation.PowerShell' is not installed on this computer.
The build agent runs under service account. What should I do?
EDIT:
I had to edit the reqistry entry from the first link in #Alexis Coles' answer to make it work with version 2015 of TFS PowerTools:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.TeamFoundation.PowerShell]
"PowerShellVersion"="4.0"
"Vendor"="Microsoft Corporation"
"Description"="This is a PowerShell snap-in that includes the Team Foundation Server cmdlets."
"VendorIndirect"="Microsoft.TeamFoundation.PowerShell,Microsoft"
"DescriptionIndirect"="Microsoft.TeamFoundation.PowerShell,This is a PowerShell snap-in that includes the Team Foundation Server cmdlets."
"Version"="14.0.0.0"
"ApplicationBase"="C:\\Program Files (x86)\\Microsoft Team Foundation Server 2015 Power Tools"
"AssemblyName"="Microsoft.TeamFoundation.PowerTools.PowerShell, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
"ModuleName"="C:\\Program Files (x86)\\Microsoft Team Foundation Server 2015 Power Tools\\Microsoft.TeamFoundation.PowerTools.PowerShell.dll"
"CustomPSSnapInType"="Microsoft.TeamFoundation.PowerTools.PowerShell.TFPSSnapIn"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.TeamFoundation.PowerShell]
"PowerShellVersion"="4.0"
"Vendor"="Microsoft Corporation"
"Description"="This is a PowerShell snap-in that includes the Team Foundation Server cmdlets."
"VendorIndirect"="Microsoft.TeamFoundation.PowerShell,Microsoft"
"DescriptionIndirect"="Microsoft.TeamFoundation.PowerShell,This is a PowerShell snap-in that includes the Team Foundation Server cmdlets."
"Version"="14.0.0.0"
"ApplicationBase"="C:\\Program Files (x86)\\Microsoft Team Foundation Server 2015 Power Tools"
"AssemblyName"="Microsoft.TeamFoundation.PowerTools.PowerShell, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
"ModuleName"="C:\\Program Files (x86)\\Microsoft Team Foundation Server 2015 Power Tools\\Microsoft.TeamFoundation.PowerTools.PowerShell.dll"
"CustomPSSnapInType"="Microsoft.TeamFoundation.PowerTools.PowerShell.TFPSSnapIn"
Double check AssemblyName, ApplicationBase, ModuleName and Version entries. Script above works with Microsoft Team Foundation Server 2015 Power Tools
I had this issue and to solve I notice that by default the cmdlets are not added during the PowerTools installation. You need to run a full install to make it work.
I posted here some pictures:
https://fabiostawinski.wordpress.com/2016/07/11/the-windows-powershell-snap-in-microsoft-teamfoundation-powershell-is-not-installed-on-this-computer/
I am going to have a quick punt here and say it is probably something to do with 32-bit vs 64-bit powershell. If I run Add-PSSnapinicrosoft.TeamFoundation.PowerShell from normal 64-bit powershell fine. But if I run it from C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell_ise.exe I get the above exception. I am going to go ahead and say that the build server is a 32-bit application and there for starting a 32-bit runtime.
Not really sure what the fix is exactly but maybe the following will point you in the right direction.
PowerShell (2.0, 32-bit) can't load TFS 2010 snap-in... except when it can
https://social.msdn.microsoft.com/Forums/en-US/a116799a-0476-4c42-aa3e-45d8ba23739e/tfs-power-tools-2008-powershell-snapin-wont-run-in-on-64bit-in-windows-2008-r2?forum=tfspowertools
For me it was another issue because I was trying to use Power Tools with only Visual Studio 2017 Pro installed.
For Visual Studio 2017 they didn't released Microsoft Team Foundation Server 2017 Power Tools. They are saying that the previous version it should work with any higher version of Visual Studio that has TFS.
The problem is that if you have only Visual Studio 2017 installed you will not be able to install Microsoft Team Foundation Server 2015 Power Tools for example, because having Visual Studio 2015 (any version) installed is a requirement for installing Microsoft Team Foundation Server 2015 Power Tools.
In other words I had to install Visual Sudio 2015 then install Microsoft Team Foundation Server 2015 Power Tools and then Add-PSSnapin Microsoft.TeamFoundation.PowerShell worked.
Please refer also to this:
https://developercommunity.visualstudio.com/content/problem/103642/team-foundation-server-2015-power-tools-install-is.html
Hopefully this would help somebody.

Installer for ISDeploymentWizard.exe

Is anyone aware of an installer (msi or otherwise) that drops the SSIS Deployment Wizard executable (ISDeploymentWizard.exe) onto a server (generally found in C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn). We have a web server (we use this as our TFS Agent) that we want to deploy our SSIS 2012 packages from - it is a fairly vanilla server (with IIS, .NET, etc) and hence we don't want a fully blown install of SSIS and/or VS2012 (SSDT) just to deploy SSIS packages.
I realise we can use T-SQL (which requires an instance level perm'd user as an OPENROWSET BULK import is used) and/or MOM to deploy SSIS packages to a remote SQL Server 2012 instance however the preference is to use the SSIS Deployment Wizard
I would have thought ISDeploymentWizard.exe would have been part of the SQL Server 2012 Feature Pack (http://www.microsoft.com/en-us/download/confirmation.aspx?id=35580) however it is unclear exactly whether this is the case and indeed which msi it would belong to
I needed the same ISDeploymentWizard.exe on our build server. We didn't want a full installation of SQLServer on the build box. Using the ISO (en_sql_server_2012_developer_edition_with_sp1_x64_dvd_1228540) from MSDN subscriptions
I chose "Integration Services"
However, if you look thru the files in the ISO there is
sql_is.msi
Which is likely the MSI you looking for. That placed isdeploymentwizard.exe in for out 64-bit machine.
C:\Program Files\Microsoft SQL Server\110\DTS\Binn\ISDeploymentWizard.exe

How to chek Sqlserver and visual studio softwares are installed while installing msi file

I am creating msi file using visual studio. But i need to know how to test .Net Framework and SQL server are installed before doing installation of msi.
Is there any settings (Or) any windows installer are available.
Windows Installer proposes use the Bootstrapping for these purposes. You pack your MSI to Setup.exe and set needed prerequisites, in your case .NET FW 4 and SQL. When user starts Setup.exe, it checks if .NET and SQL are installed, if not installs them and then run the your MSI. You could include the installation files of .NET or SQL in your setup.exe or set link from where installation downloads it.
There is more information about Windows Installer Bootstrapping.