Powershell : Failed To Load Microsoft.SqlServer.Management.Utility.dll - powershell

I don't ve Sql Server installed in my machine but I need the SQLPS module . So I installed below three msi .
Microsoft® System CLR Types for Microsoft® SQL Server® 2012 (SQLSysClrTypes.msi)
Microsoft® SQL Server® 2012 Shared Management Objects (SharedManagementObjects.msi)
Microsoft® Windows PowerShell Extensions for Microsoft® SQL Server® 2012 (PowerShellTools.ms
Then I tried importing SQLPS module but I got error
Importing SQLPS module.
The assembly 'Microsoft.SqlServer.Management.Utility' was not loaded because no assembly with that name was found.
I verified and I found this assemby is present under C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies but not under GAC .
So requesting you to please suggest me what I shd do ? I am not getting any clue . Should I copy the assembly to GAC ?

Try installing the native client as well?
Microsoft® SQL Server® 2012 Native Client (sqlncli.msi)

Related

azure cli extension not found on windows server 2019 self hosted agent

I have installed the latest version of Azure CLI on my windows 2019 self hosted agent. Output when checking for version.
PS C:\Users\blahblah> az --version
azure-cli 2.3.1
command-modules-nspkg 2.0.3
core 2.3.1
nspkg 3.0.4
telemetry 1.0.4
Extensions:
azure-devops 0.18.0
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\builduser\.azure\cliextensions'
Python (Windows) 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 02:47:15) [MSC v.1900 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Then when running the same script in devops azure pipeline release :
2020-04-18T03:50:14.3974844Z ##[debug]which 'az'
2020-04-18T03:50:14.3981389Z ##[debug]found: 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd'
2020-04-18T03:50:14.3981785Z ##[debug]which 'az'
2020-04-18T03:50:14.3985125Z ##[debug]found: 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd'
2020-04-18T03:50:14.3988433Z ##[debug]C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd arg: --version
2020-04-18T03:50:14.3989115Z ##[debug]C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd arg: --version
2020-04-18T03:50:14.3998697Z ##[debug]exec tool: C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd
2020-04-18T03:50:14.3998969Z ##[debug]exec tool: C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd
2020-04-18T03:50:14.3999139Z ##[debug]arguments:
2020-04-18T03:50:14.3999314Z ##[debug]arguments:
2020-04-18T03:50:14.4000072Z ##[debug] --version
2020-04-18T03:50:14.4000425Z ##[debug] --version
2020-04-18T03:50:14.4017396Z [command]C:\windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" --version"
2020-04-18T03:50:17.1212688Z azure-cli 2.3.1
2020-04-18T03:50:17.1213010Z
2020-04-18T03:50:17.1213120Z command-modules-nspkg 2.0.3
2020-04-18T03:50:17.1213248Z core 2.3.1
2020-04-18T03:50:17.1213345Z nspkg 3.0.4
2020-04-18T03:50:17.1213451Z telemetry 1.0.4
2020-04-18T03:50:17.1213507Z
2020-04-18T03:50:17.1213631Z Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
2020-04-18T03:50:17.1214799Z Extensions directory 'C:\windows\ServiceProfiles\NetworkService\.azure\cliextensions'
2020-04-18T03:50:17.1214873Z
2020-04-18T03:50:17.1215003Z Python (Windows) 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 02:47:15) [MSC v.1900 32 bit (Intel)]
2020-04-18T03:50:17.1215081Z
2020-04-18T03:50:17.1215191Z Legal docs and information: aka.ms/AzureCliLegal
2020-04-18T03:50:17.1215271Z
2020-04-18T03:50:17.1215320Z
2020-04-18T03:50:17.1215369Z
2020-04-18T03:50:17.1215468Z Your CLI is up-to-date.
2020-04-18T03:50:17.1215525Z
2020-04-18T03:50:17.1215623Z Please let us know how we are doing: https://aka.ms/clihats
Notice how the release pipeline does not show that I have the azure-devops extension installed. I need this extension to remotely trigger a pipeline release creation. I've tripled and quadrupled check that I am comparing the same server.
My next step would be to add a step to install the Azure CLI extension before calling the az pipelines. However I would rather try to figure out why this is not working. I have make this same call locally and it works fine. However I log in as myself instead of using a service principal/service subscription when testing same call locally.
Has anyone run into this issue and know whats going on here? Any suggestion would be greatly appreciated.
I found that the Extensions directory is inconsistent in your local and release pipeline.
In local:
Extensions directory 'C:\Users\builduser\.azure\cliextensions'
In release pipeline log :
Extensions directory 'C:\windows\ServiceProfiles\NetworkService\.azure\cliextensions'
If you are using a private agent, the Extensions directory should be consistent:
So you need to check the following points:
1.The machine where you installed az cli is the same machine as the agent you use to run the pipeline.
2.According to the directory path, check the installation of azure cli.

