How to recover information in VMware.Vim.HostCpuIdInfo

Hi all!

I'm looking for a way to display all the VM and the mask of CPUID for edx value save as level 80000001 via PowerCLI.

The following article describes how to set up, but I'm not talented enough to figure out how to debone the script to simply display information or perhaps export to CSV.

http://ICT-freak.nl/2009/08/19/PowerCLI-set-CPU-identification-mask/

Can someone please help?

Thank you

JR

Up to 88 views and no one was able to help. I thought about it.

Complete with all your servers in 2012 INI and run the following script.

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

# Script name: Server2012R2_CPUFix_Audit.ps1

# Created by: Jordan Ruocco

#

# Script required: PowerCLI for VMWare 5.5

# Description: Audits of all VM and the mask of CPUID value

# for edx register below 80000001

#

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

# Functions

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

Function Write-Log($strServer,$strMessage)

{

$strLogFile = "\\SERVER\Scripts$\Scripts\Logs\GetVM_cpuidmask.log".

$strLogString = (get-Date). "ToShortDateString() +" "+(Get-Date). ToShortTimeString() + ',' + $strServer + ', ' + $strMessage

Write-Host $strLogString

Add-Content $strLogFile $strLogString

} Function #End: writing-Log

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

# End of functions

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

# Main program

#-------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

$vms = get-content "\\SERVER\scripts$\Scripts\Server2012.ini".

{foreach ($vm to $vms)

$confs = get - VM $vm | Get-View

{foreach ($conf in $confs)

$vmName = $conf. Name

#write - host $vmName}}

$goodflagLocation = 4

$badflagLocation = 11

$mask = $conf. Config.CpuFeatureMask

$cpuLvl80000001 = $mask | where {$_.} Level - eq 0 x 80000001 - and! $_. Seller}

If ($cpuLvl80000001 - not $null) {}

$gooddefaultFlag = $cpuLvl80000001.Edx.ToCharArray () [$goodflagLocation]

$baddefaultFlag = $cpuLvl80000001.Edx.ToCharArray () [$badflagLocation]

If {($gooddefaultFlag-eq "0")}

If {($baddefaultFlag - eq "H")

Writing-Log $vmName «BAD»

}

else {}

Writing-Log $vmName 'GOOD '.

}

}

}

else {}

Writing-Log $vmName 'NO 2012R2 '.

}

}

}

Tags: VMware

