Static ARP entry disappears on restart in Windows Server 2003 - windows

I used the command line "arp -s IP MAC" command to set a static ARP entry on Windows Server 2003. When I ran "arp -a" it was there as a "static" entry. When I restart, it is gone. Is there some file somewhere like lmhosts where I can make this absolutely permanent?
Thanks!

don't need to be in a domain. local group policy can do, or startup script. however, I found even if log off, the static entry will be gone

I don't think there is already support for persistent configuration of ARP entries. However, you should be able to create a boot script that does that every time.
In Group Policy, go to Computer Configuration\Windows Settings\Scripts, add a startup script.

I had a Windows Server 2003 which wasn't in a domain, so the above answer didn't apply to me, although it does work for a box in an AD. The below Autoexecnt.bat script worked for me (and works in XP, too):
http://support.microsoft.com/kb/243486

Related

UIAutomation won't work in Windows Server (VPS) if I am not connected via RDP

I have script which uses mircrosoft's UIAutomation to automate an application. The script is inside a VPS running Windows Server 2012. The script works perfectly while I am connected to the VPS via Remote Desktop (RDP).
When I am not connected, the script seems to be stuck on SetFocus for a object... which leads me to believe that the script needs a Display/Screen/Session in order to work... but I am not sure if it is possible to do it while I am not connected to the VPS.
I can see 2 possible solutions here, either modify the script in someway to work in this environment or make the VPS have a virtual desktop while I am not connected (this solution might be more related to Server Fault rather than StackOverflow).
I am very confused, thanks for the help in advance :)
I managed to workaround the issue by actually connecting to the server to itself (to 127.0.0.1) via RDP so that it will always have an active RDP session for the automation script to run.
I am not happy with the results but it works... I cannot give clear instructions on how you would need to modify the settings in Windows to allow RDP connections from self, it was a one big trial and error process, I have to modify some policies in the Group Policy Editor and then some stuff that I don't remember.
There is another downside to this, a Windows server will allow 2 simultaneous connections to it but by using this method we are reserving a slot so only 1 connection at a given time is possible, something to be aware of.

WDS ImageUnattend does not run

We've successfully set-up WDS (Windows Deployment Services) and had it all working (it's serving an unattended Windows 7 x64 installation, the user only has to F12 then wait for the install to finish) but it no longer works the way it did before.
We're trying to F12 the exact same machine where it used to work. The WDS part of the installation is still automatic (unattended) but ImageUnattend.xml does not seem to run on the client at all now, it gets stuck at the language selection (everything after that is manual as well which is supposed to be automatic).
Inspecting C:\windows\panther on the client machine shows that WDS pops up with an error: WDS CallBack_WdsClient_CopyPrivatesDone: Failed to process client unattend variables.
Changing "%MACHINENAME%" to "*" in the ImageUnattend.xml file makes it all automatic again, however it then renames the computer incorrectly.
The variable %MACHINENAME% worked before, so why does it not work now? Has anyone else met this issue before?
Using a different user (domain administrator) in the ImageUnattend.xml file does not seem to change anything.
After countless of attempts with at least 15 new ImageUnattend.xml files, I decided to restart the server and use the original files I knew worked before.
This fixed it.

MobaXterm drag-and-drop panel missing