PowerShell Modul SqlServer

I'm running module: SQLSERVER (Version 20), get-help online says there is a parameter "credential", but there is not in this module I imported?
Thanks for help.

Powershell silent / unattended install of Delphi Tokyo 10.2 - for CI use in win docker container

I'm attempting to create a powershell command that silently installs Delphi Tokyo 10.2 - to be used as an automated compiler in a Windows Docker container. I've not been able to find any recent documentation on how to implement an unattended/silent installation using the proper installer commands / switches.
I was able to determine that the Tokyo and Rio installers use Inno Setup - and should be given Inno Setup installer commands/switches.
From the Tokyo installer about page:
https://photos.app.goo.gl/88jY7PF2mPAipwEA9
This is the command I've messed with thus far:
.\radstudio10_2_3_esd__93231.exe /sp- /verysilent /suppressmsgboxes /norestart/ /log="c:\somelocation\install.log"
However I am not able to get the install process to go past the first page or EULA checkbox. The failed silent install log shows:
Log opened. (Time zone: UTC-05:00)
Setup version: Inno Setup version 5.5.6 (u)
Original Setup EXE: C:\somelocation\radstudio10_2_3_esd__93231.exe
Setup command line: /SL5="$18051C,138809719,642048,C:\somelocation\radstudio10_2_3_esd__93231.exe" /sp- /verysilent /suppressmsgboxes /norestart/ /log=c:\somelocation\install.log
Windows version: 10.0.18363 (NT platform: Yes)
64-bit Windows: Yes
Processor architecture: x64
User privileges: Administrative
64-bit install mode: No
Created temporary directory: C:\Users\username\AppData\Local\Temp\is-1QQ8P.tmp
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-1QQ8P.tmp\innocallback.dll
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-1QQ8P.tmp\UnlockFirewall.dll
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-1QQ8P.tmp\mOasisRuntime.dll
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-1QQ8P.tmp\topbanner96.bmp
Failed to proceed to next wizard page; aborting.
Got EAbort exception.
Deinitializing Setup.
Log closed.
Here's a portion of the logs from a non-silent install of the same installer package:
Log opened. (Time zone: UTC-05:00)
Setup version: Inno Setup version 5.5.6 (u)
Original Setup EXE: C:\somelocation\radstudio10_2_3_esd__93231.exe
Setup command line: /SL5="$405F0,138809719,642048,C:\somelocation\radstudio10_2_3_esd__93231.exe" /log=c:\somelocation\install.log /saveinf=c:\somelocation\install.inf
Windows version: 10.0.18363 (NT platform: Yes)
64-bit Windows: Yes
Processor architecture: x64
User privileges: Administrative
264-bit install mode: No
Created temporary directory: C:\Users\username\AppData\Local\Temp\is-K4M7F.tmp
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-K4M7F.tmp\innocallback.dll
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-K4M7F.tmp\UnlockFirewall.dll
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-K4M7F.tmp\mOasisRuntime.dll
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-K4M7F.tmp\topbanner96.bmp
Message box (OK):
Inno Setup version 5.5.6 (u)
Copyright © 1997-2015 Jordan Russell
Portions Copyright © 2000-2015 Martijn Laan
All rights reserved.
Inno Setup home page:
http://www.innosetup.com/
RemObjects Pascal Script home page:
http://www.remobjects.com/ps
User chose OK.
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-K4M7F.tmp\ProductCodes.ini
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-K4M7F.tmp\ProductCodes.ini
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-K4M7F.tmp\ProductCodes.ini
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-K4M7F.tmp\ProductCodes.ini
Extracting temporary file: C:\Users\username\AppData\Local\Temp\is-K4M7F.tmp\ProductCodes.ini
Starting the installation process.
Creating directory: C:\Program Files (x86)\Embarcadero
Creating directory: C:\Program Files (x86)\Embarcadero\Studio
Creating directory: C:\Program Files (x86)\Embarcadero\Studio\19.0
Directory for uninstall files: C:\Program Files (x86)\Embarcadero\Studio\19.0\
...
...
...
So in the above successful non-silent install - notice the line in the logs that says Message box (OK) this occurs after I accept the EULA. So at present i'm not sure how to pass an installer switch to suffice the EULA page silently.
Has anyone had success with creating a silent / unattended install of Delphi Tokyo or Rio? Or has found documentation that helped them achieve something similar?
Any help is much appreciated!
Kind Regards,
For Delphi 2007 and Delphi XE2 we were able to do a silent installation with setup.exe /s, see https://delphisorcery.blogspot.com/2011/07/unattended-delphi-installation-how.html for reference.
But this did not work for Delphi 10.2 Tokyo anymore. So our IT department called Embarcadero directly for more information on how to do a silent installation. But unfortunately they told us, the installation process can not be done silently!

