Executing batch file on Windows 2008 server from CentOS Jenkins instance - batch-file

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.

Related

Working 'gnu-screen' alternative for Minecraft Servers on WSL

I want to launch my minecraft server on SSH on WSL (Ubuntu 18.04) on Windows.
The way I plan to do it with a phone or something: Connect to vpn, then ssh into windows, then type wsl (works fine), and finally open a session (for example screen) and launch the script for the minecraft server in there.
The problem is, when I finally get into launching the script and detaching the screen and close the ssh connection, the screen will close after some time automatically.
WSL says it was terminated. I dont know what to do.
I should also add that the script should run permanently.
The mc server is running on java and constantly gives output. So I want it to be available all the time.
linuxgsm.com is a Server manager that is also available for minecraft, it uses tmux and is a perfect alternative with many other features.

start batchscript on remote host over ssh

i have this setup:
1 Host with Windows 10 and Cygwin Unix Tools (for a unix filesystem and the open-ssh server).
2 On the Other side there is another Linux Gentoo client.
Is there any chance to execute batch file on the host?
Like this 'ssh name#host start data.bat'?
U guys would help me a lot <3
If we you want to run command/script on the Windows 10 host, you need a SSH server set up on Windows. Although there are some rumors that Windows Powershell will have built-in SSH server support, I did not aware that it is released yet.
That being said, you have any third party tools to set it up . For example, check here.

The target principal name is incorrect. Cannot generate SSPI context

I have a small home network of pc's all running Windows 10. None of the PC's have been or are in a domain. One (an intel NUC) runs Sql Server and my Surface 3 has Visual Studio. I use my Microsoft login for both. This setup has been running fine for almost 2 years.
Now I suddenly get the above error when trying to connect using integrated security.
Sql Authentication works fine.
I can also remote into the NUC and run SSMS without a problem.
I have followed the troubleshooting guide without success (KB 811889)
NTLM seems to be operating OK on the NUC.
I pinged -a IPAddress and it resolved correctly to the name of the NUC
SQL Server uses NT Service\MSSQLSERVER. I tried using LocalSystem but still didn't work
All the help articles I have found assume there is a domain or suggest Sql Authentication as a solution.
Only recent change has been installing Windows Update for Windows 10 Version 1607 on the NUC
Can anyone help me?

Powershell remoting executing SQL Server installation msi fails

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

stoping and starting IIS 6.0 or my application pool on IIS using a batch file

I have two windows boxes. one is windows xp(local computer) where i need to write a batch file and the other is windows server 2003 where my IIS is located. Now i need to write a batch file in windows Xp that needs to do these below mentioned operations in it.
Stop the IIS or my application pool on that IIS.
Start the IIS or my application pool on that IIS.
These stop and start need to be performed in two different lines. The windows Server 2003 box has a different user id and password to my windows xp(local computer). As i am new to writing the batch files, after my one day of struggle i am just able to kill the process of my application pool(w3wp.exe) on IIS which is located in the windows server 2003 and i am still not sure what i have written is correct or not. Please help me how to stop and start the IIS which is on server 2003 box, as the batch file should be on the xp box. Thanks in advance for your help.
There is a built-in program for starting/stopping/restarting IIS - iisreset.exe
Calling this program on its own will stop and then restart IIS. If you want to just stop IIS without starting it again, use the following:
iisreset.exe /STOP
And then later you can start it again like this:
iisreset.exe /START
This should work for all versions of IIS, regardless of the operating system version. Just remember that you need to execute it as an administrator.
EDIT: Just noticed that you want to run the command from your XP box to restart IIS on a W2K3 box - there is an optional parameter to specify the target computer:
iisreset.exe ServerNameOrIp /STOP
And:
iisreset.exe ServerNameOrIp /START
finally after a long struggle i made it work by "starting and stopping the iis from remote box with different id and password". I have initially tried runas command which didn't work and then i moved on to ps tools and used this below mentioned commands.
psexec \COMPUTER_NAME -u USERID -p PASSWORD iisreset.exe /START ----> for starting the iis
psexec \COMPUTER_NAME -u USERID -p PASSWORD iisreset.exe /STOP ----> for stoping the iis
#djhayman --- Thanks for your help man.

Resources