Tag Archives: windows

Windows. Stop 0x0000007B. How to add a mass storage driver manually

Hi,

this posts describes which steps are necassary to add or repair a masstorage driver in an exiting Windows installation.

If a Windows boot ends with a bluescreen STOP 0x0000007B INACCESSIBLE_BOOT_DEVICE, the system is unable to load a driver for your disk controller properly.

It is possible to correct this and respective, if the hardware changed, to add a driver manually.

The masstorage device driver is registered in Windows at five positions:

  • The Driver file (.sys) itself must be stored in %Systemroot%\system32\drivers
  • The Signature file (.cat) is stored in
    %Systemroot%\System32\catroot\{F750E6C3-38EE-11D1-85E5-00C04FC295EE}
  • The Install file (.inf) is located at %Systemroot%\inf
  • The Registry Key to start the driver => the service entry
  • The Registry Key to load the driver at the begin of the boot process => the CriticalDeviceDatabase

An example. Installing the Intel Rapid Storage (RST) Driver. Download the driver from the Homepage of the manufacturer, extract it and copy the files to an USB Stick or burn a cd.
Continue reading Windows. Stop 0x0000007B. How to add a mass storage driver manually

VMware: A (incomplete) list with some PowerCLI Scripts for vSphere

Hi,

for VMware vSphere a very powerfull Scripting engine is available which is called PowerCLI. PowerCLI based on, the also very powerfull, Microsoft powershell.

The Basics

Get the PowerCLI package from the VMware website and install it on your Windows Computer or on the VMware vCenter Server. Ok, lets start.

Open  PowerCLI Command prompt by clicking “VMware vSphere PowerCLI (32-Bit)” Icon. Note: The 64Bit Version(both the 32Bit and 64Bit versions were installed) did support all commands. For example when you clone a computer by the New-VM Command-Let and specifiy the OSCustomizationSpec parameter the follwing error was thrown.

New-VM -VM "ComputerTemplate" -Location "Windows Clients" -ResourcePool Resources -OSCustomizationSpec "Windows XP Client"  -Datastore esxdatastore0 -Name "COMPUTER1"
New-VM : 26.06.2013 23:37:42    New-VM         is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

However start the 32Bit Version :-). First you have to connect to your vCenter. If your Windows Account, with which you logged on, have the appropriate rights to connect to vCenter simply call

Connect-VIServer NameOfYourvCenter.domain.com

If logon successeds 2 global object variables are set to which all following commands refers to.

global:DefaultVIServer         NameOfYourvCenter.domain.com
global:DefaultVIServers        {NameOfYourvCenter.domain.com}

Alternatively you can assign the vCenter Object to a variable and append the -Server <VIServer[]> parameter to each command. This is usefull if you have multiple instances of vCenter.

$oSecondVCenter=Connect-VIServer NameOfYourvCenter.domain.com
Set-Vm -VM "OldName" -name "New-Name" -Server $oSecondVCenter

By default, all command are executed synchronous. This means the command prompt returned not until the tasks is finished. To start jobs asynchronus append the -RunAsync parameter to each command line.

Lets start with some example scripts
Continue reading VMware: A (incomplete) list with some PowerCLI Scripts for vSphere

Windows: Network interface order

Hi,

some Licensemanager uses the first MAC Address found in system as the HostID. You can use the getmac.exe command to show the list with all NICs.


[H:\]getmac


Physical addresse   Transport Name
=================== ===================================================
5C-9A-D8-AE-DC-0D   \device\TCPIP_{c6a12685-4aed-49a8-b26b-dce59b81b911}
00-DE-94-17-CA-0F   \device\TCPIP_{9f963344-edae-4a42-a992-bb9bc05672bb}
00-CA-BE-17-CA-0F   \device\TCPIP_{ad634d51-ccee-43d5-bef6-ce5749b4cdfd}

In this example 5C-9A-D8-AE-DC-0D was used as the host id. Sometimes, after installing a additional LAN adapter or by removing one, these alignment is disordered and the licensemanager won’t start.

These order is indent by the subkeys of

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}

Each Network Interface has its own subkey started by 0000. The lowest Keynumber is the first in the output of getmac. So order your NICs as you want by renaming the keys(4-digit numbers)

Michael

Windows: Set network parameters from command line by using WMIC.exe

Hi,

you can use wmic.exe  to set some network parameters (and much more, its WMI!!) from command line. Syntax is very hard, but it works :-).

For Example. If you want to disable the DNS registration of all enabled Intel e1000 network adapters.

