Migrating a VMWARE VM to AWS using AWS PowerShell

In this topic we will describes the necessary steps to migrate a VMWare VM to the Amazon Web Services (AWS) using PowerShell. You could also migrate VM using AWS command line tools, but I found using PowerShell is much easier than command line tools.


Preparing VMware Guest:

There are few things need to be fix before you start migrating VM to AWS.

  • Remove all snapshots from snapshot manager.
  • Partition must be IDE – All the partition must be IDE, if anyone of them is SCSI, you have to convert it to IDE.
  • Primary system drive of the VM must be C: drive, if not you have to change it. (http://support.microsoft.com/kb/223188)
  • Uninstall VMware Tools.
  • You must enable Remote Desktop and also make sure it is not getting blocked by firewall.
  • Reset local administrator password. It is always recommended to create one additional local admin user account.

Continue reading

How to reset windows password (offline) on AWS Windows Instance

In simple word changing/resetting windows password is a very simple task using any third party free or paid tools as long as you able to access server console. Even on virtual platform like Hyper-V VMWare you have access to server console, but when it comes to AWS, there is no way to access console of a virtual instances. So, those tools will not work, as those required user input / virtual CD or USB boot, which is not available in AWS.

I have found a solution to reset the password of any AWS windows instance. If you know the local user id, then it will be very easy to reset the password of that account.

You have to perform the following steps.

  • First you have to stop the instance.
  • Then you have to identify the root volume (/dev/sda1) of that instance. You could get this information using one simple function I wrote (GetInstanceVolumeDetails InstanceID).
  • Once you identified the root volume, Took a snapshot backup of root volume.
  • Now you have to dismount this volume and remount it on any other working instance as additional volume.

  • This volume mounted as G: drive on working instance. Now you have to create one service using srvany.exe (http://support.microsoft.com/kb/137890) to rest the password of Administrator account during system startup. To configure this you have to load up the system registry hive of faulty instance from G:WindowsSystem32ConfigSYSTEM as _SYS under HKEY_LOCAL_MACHINE and imported following registry

  • Now placed srvany.exe under G: drive.

Continue reading

Port Scanner using PowerShell with Email Notification

Few days back I was asked to create a script, which will check RDP port status of multiple servers and send the result as an email notification. I have searched for few, but unfortunately there was no ready script for that. I decided to build one using PowerShell, and came out with following script.

Hope this script might help you as well.