Launch PowerShell script on remote server using Talend - powershell

I'm using a Talend job located on a server A , and I'm trying to runa PowerShell script with it.
my problem : the PS Script is located on remote server B.
I've managed to run the script from server A using the 'Tsystem' component but the PS Script is running on server A context.
I think the 'tsystem' component is getting the PS script from server B but runsit in server A.
Is there a way to runa powershell script on remote server using Talend ?
Any help will be appreciated.
Thanks in advance,
Antoine

of course - it is tSSH component
you must be sure - firewall is no block 22 port connection, and in case if (thought - yes) remote server is Windows, ssh service installed and enabled (it support native with Windows Server and many 3rd party servers available)

Related

How can I copy script from Rundeck server to a brand-new Windows Server

One of the requirements is to keep remote Windows Server intact.
No third party software allowed (no WinSCP, etc).
So we configure Windows Server with WinRM and allow remote access, AllowUnencrypted=true, Auth basic=true, etc...
Then we create job and execute command on Windows server like "ifconfig" successfully.
When it comes to executing inline script or copying file - Rundeck is trying to copy script/file to remote Windows server.
By default:
plugin.script-copy.default.command=get-services
where "get-services" seems to be free-form text rather than executable.
If we want to use SCP or SSH instead, here we have problem -> Windows Server doesn't have WinSCP or SSH or Python installed by default.
Is there any way to copy/deliver script to target/remote Windows Server 2008 using embedded capabilities only (no third-party software allowed) ?
Versions:
Rundeck 2.6.2 running on Linux
Windows Server 2008 R2 Enterprise, Service Pack 1
Thank you.
You can use the WinRM plugin (AKA "Overthere WinRM"), configure it, and use the copy file step on your job workflow (keep in mind that you need the 1.3.4 WinRM plugin at least which support copy file).
You need to download the plugin and put it in Rundeck the libext directory.
Add the Windows resources.xml entry (for "Overthere" WinRM plugin):
<node name="windows" description="Windows node" tags="" hostname="192.168.1.81" osArch="x86" osFamily="windows" osName="Windows 2008R2" osVersion="2008" username="user" winrm-protocol="http" winrm-auth-type="basic" winrm-cmd="CMD" winrm-password-storage-path="keys/winpasswd"/>
Set WinRM as your default node executor / default node file copier, and use the copy file step on your workflow like this.
So, this is important: the WinRM plugin isn't in active development (and Rundeck 2.6 branch is out of support/maintenance), the best way to deal with this is to move to the latest Rundeck version and use the PyWinRM plugin (out of the box with Rundeck, on active development and easiest to configure compared by the old "Overthere" WinRM plugin) and use the copy step as the same way.

Logon to remote server using powershell

Experts!
Is there any way to login to remote machines using powershell script earlier i tried with RDP automation but stuck with legal notice banner, my ultimate goal for login remote server using powershell is to make my entry in the server and it should reflect in available when checking reports for last logon users in server, i tried with establishing pssession but it doesn't show my entry.
Any ideas really helpful!! Thanks in advance

Terraform GCP: Run PowerShell in Windows instance on create

I have made a simple Terraform manifest that successfully initiates a Windows 2016 instance in GCP. As a next step I would like to execute a Powershell script to further configure and install software in the Windows instance.
I can not for my life find any example on how to execute a remote script through Terraform in a Windows GCP instance. For Linux instances it seems pretty straight forward, but how is it supposed to be done for Windows? Does anyone know any examples?
Any thoughts or ideas are much appreciated, thanks!
I had the same situation one month ago in the Oracle cloud. (I think the process is the same for all cloud providers.)
My situation: I have to run the winrm script to allow the communication from ubuntu to windows 2016 server to run the Ansible playbooks.
You can find the answer below.
https://github.com/terraform-providers/terraform-provider-oci/tree/master/examples/compute/windows.
I put my Powershell script (winrm) in the "userdata" folder and update the same in winrm.tf file. That's it.

Deployment of Windows Services on Remote Servers (Different Domain)

Is there a simpler way of deploying Windows Services from TFS than using a Powershell script, run on the TFS server, which:
Stops the existing Windows Service on the remote server
Copy the file on a shared folder on the remote server (copy-item)
Starts the Windows Service on the remote
If not, can any other continuous integration/deployment tool do this better?
As the TFS server is using a domain controller which is different from the remote server, can we share a folder for a specific user? I tried to run the powershell script as a user from the target domain controller, but of course, it is not recognized as a valid user on TFS server.
At last, is there any difference on deploying on an hosted remote server or on the cloud?
Thanks,
In tasks based build system (TFS 2015 +), you can try to install Windows Service Release Tasks, which contains tasks to start and stop windows services as well as change the startup type.

Powershell WinRM (WS-manager) service is not running after enabling it in group policy

I need to run remote powershell commands on a 2008 R2 server, so i enabled WinRM using the group policy
but then when i go into windows services to view the running services, the Windows Remote Management (WS-Management) is not on the list
so then when i try to run powershell commands that would setup WinRM
It says that the service is not running, thus i cant register the configuration; which is what i really need since i need to run powershell commands as PS version 2 and not version 3
has anyone encountered this before? does anyone have any idea of where to start looking?
thanks
First, you don't need WinRM or PowerShell remoting to run version 2.0. You just invoke powershell with that version:
powershell.exe -Version 2.0
As to your problem, I am not sure why the service is missing. Since you installed WMF 3/Powershell 3 yourself (I'm assuming, because it's 2008 R2), maybe you can try reinstalling or repairing it? Are there any messages in the event log? I admit I have never seen this before.
Have you used an installer for 2008 R2 that was customized or cut down, like the person who asked this question?