Pages

Wednesday, August 1, 2018

No Virtual Disk in WinPE or WinRE on VMware Virtual Machine


No Virtual Disk in WinPE or WinRE on VMware Virtual Machine.

Being System administrators, sometimes we are in a situation to repair or boot a Windows machine into WinRE (Windows Recovery Environment) or WInPE (Windows PreExecution Environment) to troubleshoot.

I was working with a Server which was hosted on VMware in a firewalled environment with no domain access and unfortunately the Server/Application owner had forgotten the password of local account (Administrator) and reached out to me seeking if there is a way to recover the lost password or regain access to the server by any means.

Well.. there are so many trusted and untrusted ways available to help you regain access to the system but I rely on a way which does not require any third party tool or ISOs to do it and I have documented it in one of my previous posts (https://adminthing.blogspot.com/2016/12/windows-password-recovery.html)

I had previously created a stripped down ISO of Windows Server 2008 of ~300 megs using WAIK (Windows Automated Installation Kit) just to boot such windows machines in WIN PE instead of using a ~4 Gigs ISO of any other Windows OS. After booting the server from that Windows ISO, there were no disks being shown on it though there were two disks on the server and when booted normally it was booting up just fine to the OS (Windows Server 2012 R2) but we had no logon access to it. Lets go through it step by step here:

⦁    I booted the VM with the Stripped down ISO of Windows Server 2008.

 VM Booted with an ISO containing stripped down version of Windows Server 2008.

VM showing no disks attached to it.

⦁    I tried booting the machine with a complete Windows OS ISO too to see if that is able to detect the disks but with no luck.

⦁    I was sure that it is definately a driver issue and because of missing drivers of the Disk and SCSI controllers the VM in WINPE was unable to detect any hard disk to it.

⦁    Now I copied the drivers folder from a Windows machine where VMwareTools was installed from ("C:\Program Files\Common Files\Vmware\Drivers") and added it to the ISO image that I was using to make sure those drivers are available to me in the WinPE session. (this Drivers folder contains all the drivers that VMwareTools provides to the OS so we can use any other driver like network adapter vmxnet3 as well if needed). If you want you can download the ISO with added drivers in it from here.

⦁    After adding the Drivers folder from C:\Program Files\Common Files\Vmware\Drivers to the ISO, I rebooted the server again from updated ISO image.

⦁    Now the drivers have just been made available to me in the WinPE session but they are not yet loaded so the disks will still not be shown unless they are loaded.

 There is a folder named DRIVERS inside the CD-ROM.

⦁    Microsoft provides a small utlity called "drvload.exe" in the WinPE images which enables you to load drivers for any devices that you want which are attached to the Server.

It shows different drivers available inside the folder which contains all the drivers VMtools provides

⦁    We will now load the drivers found in PVSCSI folder found under C:\Program Files\Common Files\Vmware\Drivers which is for the SCSI controller attached to the VM on which the Hard drives are connected.

We loaded the driver (.inf) file called PVSCSI.INF using drvload

⦁    Now we will have to do a rescan of attached hard disks on the server to be able to see it, We will use Diskpart to rescan for the Hard Drives now.

Launch diskpart and rescan for hard disks

⦁    Now we can see that there are disks available so we can proceed with further troubleshooting which requires disks to be available on the server. I had to do a password reset for my existing local ID so I followed my article https://adminthing.blogspot.com/2016/12/windows-password-recovery.html to reset and I was done.

Happy Troubleshooting :)

Please let me know your comments or feedbacks to this article if you have any :)






Tuesday, May 22, 2018

Convert a Dell Service Tag to Dell Express Service Tag using PowerShell

Convert a Dell Service Tag to Dell Express Service Tag using Powershell

Sometimes we need to talk with Dell to consult for an issue that we are dealing with for any Dell hardware and we are needed to provide the hardware's Express Service Tag or Service Tag, We can easily obtain a Server's service tag from the server by internal commands like WMIC (In case of Windows) or dmidecode in case of Linux but finding out the Express Service Tag becomes difficult sometimes as you have to either logon to the iDRAC or Open Manage server Administrator to obtain it or convert it from Dell's Support site.

I have written a simple script which can translate a Dell Service Taginto Express Service Tag.

This script can also be downloaded from Microsoft Technet Gallery
https://gallery.technet.microsoft.com/scriptcenter/Convert-a-Dell-Service-tag-3754c3ea?redir=0
 

## This Script has been written for converting a Dell Service Tag into Express service Tag
## Author : Prakash Kumar (prakash82x@gmail.com) May 22th 2018
## www.adminthing.blogspot.com
## Please use this script at your own risk.
##
## Usage:
## Since this has a function so it needs to be loaded into the memory of PS console by dot sourcing it: **
## PS C:\> . ./ConvertTo-ExpressServiceTag.ps1
## PS C:\> Convertto-ExpressServiceTag A1B2C3D

Function ConvertTo-ExpressServiceTag{
param(
    [Parameter(
    Mandatory=$True,
    Position=0,
    ValueFromPipeline=$True,
    ValueFromPipelineByPropertyName=$True ,
    HelpMessage="A Dell Service Tag as input is needed !!")][System.String]$ValB36 )
  
    Begin{}
  
        Process{
        $Range = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        $ca = $ValB36.ToUpper().ToCharArray()
        [System.Array]::Reverse($ca)
        [System.Int64]$ValB10=0
   
        $i=0
        foreach($c in $ca){
            $ValB10 += $Range.IndexOf($c) * [System.Int64][System.Math]::Pow(36,$i)
            $i+=1
        }

        Write-Host -ForegroundColor Yellow "`nService Tag `t `t `t : `t $ValB36 `nExpress Service Tag `t :`t $ValB10"
    }

    End{}
   
}

Here is how to do this.