Thursday, 20 April 2017

Resetting lost ESXi password

Works on ESXi 6.0

If you have access to vCenter..

# Just so it contains one or more VMHost objects.
# To reset all ESXi host passwords use
# $vmhosts = Get-VMHost

Connect-VICenter -Server 

$NewCredential = Get-Credential -UserName "root" -Message "Enter an existing ESXi username (not vCenter), and what you want their password to be reset to."

Foreach ($vmhost in $vmhosts) {
    $esxcli = get-esxcli -vmhost $vmhost -v2 #Gain access to ESXCLI on the host.
    $esxcliargs = $esxcli.system.account.set.CreateArgs() #Get Parameter list (Arguments)
    $ = $NewCredential.UserName #Specify the user to reset
    $esxcliargs.password = $NewCredential.GetNetworkCredential().Password #Specify the new password
    $esxcliargs.passwordconfirmation = $NewCredential.GetNetworkCredential().Password
    Write-Host ("Resetting password for: " + $vmhost) #Debug line so admin can see what's happening.
    $esxcli.system.account.set.Invoke($esxcliargs) #Run command, if returns "true" it was successful.

Friday, 7 April 2017

Removing all the crap from Windows 10

A great write up on how to remove all the detritus Microsoft installs onto Windows 10 OOB 

Wednesday, 5 April 2017

For the device-specific module (DSM) named Microsoft DSM, versions do not match between node

I was asked by a customer to introduce a new Hyper-V 2012 R2 core mode node into an existing cluster.
As always I checked the existing nodes for Windows updates and patched the new node accordingly. The Add node menu item was using in the failover cluster manager and all tests had been selected. Quickly the validation failed with the error below.

Upon closer inspection we can see that the Microsoft DSM version doesn't match! So Windows update was used to check for missing updates, but both nodes showed no updates available.

I used PowerShell to compare the MSDSM.SYS files on both systems, and as we can see below the FilePrivatePart is newer.

I Googled about to find out if there was a hotfix that might have updated the MSDSM.SYS file but no joy.

In the end we narrowed it down to the fact that the March preview update has updated the file. After rolling this out to all cluster nodes the validation passed and the new node was added.