Similar Questions

  • Information on vmware-vim-cmd, please

    Hello

    Where can I find detailed information about VMWARE-VIM-CMD please?

    Thank you.

    I've not seen an "official" document of all the features of vmware.  In this case, I think that google is your friend.  A lot of people have documented pieces that they understood.

    http://www.vServer-online.de/blog/MRU/vimsh?lang=en#more-348 this link is good to help you get started.

  • How to recover a HostSystem via vmware.vim?

    I'm trying to use the c# vmware sdk to retrieve a host represented as an object HostSystem. I have no Center and no cluster, only the single host I'm connected to. How to recover a HostSystem representing this host?

    After much trial and error, it works (c#):

    public List {GetHostSystems()}

    List hostSystems As new List();

    try {}

    Data Center Data Center (data center) = vSphereClient.FindEntityView (typeof (data center), null, null, null);

    A folder (Folder) = vSphereClient.GetView (dataCenter.HostFolder, null);

    foreach (ManagedObjectReference mObjR in the folder. ChildEntity.Where(x => x.Type == "ComputeResource")) {}

    ComputeResource computeResource (ComputeResource) = vSphereClient.GetView (mObjR, null);

    {foreach (ManagedObjectReference hostRef in computeResource.Host)

    hostSystems.Add ((HostSystem) vSphereClient.GetView (hostRef, null));

    }

    }

    }

    catch (Exception e) {}

    throw (e);

    }

    Return hostSystems;

    }

  • How to recover the information about logon to outlook express

    I am using outlook express, but have forgotten my login data. How to recover?

    Contact your ISP. They know your logon information, as it is the same if you want to get your mail from their Web site.
  • How to create table of type vmware.vim.OptionValue]

    $o = New-Object vmware.vim.OptionValue
    
    PS H:\> $o = New-Object vmware.vim.OptionValue[]
    New-Object : Constructor not found. Cannot find an appropriate constructor for
    type vmware.vim.OptionValue[].
    At line:1 char:16
    + $o = New-Object  <<<< vmware.vim.OptionValue[]
    

    This constructor is missing

    I use a loop.

    $t = @()
    for($i=0; $i -lt 10;$i++){
         $t += New-Object VMware.Vim.OptionValue
    }
    
  • After the Virtual Machine is hot migrated lose the reference to the virtual computer object (VMware.Vim.VirtualMachine)

    Hello

    In my VB.Net application, I retrieve the virtual computer object (VMware.Vim.VirtualMachine) through scripting Powershell VI.

    If the Virtual Machine is migrated to another host (hotmigrate) I receive an event (VMware.Vim.VmMigratedEvent), which also holds the moref of the Virtual Machine. I tried to use the updateview method to refresh the virtual computer object but failed with an error message stating that the object could not be found, or never existed.

    I also tried to recover the virtual computer object again, throug the method Client.GetView and the moref returned by the event, but the same error message.

    How can I get my hands on the virtual computer object or update after migration to another host takes place. I have to get it back again? It would be great if I could do it somhow with information from moref I hold the event!

    Any help is appreciated!

    Concerning

    Manfred

    Sorry, but I can only show you how to do this in PowerShell.

    I use the purpose of the task to get to the prompt MoRef.

    Here's how:

    $vmName = 
    $tgtHost = 
    $tgtPool = 
    
    $vm = Get-VM $vmName | Get-View
    $poolMoRef = (Get-ResourcePool $tgtPool | Get-View).MoRef
    $esxMoRef = (Get-VMHost $tgtHost | Get-View).MoRef
    
    $task= Get-View ($vm.MigrateVM_Task($poolMoRef, $esxMoRef, "lowPriority", "poweredOn"))
    
    while($task.Info.State -eq "running" -or $task.Info.State -eq "queuing"){
      $task.UpdateViewData()
    }
    
    $vmImpl = Get-VIObjectByVIView -MORef $task.Info.Entity
    

    I don't know how you get at the VmMigratedEvent event, but the MoRef in there is pointing to the correct prompt.

    In the following script, I extracted all the events related to the task of vMigrate immediately after the vMigrate task finished

    function Print-VmName{
         param($event)
    
         $MoRef = New-Object VMware.Vim.ManagedObjectReference
         $MoRef.Type = $event.vm.vm.type
         $MoRef.Value = $event.vm.vm.Value
         $vm = Get-View $MoRef
         Write-Host $vm.Name
    }
    
    $events = Get-VIEvent -Start (Get-Date).addminutes(-15)
    $events | % {
         $event = $_
         $eventType = $_.GetType().Name
         switch ($eventType){
              "VmMigratedEvent" {
                   $eventType
                   Print-VmName $event
              }
              "VmEmigratingEvent"{
                   $eventType
                   Print-VmName $event
              }
              "VmBeingHotMigratedEvent" {
                   $eventType
                   Print-VmName $event
              }
              "TaskEvent" {
                   $eventType
                   Print-VmName $event
              }
         }
    }
    
  • Update boot entry automatic using vmware-vim-cmd (or vmware-vimsh)

    Hello

    Is there an example of how update the automatic start-up using vmware-vim-cmd input.

    The problem that I am running is

    1. when I type

    VMware-vim-cmd hostsvc/autostartmanager/update_autostartentry 16 powerOn-1 1-1 systemDefault systemDefault

    When 16 is one of my VMIds, I get the following

    Invalid option '1'

    Use: update_autostartentry VMId StartAction StartDelay StopAction StopDelay WaitForHeartbeat Strafpkt

    I can't understand what the invalid option '1'.

    Here's what I've done so now

    1. research in the communities for examples. There are a few messages, but none seem to provide real-world examples of work (beyond the use of message)

    2. I found this link http://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.host.AutoStartManager.AutoPowerInfo.html who talks about what type of entry it is pregnant. I tried double quoting and only citing the parameters of xsd: String, but that did not work either

    3. I tried the particular settings (including the xsd: int) doublequoting, which did not work either

    Anyone successful with this? If so could you please post a real example.

    Here's what I'm trying to accomplish

    1 activate Autostart - I did that using

    / usr/bin/VMware-vim-cmd hostsvc/autostartmanager/enableautostart true

    2. get all VMIds in the system

    I did it with the following command and awk script

    / * Awk script * /.

    BEGIN {}

    FS = ""

    NR 1 >

    }

    {

    If (NR == 1) {}

    #ignore header

    }

    else {}

    1. $1 has VMIds

    Print $1

    }

    }

    / * End awk script * /.

    Then run/bin/awk f /root/autostart.awk

    3. instead of printing on $1, I would like to add the virtual machines to the list using the following

    a. start-up delay = systemdefault

    start-up (b) action = poweron

    c. start order = 1, 2, 3, 4 (do not need help with AWK script), I can post once I have that.

    d. stopaction, stopdelay etc. - leave at the default system (or - 1 as the pubs suggested link)

    I'm sure that there are more effective and these ways to do this, I need to follow this approach for a specific reason.  I was wondering if someone can help me with the syntax correct for vmware-vim-cmd hostsvc/autostartmanager/enable_autostart please?

    Thanks for your help!

    -Vermorel

    It seems that the problem is with you using -1 as input for StartDelay and StopDelay,-1 is not a valid entry that I tested, and you must specify either systemDefault or a time interval.

    I created 4 VMS dummy on ESXi 4.0 host and did the following and it worked:

    Enable auto-start through vimsh (vim - cmd)

    ~ #  vim-cmd hostsvc/autostartmanager/enable_autostart 1
    Enabled AutoStart
    

    Adjustment of the 1st virtual machine:

    ~ # vim-cmd hostsvc/autostartmanager/update_autostartentry 1264 "PowerOn" "15" "1" "systemDefault" "systemDefault" "systemDefault"
    
    1Updated AutoStart order.
    

    Definition of the 2nd VM:

    ~ # vim-cmd hostsvc/autostartmanager/update_autostartentry 1232 "PowerOn" "15" "2" "systemDefault" "systemDefault" "systemDefault"
    
    2Updated AutoStart order.
    

    Definition of the 3rd VM:

    ~ # vim-cmd hostsvc/autostartmanager/update_autostartentry 1280 "PowerOn" "15" "3" "systemDefault" "systemDefault" "systemDefault"
    
    3Updated AutoStart order.
    

    Definition of the 4th VM:

    ~ # vim-cmd hostsvc/autostartmanager/update_autostartentry 1264 "PowerOn" "15" "4" "systemDefault" "systemDefault" "systemDefault"
    
    4Updated AutoStart order.
    

    You can manually set the automatic start/stop by using the vSphere Client and using the following command to retrieve the config:

    vim-cmd hostsvc/autostartmanager/get_autostartseq
    

    which can then be used as a basis to set the configuration.

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    Twitter: @lamw

    repository scripts vGhetto

    Introduction to the vMA (tips/tricks)

    Getting started with vSphere SDK for Perl

    VMware Code Central - Scripts/code samples for developers and administrators

    150 VMware developer

    If you find this information useful, please give points to "correct" or "useful".

  • VMware-vim-cmd: waiting for orders to be completed?

    Hi all, I adapt a backup script I made for VMware Server 1.x to VMware Server 2.x and I'm having trouble doing ordinary things like 'suspend' or "create a snapshot" "a VM from starting.

    There are several ways to do the same thing in a certain way does not require any authentication, others indeed require authentication, for example, to create a snapshot, you can:

    VMware-vim-cmd vmsvc/snapshot.create 'id of the virtual machine.

    or

    vmrun-h https://127.0.0.1:8333 / sdk u user-p password of snapshot "[datastore] /vm_path/vmx_name.vmx '

    The problem with vmware-vim-cmd approach is that it does not wait for the command to complete, and is not a welcome feature in a script.

    Instead, the vmrun command wait until the end, but to use it in a script, you must also include the identification of the user and password information in the script, and it is not welcome.

    So the question (as shown in the topic) is: is it possible to make orders of vim-vmware-cmd to wait until the end?

    If someone knows how to do that I would be very grateful

    Thank you for reading,

    10nico

    The vimsh and the vimsh wrapper vmware-vim-cmd is not officially supported by VMware, that being said, I agree that it should allow you to check the situation, etc. It can be a pro/con and depending on how the call command, the wrappers actually communicate to the VI API server, and if you look at the VI API there are all both blocking and non call.

    Vmware-vim-cmd, the command is executed and returns to the shell for most. You might be able to monitor the tasks that is created and ensure that it is completed, but I have not played too much with it.

    [root@himalaya scripts]# vmware-vim-cmd vimsvc
    Commands available under vimsvc/:
    auth/             login             task_cancel       task_list
    connect           logout            task_description
    license           property_dump     task_info
    

    Again, these are undocumented, unsupported and the behavior will vary =)

    I advise to use the VI API (Powershell or VI Perl Toolkit) to accomplish your tasks, and you can even take a look at some of the utilities that are available with the VI Perl Toolkit Utilities: http://www.vmware.com/support/developer/viperltoolkit/viperl15/doc/perl_toolkit_utilities_idx.html

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    repository scripts vGhetto

    http://Twitter.com/lamw

    If you find this information useful, please give points to "correct" or "useful".

  • Recently, I deleted my partition bootcamp about 65 GB space. However, after that I restarted my MAC, the 65GB is lost! The total space in my HD is currently 434GB although it should be 500 GB! Anyone know how to recover my space 65GB?

    Recently, I deleted my partition bootcamp about 65 GB space. However, after that I restarted my MAC, the 65GB is lost!

    The total space in my HD is currently 434GB although it should be 500 GB! Anyone know how to recover my space 65GB?

    See below for my disk utility:

    Hello waynetay,

    Thank you for being part of the community of Apple!

    Looks like you want to recover the hard disk space that has been used by Bootcamp.  I know how critical disk hard space is, as I understand it want to access it.

    The Boot Camp Assistant should have added space on the side of Mac OS X from the hard drive when it has been used to remove Windows.  Since that didn't happen, you need to back up the system, and then erase the hard drive, then restore the backup.

    First, back up the computer.  Your computer has software called Time Machine.  It is a fantastic software for backing up your computer.  Information on how to use Time Machine is available here:

    Use Time Machine to back up or restore your Mac.

    Once you have the backup, you must erase the drive and then restore the backup Time Machine.

    You can use these measures to erase files on your startup drive and install a fresh copy of OS X:

    1. Before you begin, make sure that your Mac is connected to the Internet.
    2. Restart your Mac. Immediately hold down the command (⌘) keys and R after having heard the startup sound to boot into OS X Recovery.
    3. When the recovery window, select disk utility, then click on continue.
    4. Select the volume name back from your startup disk in the left side of the disk utility window, then click Delete.
    5. If you want to erase the disc safely, click Security Options. Select an erasing method, and then click OK.
    6. On the Format menu, choose Mac OS extended (journaled). Type a name for your drive, and then click clear.
    7. After that the drive is deleted, close the disk utility window.
    8. If you are not connected to the Internet, select a network in the Wi-Fi menu.
    9. Select the option to reinstall OS X.
    10. Click on continue and follow the instructions on the screen to reinstall OS X.

    Once OS X installation is complete, you should have the option to restore from a backup Time Machine in the first installation of OS X.  Choose this option, and the computer will restore everything that was on it before it has been removed.  More information can be found here:

    How to reinstall OS X on your Mac

    Have a great day!

  • Compaq mini 110 c - 1020st: how to recover the password of bios compaq mini 110 c.

    How to recover the password of bios compaq mini 110 c.

    S/N: [personal information]

    P/N: NZ794EA #AB8

    Hello

    Enter: e9lo7qxd7a (3rd character is a lowercase L)

    Kind regards

    DP - K

  • How to recover or find the network key for a router wireless (Netgear)

    Network wireless adapter NIC Ethernet network device

    How to recover or find the network key for a router wireless (Netgear)

    Hi RaymondKramp,

    ·         What version of Windows is installed on your computer?

    If you have lost the key to network and not connected to the network, then you can reset the router to factory settings wireless.

    If you lost the key network and connected to the network, and then log on to the Web page of the router and get the key.

    For more assistance, you can contact Netgear Support:

    http://support.NETGEAR.com/app/home

    Hope this information helps.

  • How to recover a windows live hotmail account blocked?

    I had accidentally answered a message thought it was a real message from the windows live team ask for my username and password and now I can't access the account, he had me to reset and the e-mail has been changed as well as the issue of security. Please help me this is a business account.

    Hello

    Answers is a peer group supported and unfortunately has no real influence on Hotmail.

    HotMail has its own Forums, so you can ask your questions there.

    Windows Live Solution Center - HotMail - HotMail Forums Solutions
    http://windowslivehelp.com/

    Hotmail - Forums
    http://windowslivehelp.com/forums.aspx?ProductID=1

    Hotmail - Solutions
    http://windowslivehelp.com/solutions.aspx?ProductID=1

    How to contact Windows Live Hotmail Support
    http://email.about.com/od/hotmailtips/Qt/et_hotmail_supp.htm

    Windows Live Hotmail Top issues and Support information
    http://support.Microsoft.com/kb/316659/en-us

    Compromised account - access unauthorized account - how to recover your account
    http://windowslivehelp.com/solution.aspx?SolutionID=6ea0c7b3-1473-4176-b03f-145b951dcb41

    Hotmail hacked? Take these steps
    http://blogs.msdn.com/b/securitytipstalk/archive/2010/07/07/Hotmail-hacked-take-these-steps.aspx

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • How restore/recover my recent documents list?

    How restore/recover my recent documents list? the list used to come when I clicked on start, then on 'My recent Documents', but now when I do that all it shows is "EMPTY."   What I've done wrong?, and how do I solve this problem?  I am running Windows XP Service Pack 3 on a laptop Sony Vaio Model VGN-N130G.

    Hello

    1. Have you made changes on the computer before this problem?
    2. You have a third-party cleaning software installed on your computer?

    If the computer has been installed with a user 'Owner' as done by a number of preloaded systems and the
    name is changed to "XYZ", then you lose "my recent documents" feature.

    You can try the following steps and check:

    Method 1:

    Follow these steps and check if it helps to fix the problem:

    a. click Start, and then click Properties. Or, if the Start menu is already displayed, right-click an empty area of theStart menu and then click Properties.

    b. click on Customize. Click the Advanced tab.

    c. under recent documents, click to select the checkbox more recently open my documents list clickOKand then click OK.

     
     
    Method 2:
     
    Follow the steps here and check if that helps.

    Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs.

    For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    How to back up and restore the registry in Windows

    a. click on start-> Run-> type regedit.exe, and then press ENTER.

    b. find the following key in the Registry Editor.HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

    (c) in the right pane, right click and select 'New' > DWORD value

    d. name the DWORD as NoRecentDocsHistory key

    Note: If you already have this key, go to the below mentioned step.

    e. double-click the key NoRecentDocsHistory

    (f) the value of 0.

    g. close the registry editor and restart the computer.

    Refer to:

    How to view, use, and Clear "My recent Documents" on the Start Menu in Windows XP

    It will be useful.

  • How to recover the "administrator password" on laptop Vista Home Premium?

    Hello, someone knows how to recover the "Administrator password" window? I have a Vista Home Premium laptop. I will appreciate any suggestion. Thank you very much.

    Hello

    This is the information from microsoft on you assist on passwords

    http://support.Microsoft.com/kb/940765

    except that we cannot help you

    read this microsoft's policy NOT to provide assistance to crack passwords:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-security/keeping-passwords-secure-Microsoft-policy-on/a5839e41-b80e-48c9-9d46-414bc8a8d9d4

  • lost admin password how to recover or reset

    lost admin password how to recover or reset

    http://support.Microsoft.com/default.aspx/KB/189126

    "Microsoft's strategy concerning lost or forgotten passwords"

    Microsoft cannot help you recover the passwords of the files and Microsoft who are lost or forgotten product features.

    http://social.answers.Microsoft.com/forums/en-us/vistasecurity/thread/3eba3150-8742-4264-be9f-0daaad2282cd

    Read theBANNING of cracking of passwords information tools information provided in these forums in the thread above posted byBill fill MSFT, moderator

    See you soon.

    Mick Murphy - Microsoft partner

Maybe you are looking for