Thursday, February 2, 2017

Testing Anonymous SMTP using Telnet

You can use telnet to test anonymous SMTP, but I do it so infrequently that I always have to look up the SMTP commands.  The following is taken from: https://www.lumension.com/kb/Home/Endpoint-Security/949.aspx

PROCEDURE

To test the mail server, perform the following:
  1. Open a command prompt
  2. Run "telnet smtp-server.domain.com 25" (replace smtp-server.domain.com with your actual SMTP server.  If the SMTP port has been modified, be sure to use the correct port assignment.  By default, SMTP communicates on TCP port 25)
  3. A connection will be established on port 25 (or modified assignment) if the SMTP server is online
As an example, the Exchange Server may answer with the following output:
220 mailserver.domain.com Microsoft ESMTP MAIL Service, Version: 5.0.2195.5329 ready at Sat, 22 May 2012 08:34:14 +0200
Try the following to send an E-Mail from the command prompt (blue = your commands):   
220 mailserver.domain.com Microsoft ESMTP MAIL Service, Version: 5.0.2195.5329 ready at  Sat, 22 May 2012 09:01:29 +0200
helo myserver.domain.com 250 mailserver.domain.com Hello [10.12.150.2]
mail from:<myname@mydomain.com>
250 2.1.0 myname@mydomain.com....Sender OK
rcpt to:<recipientname@mydomain.com>
250 2.1.5 recipientname@mydomain.com
data
354 Start mail input; end with <CRLF>.<CRLF>
subject: This is a test mail
to: recipientname@mydomain.com
This is the text of my test mail.
.

250 2.6.0 <exchange.domain.com> Queued mail for delivery
quit

Friday, February 26, 2016

Remotely change the IP address of a Windows PC


Command line to spawn a cmd.exe process on remote computer :
psexec.exe \\computername -u computername\administrator cmd.exe
It should then ask you for administrator password, and then spawn process.  From there you can start playing with netsh as like you are on the remote computer, here a main command lines for netsh control :
  • Display IP configuration : netsh interface ip show config
  • Change default gateway on Windows XP : netsh interface ip set address “Local Area Connection” gateway=192.168.0.1 gw=0
  • Change ip, netmask and default gateway on Windows Vista/7/8 : netsh interface ip set address “Local Area Connection” static 192.168.0.10 255.255.255.0 192.168.0.1
  • Change main DNS server : netsh interface ip set dns “Local Area Connection” static 192.168.0.1
  • Add a second DNS server : netsh interface ip add dns “Local Area Connection” static 192.168.0.2
 Note : Remember to input correct “Local Area Connection” on previous commands.

Play with netsh -r

You can remotely change IP config on an domain administrator account using the following switch of netsh command : -r
For example : netsh -r REMOTE_MACHINE_NAME interface ip show config

Thursday, March 12, 2015

Measuring IOPS on a Storage System using Powershell

I came across this great powershell script that uses SQLIO to measure IOPS and transfer speeds.
Source is here

The key differentiation in parameters (at least for me) is the -TestMode parameter.  Use Get-LargeIO to test transfer rates and Get-SmallIO to check IOPS.




Tuesday, October 28, 2014

Kernel Panic in CentOS Virtual Machine after yum update

After performing updates to the virtual machine, the vm kernel panics.  Hit space on the boot screen and select the old kernel.  Then open a terminal and do the following substituting your kernel version.

mkinitrd --with=hid-base-hv --with=hid-hyperv --with=hv_utils --with=hv_vmbus --with=hv_storvsc --with=hv_netvsc /boot/initrd-2.6.18-371.8.1.el5.img 2.6.18-371.8.1.el5 -f

From: http://community.spiceworks.com/topic/486741-kernel-panic-after-migrating-centos-5-10-to-hyper-v

Tuesday, May 20, 2014

Timeout Errors When Trying to Move a VM from one Hyper-V 2012 server to Another.

I had an issue where I could move VM's in one direction only.  The resolution was to add some attributes to the AD object.

  • Make sure "Advanced Features" is turned on (View->Advanced Features) and then locate your server object in Active Directory.  
  • Right Click, go to properties, and click Attribute Editor. 
  • Find "servicePrincipalName" and click Edit.
  •  Make sure the following records exist. If not, add them (I had to add all 4).
    • Note: SERVERNAME is the name of your server and DOMAIN is your domain name.
    • Microsoft Virtual Console Service/SERVERNAME
    • Microsoft Virtual Console Service/SERVERNAME.DOMAIN
    • Microsoft Virtual System Migration Service/SERVERNAME
    • Microsoft Virtual System Migration Service/SERVERNAME.DOMAIN
Tried the move immediately following this update and it was successful.

Wednesday, February 26, 2014

VSS Writers and their Corresponding Services

When backup operations fail due to failed writer "vssadmin list writers" can be utilized to check the current status of the writers.  However, it can be difficult to determine which service needs restarted to correct the writer.  The following list was obtained from a blog at http://www.planetcobalt.net/sdb/vss_writers.shtml.

VSS Writer Service Name Service Display Name
ASR Writer VSS Volume Shadow Copy
BITS Writer BITS Background Intelligent Transfer Service
COM+ REGDB Writer VSS Volume Shadow Copy
DFS Replication service writer DFSR DFS Replication
DHCP Jet Writer DHCPServer DHCP Server
FRS Writer NtFrs File Replication
FSRM writer srmsvc File Server Resource Manager
IIS Config Writer AppHostSvc Application Host Helper Service
IIS Metabase Writer IISADMIN IIS Admin Service
Microsoft Exchange Writer MSExchangeIS Microsoft Exchange Information Store
Microsoft Hyper-V VSS Writer vmms Hyper-V Virtual Machine Management
NTDS NTDS Active Directory Domain Services
OSearch VSS Writer OSearch Office SharePoint Server Search
OSearch14 VSS Writer OSearch14 SharePoint Server Search 14
Registry Writer VSS Volume Shadow Copy
Shadow Copy Optimization Writer VSS Volume Shadow Copy
SPSearch VSS Writer SPSearch Windows SharePoint Services Search
SPSearch4 VSS Writer SPSearch4 SharePoint Foundation Search V4
SqlServerWriter SQLWriter SQL Server VSS Writer
System Writer CryptSvc Cryptographic Services
TermServLicensing TermServLicensing Remote Desktop Licensing
WMI Writer Winmgmt Windows Management Instrumentation