Upload files to "VMware"
This commit is contained in:
parent
19c58e60f3
commit
a688f7054c
22
VMware/DRA-audit.ps1
Normal file
22
VMware/DRA-audit.ps1
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
Add-PsSnapin VMware.VimAutomation.Core -ea "SilentlyContinue"
|
||||
Connect-VIServer -Server "drahpwvvc01.vcenter.local"
|
||||
|
||||
$myCol = @()
|
||||
ForEach ($Cluster in Get-Cluster)
|
||||
{
|
||||
write-host "Clustername : " $cluster.name
|
||||
write-host "Number of Hosts: " ($cluster | Get-VMHost).count
|
||||
ForEach ($vmhost in ($cluster | Get-VMHost))
|
||||
{
|
||||
$VMView = $VMhost | Get-View
|
||||
$VMSummary = "" | Select HostName, ClusterName, MemorySizeGB, CPUSockets, CPUCores
|
||||
$VMSummary.HostName = $VMhost.Name
|
||||
$VMSummary.ClusterName = $Cluster.Name
|
||||
$VMSummary.MemorySizeGB = [math]::round(($VMview.hardware.memorysize / 1024Mb))
|
||||
$VMSummary.CPUSockets = $VMview.hardware.cpuinfo.numCpuPackages
|
||||
$VMSummary.CPUCores = $VMview.hardware.cpuinfo.numCpuCores
|
||||
$myCol += $VMSummary
|
||||
}
|
||||
}
|
||||
#$myCol | export-csv -Path "c:\temp\dra.csv" -useculture -notypeinformation
|
||||
$myCol | out-gridview
|
||||
Loading…
Reference in a new issue