wmic path Win32_NetworkAdapterConfiguration where (IPEnabled="true" and ServiceName="E1G60") call SetDynamicDNSRegistration False,False

The Filter in the braces is the where condition of wmi “select * from NetworkAdapterConfiguration where IPEnabled=’true’ and ServiceName=’E1G60′ ” statement.  Modify this for your needs. By using WMI queries this is much more flexible than netsh command lines.

Michael

OpenVPN: Generate a random MAC Address for TAP Interfaces on Windows

Hi,

if you use some image based technology to deploy your Windows installation, for example SCCM, MDT, Acronis and/or sysprep based, and OpenVPM is already included, the MAC Address of the TAP LAN interface isn’t changed by that way. But a unique MAC Address is requiered if the clients conntects to the same OpenVPN server. If multiple clients have the same MAC Address ping from VPN Clients sometimes fails with error “TTL expired in transit” and the VPN connection is unstable.

This powershellscript sets a MAC Address for each OpenVPN TAP adapter. In detail:

  • Creating a Eventlog TAPsetMAC
  • Get all instances for TAP Adapters by reading HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\MatchingDeviceID == “tap0901”
  • Generate a random MAC Address. Starting with Prefix defined in $sMACPrefix.
  • Writing the MAC to each Adapter
  • Log the result to the EventLog
########################################################
# Generate a random MAC for all OpenVPN tap LAN interfaces
#  Michael Albert
#  05.04.2013
# License: GPLv2
########################################################
# HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}
# MatchingDeviceID tap0901
# REG_SZ MAC=00-FF-8F-E3-A1-AE
$oRandom=New-Object System.random
function fGetRandomMAC([string]$sMACStart){
     if($sMACStart.length -ge 0 -and $sMACStart.length -le 11){
          for($iLoop=$sMACStart.length; $iLoop -le 11; $iLoop++){
               $iChar=$oRandom.Next(16)
               $sMACStart+=[String]::Format("{0:x}", $iChar).ToUpper()
          }
          return($sMACStart)
     }
     else{
          return $false
     }
}
function fConvert2MAC16([string]$sMAC12){
     [string]$sMAC16=""
     if($sMAC12.length -eq 12){
          for($iLoop=0;$iLoop -le 11;$iLoop++){
               $sMAC16+=$sMAC12.SubString($iLoop,1)
               if((($iLoop+1) % 2) -eq 0 -and ($iLoop+1) -lt 12){
                    $sMAC16+="-"
               }
          }
          return $sMAC16
     }
     else{
          return $false
     }
}
###############################################################################
# Currently not used but defined :-)
function fValidMAC([system.string]$sMAC){
          $RegExIP=new-object System.Text.RegularExpressions.Regex("^([0-9a-fA-F]{2}\-){5}([0-9a-fA-F]{2})$")
          return($RegExIP.IsMatch($sMAC))
}
###############################################################################
## MAIN
###############################################################################
$sMACPrefix="00FF8F"
if(! [System.Diagnostics.EventLog]::SourceExists("TAPsetMAC")){
     New-EventLog -Source TAPsetMAC -Log Application
}
$aTAPAdapter=Get-ChildItem "registry::HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}" -ErrorAction SilentlyContinue |where-object{$_.GetValue("MatchingDeviceID") -eq "tap0901"}
foreach($rTAPAdapter in $aTAPAdapter){
     # Get-ItemProperty -Path "registry::HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}"
     if(! ($rTAPAdapter.GetValue("MAC"))){
          #$rTAPAdapter
          #$rTAPAdapter.Name
          # Get-ItemProperty -Path ("registry::"+$rTAPAdapter.Name)
          $sMAC=fGetRandomMAC $sMACPrefix
          if($sMAC16=fConvert2MAC16 $sMAC){
               Write-Host -NoNewline  "Set MAC of TAP Adaper to" $sMAC16 "..."
               $Error.Clear()
               New-ItemProperty -Path ("registry::"+$rTAPAdapter.Name) -Force -Name MAC -PropertyType String -Value $sMAC16|Out-Null
               if(! $Error){
                    Write-Host "ok"
                    Write-EventLog -LogName Application -Source TAPsetMAC -EntryType Information -EventID 666 -Message ("TAP LAN Adapter: Altered MAC Address to "+$sMAC16)
               }
               else{
                    Write-EventLog -LogName Application -Source TAPsetMAC -EntryType Warning -EventID 666 -Message ("TAP LAN Adapter: Failed to altered MAC Address to "+$sMAC16)
               }
          }
     }
}

Michael