Powershell remoting executing SQL Server installation msi fails - sql-server

I am trying to use Powershell remoting invoking "chef local mode" on a remote virtual machine.
I am using Powershell code like: invoke-command -session $session -ScriptBlock{}
The code invoking chef recipe works fine on the remote VM remote desktop Powershell window.
But it always fails entering "invoking msi" step of that recipe.(I am using official chef SQL Server recipe by the way).
Error log doesn't show anything, but it looks exactly like me manually force closing popup dos windows of SQL Server installation Application while installing locally on the remote VM.
Is there a restriction on Powershell remoting about new window spawn or something?
I had similar problem invoking MSI directly using Powershell scripts, which I had to work around with schedule a Windows task first and kick off it immediately.

PowerShell remoting is subject to severe constraints, see Quota Management for Remote Shells, most importantly MaxMemoryPerShellMB which is 1GB default. Even if the unnattended SQL instalation is correct, the MSI will likely run out of memory due to this constraint. The default values can be modified, see Learn How to Configure PowerShell Memory.
But is very likely that you're running incorrectly the unattended installation. Remote sessions are not allowed to interact with the Desktop, so no, they cannot spawn windows. Read Install SQL Server 2014 from the Command Prompt and Install SQL Server 2014 Using a Configuration File. Only after you validated locally that the unattended installation is correct, attempt to run it remotely.
I don't know what the 'official SQL Server' recipe does, but I wouldn't trust any such. I would make sure I run a correct unattended installation and build my own recipe from that.

As I mentioned in the comments, I am still hitting same problem after applying Hotfix from Microsoft. And again, I picked up workaround using schedule job to execute installer. This is acceptable approach in Vagrant Core 1.6
The most difficult part of the plugin was the elevated runner which takes any commands and runs them through a scheduled task instead of directly through the current WinRM shell. This whole rigamarole is needed because of the Windows permission model. You may be running your WinRM shell as Administrator, but its not the same as running Administrator locally on the box. This leads to all kinds of unexpected errors for users trying to install software on a Windows guest.
via here
and implementation code from Vagrant is here

Related

error while install sql server 2014,attempted to perform an unauthorized operation?

When I want to install sql 2014 in windows server 2012 the following error :
Error : Attempted to perform an unauthorized operation.
How to resolve it?
I too got the same error while installing sql 2014, i solved it by moving sql 2014 setup to C drive then run as administrator
It's work for me.
SQL Server 2008 R2
I had attempted to perform an unauthorized for this part of installation in windows 8.1 64bit:
SSISConfigAction_repair_postmsi_Cpu64
Changing installation drive for another drive to C: , solve my problem. Also, I read on another topic, don't close installation panel, because there is a bug while installing SQL Server.
Summary:
don't change installation Drive
don't close installation panel
make sure your source file is fine
run Setup as the administrator
Enjoy
1) So the methodology I used to figure out what was wrong with my system was to use Process Monitor.
I set the filter to listen for processes that contain "Scenario" and processes that contain "SQL".
2) I clicked Retry, and saw an ACCESS_DENIED for HKLM\Software\Microsoft\PowerShell\1\PowerShellEngine.
3) Checked permissions, and ensured that Users have read. Permissions had been set to deny on them.
Additionally, I have McAfee HIPs running on the server, so I also had an error where HIPs wouldn't allow editing of permissions to the Event Log registry.
So, had to have HIPs disabled temporarily, as well.

SSIS Package stalls when run as a SQL Job

Here is the short version of the problem: I have a discrete DTSX file that works fine on our Production server, but doesn't on our new Dev server.
Symptom: When run from a SQL-Server job, the job starts and nothing at all happens, and it never finishes... it just hangs, using very little system resources.
Some info: For Prod, the packages were developed on SQL-Server 2012 and run on an NT 2008 server. The new Dev server is also SQL-Server 2012, but runs on an NT 2012 server (in case that matters). I have duplicated the folder/file structure exactly, including drive name. The package uses an external dtsConfig file, but as I said - the folder/file structure is identical.
The SSIS service, SQL-Server Agent, and my remote login are all the same, and is a member of the server Administrator group on the Dev box. If I copy the command line text from the SQL job and run it in a CMD window using dtexec.exe, the package executes correctly. The job owner is my login, and the "run as" is the SQL-Agent, which - as I mentioned - is the same login. Since everything in the package uses integrated security, everything should be running using the same login whether on the command line or via the SQL-Agent, which should eliminate any user permission/credentials issues.
I tried adding SSIS logging to the package, logging everything I could. When I run the package from the command line, I get a ton of messages in the log. When I run the package via the SQL job, there are no messages at all in the log - nothing.
Whatever is going on, it's not getting far enough into the SSIS package to generate a single log entry. It's just stopping but not exiting or throwing an error. FWIW - I have the same problem with every other package I've tried.
Any ideas are appreciated...
I found the cause of the problem. The MS-SQL Server service was using a different login than the SSIS server service and the NT Agent service (it was using a local service account).
Once I changed the MS-SQL Server login to match the others (and restarted the service), the job ran correctly.

