-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVMReport.ps1
More file actions
22 lines (17 loc) · 979 Bytes
/
VMReport.ps1
File metadata and controls
22 lines (17 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Script Created by Oldelpasosnowplow
# On Tuesday, July 14th, 2018
# This is completely open to any and all that want to use it
# The following script was created because I wanted a quick way to see notes, server counts and host hardware usage on my vCenter server.
# Enjoy and I hope this helps others
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
#Enter your vm credentials here
$vmcredentials = "root@localos"
#Enter your vCenter server name here
$vmvcentername = "vCenterServer"
#Enter where you want the report to be stored
$reportpath = "C:\temp\vmreport.html"
$cred = Get-Credential $vmcredentials
Connect-VIServer $vmvcentername -cred $cred
$vms = Get-VM -Name *
$vms | ConvertTo-Html -Title "$vmvcentername Report" -PreContent "<H1> $vmvcentername Report</H1>" -Property Name, Notes, PowerState, Guest, NumCpu, CoresPerSocket, MemoryGB, VMHost, HardwareVersion | Out-File $reportpath
Start-Process $reportpath