Hi,
Could anyone help me with creating a script to get a monthly scheduled report (as Excel file on a vCenter Server location) that includes following data:
VM Name, HDD size, RAM allocated, Amount of CPU, and 4 Custom Annotations (Key and Value 0-3)
Thanks in advance!
There is a simple tool called RVtool.. use that its a just a minutes of thing, it will fetch you all the required detial and you save that as excel...
There is a simple tool called RVtool.. use that its a just a minutes of thing, it will fetch you all the required detial and you save that as excel...
Great tool, that is all I wanted! Thanks
##################
# VM information #
##################
$Report= @()
connect-VIServer -server xxx -user "xxx" -password "xxx"
$vmguest = Get-VM | Get-VMguest | where {$_.State -eq "Running"}
foreach($vm in $vmguest){
foreach($disk in $vm.disks){
$report += Select-Object -InputObject $vm, $disk -Property @{N="VMName";E={$vm.vmname}},
@{N="Path";E={$disk.path}},
@{N="CapacityGB";E={[math]::Round(($disk.Capacity)/1GB)}},
@{N="FreespaceGB";E={[math]::Round(($disk.FreeSpace)/1GB)}},
@{N="MemoryMB";E={$vm.vm.memorymb}},
@{N="NumCPU";E={$vm.vm.numcpu}}
}}
$report | Export-Csv "C:\vmreport.csv" -NoTypeInformation -UseCulture
Disconnect-VIServer -Server xxx -Confirm:$false
$report | Export-Csv "C:\vmreport.csv" -NoTypeInformation -UseCulture
Disconnect-VIServer -Server xxx -Confirm:$false
$report | Export-Csv "C:\vmreport.csv" -NoTypeInformation -UseCulture
Disconnect-VIServer -Server xxx -Confirm:$false