SQL Server Agent job not running package

I have an SSIS package that I have deployed to the file system. The owner for the package is my Windows Login. The reason for this is that it needs to write files to another server. If I make the owner NT SERVICE\SQLSERVERAGENT the error that I get is that the files on the remote server cannot be accessed.
The package itself runs under my account. The package normally takes about 5 minutes to run and works when run directly (double click, click Execute and enter decryption password). I can tell the package has run because it writes a number of logs to the file system.
I've set up a SQL Server job to run the package. The job says it's run successfully but there are no logs being written. I'm not sure where I've gone astray other than there's some account that I'm likely missing.
Has anyone else ever run into this?
The issue was that I needed to set up a proxy Account to run the SQL Server agent.

Executing batch file on Windows 2008 server from CentOS Jenkins instance

I have a Jenkins instance running on CentOS and would like the ability to connect to a Windows 2008 virtual server and have execute and write permissions.
Some threads have suggesting CYGWIN, installing on the windows machine and then using SSH to connect. There are also suggestions of telnet and RDP. I wanted to know if there is a recommended approach.
Thanks
You can connect a windows slave node into your main server
https://wiki.jenkins-ci.org/display/JENKINS/Step+by+step+guide+to+set+up+master+and+slave+machines
as mentioned earlier in a comment
I have to make Delphi builds on windows with my main jenkins installation is on a CentOS server.
You just need to configure the windows machine as jenkins slave. Java web start is a quick and easy solution (2 minutes) for that:
https://wiki.jenkins-ci.org/display/JENKINS/Distributed+builds#Distributedbuilds-LaunchslaveagentviaJavaWebStart
Or step-by-step here: https://wiki.jenkins-ci.org/display/JENKINS/Step+by+step+guide+to+set+up+master+and+slave+machines
Then on "Project setup" check the "Restrict where this project can be run" and write down the slave name. (There will be time later for more complicated expressions)
Finally istruct your project to exec windows commands adding one of those plugins
https:// wiki.jenkins-ci.org/display/JENKINS/PowerShell+Plugin
https:// wiki.jenkins-ci.org/display/JENKINS/Windows+Exe+Runner+Plugin
(sorry for the broken links but it doesn't let me post more than two)
If it's just a few times use netcat.
Otherwise use cygwin and ssh like you said.

How i can stop SQL server 2008 Express from Startup in Windows ?

i am installing SQL server 2008 express and found that many exe run on startup even i not used them.
can i stop them or allow to run them only after when i want to run them. means when i want only that time those run otherwise not.
how i can remove them from startup
You can see all your SQL server instances from the Sql Server Configuration Manager if you have it. There you can set the startmode to Manual instead of Automatic. This can also be done from the services console as arunkumar said. The service should be named SQL Server (SQLEXPRESS).
As #arunkumar said, you can change the services to disabled, or you can set them to Automatic also, but that may not change much. Generally, SQL Server is usually the main purpose of the PC, so it thinks it always needs to run :)
First thing will be to setup all those SQL Server and related services to run "Manually" instead of "Automatic" using Sql Server Configuration Manager.
I usually create two batch files, one to start SQL Server and related services like net start MSSQLSERVER and another to stop SQL Server when I am not using it like net stop MSSQLSERVER.
Of course there will be other related services as well.
If you can't stop services as you indicated in one of your reply, then may be you don't have enough privileges to perform that operation ??
Try:
run CMD "Run as Administrator"
command STOP
net stop mssql$express ,
command START
net start mssql$express

Resources