I need to run a program from my windows xP machine thats installed on a remote UNIX machine using MobaXterm but I have very little experience with this sort of thing.
I can login into the machine using ssh and start the program without a problem. That program needs files that I have on my windows computer to process though and I want to copy them over to that remote machine. Unfortunately the drag-and-drop file transfer panel that is mentioned regularly on mobaxterm help sites isn't present and I can't figure out how to make it appear.
Could someone suggest how to get that drag-and-drop panel to appear please? I'm using MobaXterm version 3.0.
Alternatively any explanation on how to transfer these files another way would also be very much appreciated.
Thank you very much for any help you can give.
If it still doesn't work when you try all of above methods, try this:
when you creat a Session, change the Advanced SSH setting-->SSH-browser type to SCP, which default is SFTP.
. thanks to willfurnass
Some Linux distributions or some other Unix systems have disabled SSH password authentication by default.
In order for MobaXterm to be able to launch the SFTP browser, you will have to re-enable this feature:
Edit the "/etc/ssh/sshd_config" file on your server, and comment the following line:
PasswordAuthentication no
Restart your SSH server using the following command: /etc/init.d/sshd restart
Connect using MobaXterm SSH client and you will notice that the SFTP tab will be correctly launched.
If you can not modify your remote server configuration, you can also perform your file transfers inside MobaXterm terminal using SCP. A sample SCP command would be:
scp -r /drives/c/Some/Place/On/Your/Local/Windows/Drive/ yourlogin#yourserver:/Some/Place/On/Your/Remote/Unix/Server/
Ensure you have "Display SFTP Browser" enabled in your session settings under "Advanced SSH settings".
Occasionally it doesn't reappear, which is solved by a restart MobaXterm.
Another cause for the lack of sftp panel is if you accidentally enter and store a bad sftp password. MobaXterm then appears to attempt an automatic log in, but silently fails to open the sftp connection.
To fix this, go to Settings>MobaXterm passwords management and delete the offending password. Here's a screenshot of the settings page, showing the password management link.
To be clear, I had already run through the settings mentioned by #Nicolas and #Didier (thanks, guys!). I was able to get the sftp tab when ssh'ing in to other hosts (which didn't have bad passwords stored). And I had in the past seen the sftp pane. This fix solved my problem.
If you've never seen the sftp pane, then try the other suggestions first.
Have you tried:
Turning the program off and on again?
Note: I read this hint in a comment, which saved me from a tidious process of unnecessary fixing mobaXterm, also I am hence not the only one with that behavior. Even though this might be the first thing you already tried, some might not have been trying and haven't been lucky enough to read through the comments - this is for them.
For the most recent versions, ensure you have selected 'SFTP protocol' in the'SSH-browser' selector:

How to run a batch file when window starts up? (log in issue)

Currently, I want a remote machine (Amazon EC2 instance) to run a batch file when the machine starts up, and the batch file will close the machine after finishing the tasks.
I tried to put the shortcut of batch file to the startup folder. However, it will be only ran when I use Remote Control Connection to Log in that machine.
So, any other way to solve this problem???
NOTE: I don't want to log in to that machine since there might be 10 remote machines running at the same time.
Any idea or thought is appreciated. Thanks a lot.
This looks a bit like the question Running Batch File in background when windows boots up, my answer there:
You can use autoexnt for this. It was original designed for windows NT, but is still working in newer versions of windows.
You have to download the Windows 2003 Resource Kit to get it.
Windows XP (I believe Vista and 7 its the same as well, not sure about NT/2000)
Run gpedit.msc
Local Computer Policy -> Computer Configuration -> Windows Settings -> Scripts (Startup/Shutdown)
Open Startup. Click Add... Script Name: is where you input or Browse the location of your batch script to run. Script Parameters you can leave blank if you have no additional parameters you wish to pass w/it.

How to ask a remote windows machine to automatically launch an application?

I have a windows server 2003 up in the internet.
But sometime I need to restart it.
After restart, I want one of the applications to run.
I want to do this all programatically.
I can now remotely restart the server.
But the question is how can I ask that piece of software to be executed (more precisely, I want to execute a .BAT file to ask a tomcat to run)?
Because I don't want to manually log in to the machine and start that application. That is time consuming. Is there any possible way, once the machine is started, my application will be run as well?
If you're developing an application that should always be running on the server, you probably need to implement it as a Windows service. For C#, see the classes in the System.ServiceProcess namespace -- you will need to inherit from ServiceBase.
Alternatively, you can set the program to be run as a scheduled task on boot. See the Task Scheduler API to do this.
You can install Cygwin and then do it the same way we'd do it on a Linux box: via ssh, using keys.
OpenSSH is not part of the default Cygwin install, so be sure to select it. It's in the Net category.
Then, after you've installed Cygwin and sshd, read /usr/share/doc/Cygwin/openssh.README to learn how to set up sshd as a service, so it will answer requests automatically, without you having to start the ssh daemon manually.
Finally, set up keys, as described in the link above.
Part of the ssh protocol is a way to ask a remote machine to launch a program. Setting it up with keys lets you do it without needing a password.
You could try xCmd, which is a freeware app to run a command on a remote machine.

Resources