Wednesday, July 22, 2015

FTP and Firewall issues

I am working on a project to get a nightly upload from one of our venders.  He creates a scheduled task that ftps a file to our ftp server every night.  This process that he runs uses FTPS which is what his uses to send to his other customers.  So my task really was our server able to accept ftps connections.  Our FTP server connects SFTP reliably but when I tried to connect using FTPS which is using an SSL connection I was receiving:
 Error: Connection timed out after 20 seconds of inactivity 
 Error:  Failed to retrieve directory listing
So I did some research and I found this site https://ftptest.net.  I was able to test my ftps connection to find out what was causing the timeout.  These were my results:
I was getting a connection timeout when connecting to MLSD.  I checked with the firewall guys and they showed me that port 990 which is the port that FTPS uses, was opened on the firewall.  What I did not know was that FTPS uses port 990 to authenticate users then assigns the user a random port for file transport.  This is what is known as a passive connection.  http://g33kinfo.com
The firewall guys opened the range of ports on the firewall for the ip address of the FTP server.
I ran my test again and was successful.


Friday, July 17, 2015

VBS for server serial number

If you call in equipment for support, it is always necessary for the tech at the other end to ask you for information that is related to the server in question.  Almost always you are not standing in front of the machine to get specifics such as the serial number.  Her is a little vb script that will get the serial number of the server that you are on.  

On Error Resume Next
Dim System
if Wscript.Arguments.Count >0 then
sSystem=Wscript.Arguments(0)
end if
ComputerName = InputBox("Enter the name of the computer you wish to query")
winmgmt1 = "winmgmts:{impersonationLevel=impersonate}!//"& ComputerName &""
Set SNSet = GetObject( winmgmt1 ).InstancesOf ("Win32_BIOS")
for each SN in SNSet
MsgBox "The serial number for the specified computer is: " & SN.SerialNumber
Next

This vb will create a dialogue box that will ask you for the name of the server.  After you put in the name and click ok another dialogue box will appear with the serial number of that server.  

Another tool that I use to get server info is Systeminfo.  This DOS command provides vital system configuration info for the server.