CentOS 6.5 - Plesk Onyx 17.0.17 - PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/apc.so'

I'm receiving the following error when checking the PHP version on our VPS Server running CentOS 6.5 (Final) with Plesk Onyx 17.0.17:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/apc.so' - /usr/lib64/php/modules/apc.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.3.3 (cli) (built: Aug 11 2016 20:33:53)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.6.0, Copyright (c) 2002-2014, by ionCube Ltd.
I've also run the following yum info php command which gives me:
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirror.bytemark.co.uk
* epel: mirror.bytemark.co.uk
* extras: mirrors.coreix.net
* updates: mirrors.coreix.net
Installed Packages
Name : php
Arch : x86_64
Version : 5.3.3
Release : 48.el6_8
Size : 3.5 M
Repo : installed
From repo : updates
Summary : PHP scripting language for creating dynamic web sites
URL : http://www.php.net/
License : PHP
Description : PHP is an HTML-embedded scripting language. PHP attempts to make
: it easy for developers to write dynamically generated webpages.
: PHP also offers built-in database integration for several
: commercial and non-commercial database management systems, so
: writing a database-enabled webpage with PHP is fairly simple. The
: most common use of PHP coding is probably as a replacement for CGI
: scripts.
:
: The php package contains the module which adds support for the PHP
: language to Apache HTTP Server.
We're currently setting up a staging site to run Magento 2 and the above error is causing issues with trying to reindex any of the Magento Index Management services and installing theme/extensions.
I'm not sure what extra information would be of use so do let me know of any commands to run to generate some more useful information.
I am new to server type work so please do bear with me and go into as much detail as you can.
This error means that somewhere in PHP's configs in /etc/php.d/ defined loading of APC extension by string like extension = apc.so
it may be file:
/etc/php.d/apc.ini
But file apc.so doesn't exists in default extensions folder /usr/lib64/php/modules/
You can:
disable loading of this extension
or check existiens of /usr/lib64/php/modules/apc.so
or reinstall package php-pecl-apc.x86_64
# rpm -qf /usr/lib64/php/modules/apc.so # determines package of file
php-pecl-apc-3.1.9-2.el6.x86_64
# yum remove php-pecl-apc.x86_64
# yum install php-pecl-apc.x86_64
For executing PHP scripts in CLI with system PHP you just need to install php-cli package: yum install php-cli
In case you still need another PHP version you can try Plesk's PHP in folder /opt/plesk/php/ (like /opt/plesk/php/5.6/bin/php)
In case you don't see anything in /opt/plesk/php/ you can install additional PHP versions with Plesk Installer.

Cannot add dll to 32-bit PowerShell

I am trying to add the Exchange 2007 SnapIn for 32-bit Powershell (Microsoft.Exchange.Management.PowerShell.Admin) but I seem to be having some trouble when installing the dll file.
These are the commands I am running in order to register the SnapIns
PS C:\Program Files\Microsoft\Exchange Server\Bin> $snapinPath = 'Microsoft.Exchange.Management.PowerShell.Support.dll'
PS C:\Program Files\Microsoft\Exchange Server\Bin> C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe /i $snapinPath
The above works without issue. I then go to install the main SnapIn with the following commands:
PS C:\Program Files\Microsoft\Exchange Server\Bin> $snapinPath = 'Microsoft.Exchange.PowerShell.Configuration.dll'
PS C:\Program Files\Microsoft\Exchange Server\Bin> C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe /i $snapinPath
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.5483
Copyright (c) Microsoft Corporation. All rights reserved.
Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'Microsoft.Exchange.PowerShell.Configuration, Version=8.
0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. An attempt was made to load a program with an incorrect format..
I'm not sure what I'm missing here. It's a fresh Exchange 2007 install so nothing should be corrupt.
My issue was that I was using the 64-bit version of the Microsoft.Exchange.PowerShell.Configuration.dll.
I required the 32-bit version. As it did not allow me to install the 32-bit version, I extracted the setup files for the 32-bit version of exchange, and copied the setup\serverroles\common folder to C:\Program Files\Microsoft\Exchange Server, and renamed it to Bin32.
The final stage was to copy this registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.Exchange.Management.PowerShell.Admin
to the following location:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.Exchange.Management.PowerShell.Admin
and then change any paths within the key to point to the new Bin32 folder.
At this point, it should be possible to load the Microsoft.Exchange.Management.Powershell.Admin snapin into a 32-bit Powershell (Great for IIS apps which depend on 32-bit libraries).