Is there a way to execute gacutil in to a particular (remote) machine given the IP address (or the workstation name) of the machine?
The machines in question are on an Active Directory Domain.
The user running the script probably won't have any special rights on either their local or the remote machine.
Some cases, will be administrator in machine.
Operating system is Windows XP , and remote machine Win2008 and Win2003.
Any programming language is fine but ideally scripting:
DOS Batch file (bat, cmd)
VBScript (WSH)
psexec
C# (worst option for me)
Have you tried Remote Gacutil? http://remotegacutil.codeplex.com/
You can always use psexec:
copy %Proj_folder%\SomeDll.dll \\destinationHost\c$\Temp
psexec \\destinationHost gacutil -I c:\temp\SomeDll.dll
Related
I tried to connect a Windows machine that exist in another domain than our TFS 2018.3 exist.
I added "SSH" task, and I created new SSH endpoint with the remote machine IP, username and password, without a private key. I configured in the remote machine access of SSH for this username & password.
In the SSH task, I configure a simple shell command: ls.
The TFS agent succeeded to connect the machine but failed with this error:
Unable to execute command or shell on remote system: Failed to Execute process.
Full log:
2019-08-15T13:22:54.1491966Z Trying to setup SSH connection to ********#myserverinanotherdomain:22
2019-08-15T13:22:54.4085564Z Successfully connected.
2019-08-15T13:22:54.8120684Z tr -d '\015' <"./sshscript_1565875374136" > "./sshscript_1565875374136._unix"
2019-08-15T13:22:54.8121422Z Unable to execute command or shell on remote system: Failed to Execute process.
2019-08-15T13:22:54.8121745Z
2019-08-15T13:22:54.8180230Z ##[error]Command tr -d '\015' <"./sshscript_1565875374136" > "./sshscript_1565875374136._unix" exited with code 4294967295.
I think because it's a Windows machine and I try to execute a shell script. If I will install Git bash, for example, it can help?
Does the SSh task support only Linux machines? if yes, how can I connect a machine that exists in another domain?
SSH being a communication protocol is agnostic of OS. It is not Linux specific. But there seems to be a limitation for using SSH task on windows machine/build agent. Take a look at this similar question here: Not able to run bash script from windows using vsts.
I haven't found a documentation that clearly declare the SSh task not support on Windows machine. But I have found a task which also uses SSH--Copy Files Over SSH task. And according to the Q&A in official link:
Is this task supported for target machines running operating systems
other than Linux?
This task is intended for target machines running Linux.
For copying files to a macOS machine, this task may be used, but authenticating with a password is not supported.
For copying files to a Windows machine, consider using Windows Machine File Copy.
Instead of SSH. You should be able to use a local account on the build server and when entering the credentials. The account must have the same password as the account in the other domain. In other works make sure build account which run on the build agent are able to connect another domain.
Also make sure there is a trust relationship between the domains.
Here is my situation:
At work I have to ssh into a server from various different machines. I frequently need to update the file on the remote machine but also save a copy locally (on whichever machine at work I am using).
I usually use emacs on the server I have ssh into but not always.
Is there a direct way to save the file I edited while ssh'd into the server on my local machine? I.e. pipe it to my local machine somehow?
I've 8 computers running Windows 8 (the basic edition) and I'm trying to run some application on each of them with a batch script.
I tried:
PsExec.exe -i -d -u USER -p PASSWD \\PCNAME explorer.exe
But it gives me:
PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
Couldn't access GATE1:
Access is denied.
It works fine on other PCs with Windows 7 Professional.
Does it works just on Pro edition? If so, is there a way I can run something remotely on Win 8?
I resolved the same PsExec "Access is Denied" error on a Windows 8 Pro 64-bit target machine with the following registry modification on the target machine:
Registry Location: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System
Add DWORD LocalAccountTokenFilterPolicy
Set LocalAccountTokenFilterPolicy to 1
(Reboot)
In domain based environment, Microsoft PowerShell Remoting may be an alternative to PsExec.
In workgroup setup, especially among many different versions of Windows it may get bit challenging.
PowerShell remoting requires PowerShell 2.0 on both client and server.
Also, ssh with it's all capabilities (including launching remote commands) works under Windows, even free servers (freesshd) and clients (PuTTY family) are available . Downside is requirement for highly privileged account (usually, in some Administrators group) - at least for initial setup.
The GATE1 part in your log is interesting - PsExec requires so called "admin share" enabled (not sure does it work in Windows 8). I'd bet it's not the system, but a network issue.
I am using OpenSSH for Windows in order to be able to connect a Linux machine to a Windows machine.
To do that I have installed a SSH server for Windows v5.6p1-2.
I also have declared the allowed users.
From my Linux machine, I connect to the Windows machine with "ssh user#machine" command.
My problem is that once connected, I get only some Windows environment variables but not all system and user defined variables.
Is it possible to get all the Windows environment variables ?
Thanks,
"This is to limit security holes."
Check this out it has a few solutions.
http://cygwin.com/ml/cygwin/2006-11/msg00394.html
I have to run a batch job which sits in the windows server from my unix box.
Or from my local machine.
The win server has a userName/Pwd .
How do i programmatically connect to the windows machine and run the batch?
(The batch will change some file permissions in that machine)
Please let me know if there is a better way of handling this situation
A lot of this depends on how you authenticate on the windows machine, the network relation you have to it from your local and unix machine and what level of permission you will need to run the task ons the remote batch file.
I can say that in Windows, you could start by possibly creating a script that stores the username and password needed to connect to the remote machine in a variable, and in that script have it connect to the machine over a network and run the batch as that user.
How woudl you connect to the remote windows server? is it on a LAN or VPN type environment, do you connect with ssh or do you normally map it over the network?>