• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • Unexplored Territory Podcast
  • HA Deepdive
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

HAL check?!

Duncan Epping · Nov 14, 2008 ·

My post about reverting your HAL triggered Alanrenouf to create a short, but very cool script that compares the amount of cpu’s to the windows HAL you’ve chosen. This way you will know within a second if you need to change the HAL of any of your vm’s! Cool stuff:

connect-viserver MYVISERVER
$myCol = @()
ForEach ($VM in (Get-VM))
{
$MyDetails = “” | select-Object Name, HAL, NumvCPU
$MYDetails.Name = $VM.Name
$Hal = Get-WmiObject -ComputerName $VM.Name -Query “SELECT * FROM Win32_PnPEntity where ClassGuid = ‘{4D36E966-E325-11CE-BFC1-08002BE10318}'” | Select Name
$MYDetails.HAL = $Hal.Name
$MYDetails.NumvCPU = $VM.NumCPU
$myCol += $MYDetails
}
$myCol

Related

Management & Automation p2v, powershell, Scripting

Reader Interactions

Comments

  1. wally says

    17 November, 2008 at 10:01

    Hmm, not the expected result:

    ERROR: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

    What account is used for the wmi query ?

  2. Chris Dearden says

    17 November, 2008 at 12:10

    sounds like a great script although I’m getting Invalid query entries on the get-WMI stage.

  3. Chris Dearden says

    17 November, 2008 at 12:11

    Wally,
    I found that I had to run powershell under my Domain Admin credentials instead of just loggin into VC with my elevated permisssions.

  4. Duncan Epping says

    17 November, 2008 at 12:23

    it needs the domain admin probably to access the other machines…

  5. Sven says

    19 November, 2008 at 15:16

    Hi, I get a error

    The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

  6. Lennard says

    14 January, 2009 at 14:37

    If you’re getting Invalid Query results, check the quotes when you paste the script into a file. The single and double quote characters are stylised open/close quotes, and not the ambiguous ‘” style.

Primary Sidebar

About the Author

Duncan Epping is a Chief Technologist and Distinguished Engineering Architect at Broadcom. Besides writing on Yellow-Bricks, Duncan is the co-author of the vSAN Deep Dive and the vSphere Clustering Deep Dive book series. Duncan is also the host of the Unexplored Territory Podcast.

Follow Us

  • X
  • Spotify
  • RSS Feed
  • LinkedIn

Recommended Book(s)

Advertisements




Copyright Yellow-Bricks.com © 2025 · Log in