VMware vSphere PowerCLI Commands – Komutları
Host – Cluster Bilgilerini Görüntüleme-Dışarı Aktarma
get-cluster “*” |get-vmhost |select Name, Parent, Manufacturer, Model, NumCpu, ProcessorType | Format-Table –AutoSize |Export-csv ClusterBilgi.csv –Notypeinformation
Host – CPU Bilgilerini Görüntüleme-Dışarı Aktarma
$Col = @() # Prepare output collection
Get-VMHost | %{Get-View $_.ID} | %{
$esx = “” | select name, NumCpuPackages, NumCpuCores, CpuMhz, CpuModel
$esx.name = $_.name
$esx.NumCpuPackages = $_.Hardware.CpuInfo.NumCpuPackages
$esx.NumCpuCores = $_.Hardware.CpuInfo.NumCpuCores
$esx.CpuMhz = $_.Summary.Hardware.CpuMhz
$esx.CpuModel = $_.Summary.Hardware.CpuModel
$esx | select-object (
@{Name = “Name”; Expression = {$esx.name}},
@{Name = “Sockets”; Expression = {$esx.NumCpuPackages}},
@{Name = “Cores”; Expression = {$esx.NumCpuCores}},
@{Name = “MHz”; Expression = {$esx.CpuMhz}},
@{Name = “Model”; Expression = {$esx.CpuModel}}
)
$Col += $esx # Add output to collection
}
$Col | Export-csv CpuiBilgi.csv -NoTypeInformation # Export output to csv
Vcenter Tüm VM Sanal Makina Bilgilerini Görüntüleme-Dışarı Aktarma
Get-vm| Select-Object Name,@{Name=”DNSName”; Expression = {$_.Guest.HostName}}, NumCpu, powerstate, VMHost,@{Name=”GuestOS”; Expression = {get-vmguest -vm $_.Name}} | Export-csv VMs.csv –Notypeinformation
Vcenter Tüm Eventlarını Görüntüleme-Dışarı Aktarma
Get-VIEvent -Start 1/1/2016 -Finish 5/25/2016 | Export-Csv “c:\temp\events.csv” -NoTypeInformation -UseCulture
Vcenter VM Network Bilgisi Görüntüleme ve Değişiklik
PowerCLI C:\> Get-VM -name GNS3
PowerCLI C:\> Get-VM -name GNS3 | Get-NetworkAdapter
PowerCLI C:\> Get-VM -name GNS3 | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName VLAN_99
PowerCLI C:\> Get-VM -name GNS3 | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName VLAN_99 -Confirm:$false
Bir Cevap Yazın