How do I enable Intel virtualization technology? - virtualization

I need to check whether or not the Intel virtualization technology is enabled in my CPU.
Problem is - when I open the BIOS setup I don't see anything about it.
The BIOS version is : W7235IMS V1.9
Thanks

In C#, you can run this program:
ManagementClass managClass = new ManagementClass("win32_processor");
ManagementObjectCollection managCollec = managClass.GetInstances();
foreach (ManagementObject managObj in managCollec)
{
foreach (var prop in managObj.Properties)
{
Console.WriteLine("Property Name: {0} Value: {1}",prop.Name,prop.Value);
}
}
Look for a property called VirtualizationFirmwareEnabled. If you do not see it, then your processor doesn't have that feature.
You can also open a PowerShell window and execute this command:
Get-CimInstance -ClassName win32_processor -Property name
Again, look for the property called VirtualizationFirmwareEnabled.

This CPU (circa 2006) does Not support Vt-x.
http://ark.intel.com/products/29753/Intel-Core2-Duo-Processor-E4400-2M-Cache-2_00-GHz-800-MHz-FSB?q=Core%202%20Duo%20E4400

Related

How to list BIOS Major/Minor Release Version using PowerCLI?

I'm trying to make sure that I have the correct BIOS versions on a series of HP Proliant servers running ESXi. I would like to use PowerCLI to return the BIOS Major Release and BIOS Minor Release information for each host.
So far, when using PowerCLI to query the BIOS information, I only get the basic version information ("P89"), as shown below (I've obviously omitted the real hostname values):
PS \> Get-View -ViewType HostSystem -Filter #{'Name' = $servername} | select Name,
>> #{N='BIOSversion';E={$_.Hardware.BiosInfo.BiosVersion}}
Name BIOSversion
---- -----------
$servername P89
However, if I SSH into that host I can use 'vsish' to identify the BIOS Major Release and BIOS Minor Release information (i.e. v2.76):
root#<servername>: ~# vsish
/> get /hardware/bios/biosInfo
BIOS Information (type 0) {
BIOS Vendor:HP
BIOS Version:P89
BIOS Release Date:10/21/2019
BIOS Major Release:2
BIOS Minor Release:76
Embedded Controller Firmware Major Release:2
Embedded Controller Firmware Minor Release:73
}
Is there a way to use PowerCLI to return the BIOS Major Release and BIOS Minor Release data, without having to SSH into the host directly?
Thank you in advance!
If the information is available in PowerCLI, it will be located at $_.Hardware.BiosInfo.MajorRelease and $_.Hardware.BiosInfo.MinorRelease. To join the major and minor versions using version syntax, you can do the following with the -join operator:
Get-View -ViewType HostSystem -Filter #{'Name' = $servername} |
Select Name,#{N='BIOSversion';E={$_.Hardware.BiosInfo.BiosVersion}},
#{n='BIOSRelease';e={$_.HardWare.BiosInfo.MajorRelease,$_.Hardware.BiosInfo.MinorRelease -join '.'}}

How to get Log On As account for Windows Service via PowerShell

New to powershell and I'm guessing this exists but I cannot find. I am looking for a powershell command that will show me the account being used to run a Windows Service? I am first as going to check it is running, then make sure it is running using the correct AD account. I have the following so far...
$serviceName = '<my service name>'
If (Get-Service $serviceName -ErrorAction SilentlyContinue) {
If ((Get-Service $serviceName).Status -eq 'Running') {
$status = "$serviceName found and is running."
} Else {
$status = "$serviceName found, but it is not running."
}
#Here is where I should check Log On As name
} Else {
$status = "$serviceName not found."
}
write-host "Status: $status`n"
pause
Most of my searches lead me to Get-WmiObject, but I did not find what I was looking for. Thanks in advance for any help.
(Get-WmiObject Win32_Service -Filter "Name='$serviceName'").StartName. (Yes, the name of this property is rather counter-intuitive, but the docs don't lie).
You could also use the more recent CIM cmdlets. Which is which is really where MS wants and is directing folsk to use.
Get-CimInstance -ClassName CIM_Service | Select-Object Name, StartMode, StartName
What is CIM and Why Should I Use It in PowerShell?
https://blogs.technet.microsoft.com/heyscriptingguy/2014/01/27/what-is-cim-and-why-should-i-use-it-in-powershell
Update for WMI
In Windows PowerShell 4.0 and Windows PowerShell 3.0, Microsoft offered an updated method for interacting with WMI: the CIMCmdlets module for Windows PowerShell. With this new Windows PowerShell module release, Microsoft also released an entirely new Application Programming Interface (API) for Windows called Management Infrastructure (MI).
The new MI API more closely aligns to the DMTF standards, as laid out on MSDN in Why Use MI? MI allows software developers and hardware manufacturers to expose information, and it allows IT professionals to interact with hardware, using standards-based mechanisms. As this technology continues to evolve, I believe that we will see more cross-platform integration between Microsoft Windows and competing platforms.
Should I use CIM or WMI with Windows PowerShell?
https://blogs.technet.microsoft.com/heyscriptingguy/2016/02/08/should-i-use-cim-or-wmi-with-windows-powershell
Get-WmiObject is one of the original PowerShell cmdlets. (As a quick quiz, how many of the 137 original cmdlets can you name?). It was enhanced in PowerShell 2.0 when the other WMI cmdlets were introduced. In PowerShell 1.0, Get-WmiObject was the only cmdlet with the option to access another system.
The big drawback to the WMI cmdlets is that they use DCOM to access remote machines. DCOM isn’t firewall friendly, can be blocked by networking equipment, and gives some arcane errors when things go wrong.
The CIM cmdlets appeared in PowerShell 3.0 as part of the new API for working with CIM classes, which is more standards based. The CIM cmdlets were overshadowed by PowerShell workflows, but they are (to my mind) the most important thing to come out of that release.
The other major CIM-related advance was the introduction of CDXML, which enables a CIM class to be wrapped in some simple XML and published as a PowerShell module. This is how over 60% of the cmdlets in Windows 8 and later are produced.
With Powershell 7, you can retrieve the logon as user like this:
(Get-Service $serviceName).username

Task sequence variable for OS, I want to install

I'm verry beginer in powershell, I'm wonking in a project, the goal it's to set the Biossetting like disabling or enabling the secureBoot and UEFI mode, while installing windows 7 or 10 by MDT.
I'm working with Dell and hp computer, I have the script for setting the bios of hp or dell
Hp:
$bios=Get-WmiObject -Namespace root/hp/instrumentedBIOS -Class HP_BIOSSettingInterface
$bios.SetBIOSSetting("UEFI Boot Options", "Enable","")
Dell:
(Get-WmiObject DCIM_BIOSService -namespace root\dcim\sysman -ComputerName .).SetBIOSAttributes($null,$null,"Secure Boot","1")
Then, my first problem these command is not working in any computer I need to install some modules, some cmdlet from hp or dell website, I want to know if make my script ".exe", it's gonna work in every-computer ?
Because I need to run my script with with deployement of windows.
My second and difficult task, I want to know with variable task sequence to use in my script, to detect the os of the tasksequence, I find this code in internet, after too much research in internet
$TaskPath = "$($MdtDrive):\Task Sequences"
$ControlPath = "$MDtroot\Control"
$OSPath = "$($MdtDrive):\Operating Systems"
$OS = (Get-ChildItem -Path $OSPath | Out-GridView -PassThru -Title "Select required OperatingSystem").Name
This code detect if the OS of the task sequence I want install in my computer is windos 7 or windows 10?
Thanks !
If I recall correctly from my days of systems deployment, Dell and HP both make dedicated tools for settigns BIOS configuration. Just make sure you run it in WinPE. Depending on which BIOS settings you change you make even have to boot WinPE twice to make sure the OS installs the way you want.
Dell: http://en.community.dell.com/techcenter/enterprise-client/w/wiki/7532.dell-command-configure
HP: https://deploymentbunny.com/2010/10/18/enable-tpm-via-task-sequence-on-hp-boxes/
Although it is definitely possible to make these settings in WMI I would only look to it as a last resort. Windows has to be compatible with every piece of hardware, whereas Dell/HP tools are targeted at their systems. It's like using a scalpel vs a Swiss army knife.
I have some difficults I’m working in a script who set the bios configuration while installing windows 7 or 10 by MDT, then my first question is:
Wich variable I can use to identify the os of the new task sequence I mean the current os the mdt preparing to install in the computer after the user select the os during the installation.
I’m wondering if this code doying the job
$OS = Get-ChildItem -Path $OSPath | Out-GridView -PassThru -Title “Select required OperatingSystem”
$OSPath = “$($MdtDrive):\Operating Systems”

Programmatically updating network printer drivers

this is a deployment issue I'm hoping to solve with some simple Powershell:
When doing 32 bit Windows XP to 64 Bit Windows 7 migration, USMT is
migrating all the network printers, which is great. As the drivers
are obviously not correct though, the driver needs to be manually
upgraded (right click printer --> Update Driver).
Is there a WMI function or Powershell cmdlet for this action? I cant seem to find any
documentation on it! As our USMT task sequence is separate from the
deployment and runs under the migrated user's context I'm sure it
would work. If I could just get the right syntax, add a Powershell
script at the end of the TS that would be perfect.
I'm basically looking for the function that would have the same result as right-clicking the printer and clicking 'Update Driver'. I've cross posted here from the MDT forums as I think this would probably be more appropriate!
I've looked at Win32_Printer class but doesn't look like it has what I need.
How I understand it, doing a RC-> Update Driver is not really the correct way to manage print drivers.
Update driver is designed to update a driver from Version X to the next Version Y and not really the correct way to change the driver from a Win XP driver to a Win 7 driver (i.e. if the XP driver is at version 1.0, and the Win 7 driver is at 1.0, then running Update driver will not do anything because the versions will be the same).
The #1 and best option is to use PowerShell remove the printers, and re-add them (which will then also install the Windows 7 drivers). That way you will guarantee that they will work.
The script will be something like this:
#Get list of all the printers on the machine
$printers = gwmi win32_printer
#Save default Printer
$DefaultPrinter = $printers | where{$_.Default} | Select ShareName
#Create a list of all the printers we want to delete (in this case I am deleting all network printers)
$PrintersToDelete = $printers | where{$_.Network -eq $true}
#Create a list of all the printers we want to add (in this case, all network printers I just deleted)
$PrintersToAdd = $printers | where{$_.Network -eq $true} | Select Name
#Delete the printers I want to delete
$PrintersToDelete | foreach{$_.delete()}
#Add back all printers we want to add
$PrintersToAdd | foreach{(New-Object -ComObject WScript.Network).AddWindowsPrinterConnection($_.Name)}
#Get list of all the new printers on the machine
$printers = gwmi win32_printer
#Set the default printer
$NewDefaultPrinter = $printers | where{$_.DeviceID -match $DefaultPrinter}
$NewDefaultPrinter.SetDefaultPrinter()

How to determine storage type (SAN/NAS/local disk) remotely, using PowerShell?

I have to collect the attached storage types of each server in our environment: Several hundreds of W2K3/W2K8 servers.
A script would be very useful to determine if the attached storage is SAN / SAN mirrored / NAS / local or combination of these. The problem is that I haven't really found any good solution.
I was thinking about a script, and the best I could figure out would do something like the following:
If the server uses SAN, Veritas Storage Foundation is always installed, so I would search for it with gwmi win32_product. This is really slow, and this doesn't provide the information if the storage is SAN, or SAN mirrored.
If the attached storage is NAS, there must be an ISCSI target ip, and I would search for that somehow.
I really don't think these methods are acceptable though. Could you please help me find a better way to determine the attached storage types somehow?
Thank you very much
I found an article about accessing the VDS service in powershell. Getting More Information About You Cluster LUN’s
Massaged the code a bit to get type. Works even on 2003.
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Storage.Vds") | Out-Null
$oVdsServiceLoader = New-Object Microsoft.Storage.Vds.ServiceLoader
$oVdsService = $oVdsServiceLoader.LoadService($null)
$oVdsService.WaitForServiceReady()
$oVdsService.Reenumerate()
$cDisks = ($oVdsService.Providers |% {$_.Packs}) |% {$_.Disks}
$cPacks = $oVdsService.Providers |% {$_.Packs}
foreach($oPack in $cPacks)
{
If($oPack.Status -eq "Online")
{
foreach($oDisk in $oPack.Disks)
{
Write-Host "$($oDisk.FriendlyName) ( $($oDisk.BusType) )"
}
foreach($oVolume in $oPack.Volumes)
{
Write-Host "`t$($oVolume.AccessPaths) ( $($oVolume.Label) )"
}
}
}
You could probably find the info in one of the following WMI classes:
Win32_LogicalDisk
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394173(v=vs.85).aspx
Win32_Volume
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394515(v=vs.85).aspx
Win32_DiskDrive
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394132(v=vs.85).aspx
Then... do something like:
Get-AdComputer Server* | Foreach-Object { Get-WmiObject -Class Win32_DiskDrive -ComputerName $_.Name }