-
Notifications
You must be signed in to change notification settings - Fork 0
/
VMWareReport.ps1
269 lines (235 loc) · 23.6 KB
/
VMWareReport.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
##Modules
if(Get-Module -ListAvailable -Name ImportExcel){
#
}
else{
$Title = "Info"
$Info = "Install ImportExcel?"
$Options = [System.Management.Automation.Host.ChoiceDescription[]] @("&Yes", "&No")
[int]$DefaultChoice = 0
$Opt = $host.UI.PromptForChoice($Title , $Info, $Options, $DefaultChoice)
switch($Opt)
{
0 {
$check = $true
Install-Module -Name ImportExcel -Scope CurrentUser -Confirm:$false
}
1 {
$check = $true
exit
}
}
if($check -ne $true){exit}
try{Import-Module ImportExcel}catch{System.Windows.Forms.MessageBox]::Show('ImportExcel Could not be imported.', 'Error', 'Ok', 'Error'); exit}
}
if(Get-Module -ListAvailable -Name ImportExcel){
}else{exit}
## Functions
Function Select-File {
Add-Type -AssemblyName System.Windows.Forms
$SafeFileDialog=New-Object System.Windows.Forms.SaveFileDialog
$SafeFileDialog.filter = "Excel Files | *.xlsx"
$SafeFileDialog.Title = "Choose a save location."
if($SafeFileDialog.ShowDialog() -eq 'Ok'){
[System.Windows.Forms.MessageBox]::Show('File is selected.', 'Info', 'Ok', 'Information')
return $SafeFileDialog.FileName
}
}
Function Get-VMFolder {
if($global:defaultviserver -eq $null){
[System.Windows.Forms.MessageBox]::Show('Connect to VIServer first.', 'Error', 'Ok', 'Error')
}
else{
$Folder = Get-Folder | Sort-Object | Get-Unique
$Folder_CB.Items.Clear()
$Folder_CB.Items.Add("All")
foreach($F in $Folder){
$Folder_CB.Items.Add($F.Name)
}
}
}
Function Get-VMReport {
if($File[1] -ne $null -and $global:defaultviserver -ne $null){
$report = @()
if($Folder_CB.Text -eq "All"){
$VMs = Get-VM
}
else {
$VMs = Get-Folder $Folder_CB.Text | Get-VM
}
foreach($vm in $VMs.Name)
{
$Progress_LB.text = "VM $i of $($VMs.count)"
$VMData = Get-VM $vm
$VMIP = $VMData.guest.IPAddress[0]
$VMIP = [IPAddress]$VMIP
$data = New-Object PSCustomObject -Property @{
Name = $VMData.Name;
State = $VMData.PowerState
OS = $VMData.ExtensionData.Guest.GuestFullName;
IPv4 = $VMIP;
Cores = $VMData.NumCpu;
RAM = ("$([math]::Round($VMData.MemoryMB)) MB");
ProvisionedSpace = ("$([math]::Round($VMData.ProvisionedSpaceGB)) GB");
UsedSpace = ("$([math]::Round($VMData.UsedSpaceGB)) GB");
}
$report += $data
$i++
}
$xlfile = [string]$File[1]
$report | select-Object Name, State, OS, IPv4, Cores, RAM, ProvisionedSpace, UsedSpace | Export-Excel $xlfile -AutoSize -StartRow 1 -TableName VMWare
if($i -eq $($VMs.count)){
$Progress_LB.text = "Export complete."
}
}
elseif($File[1] -eq $null -and $global:defaultviserver -ne $null){
[System.Windows.Forms.MessageBox]::Show('CHoose file first!', 'Error', 'Ok', 'Error')
}
elseif($File[1] -ne $null -and $global:defaultviserver -eq $null){
[System.Windows.Forms.MessageBox]::Show('Connect to VIServer first!', 'Error', 'Ok', 'Error')
}
}
Function Connect-VMVIServer {
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()
$VIForm = New-Object system.Windows.Forms.Form
$VIForm.ClientSize = '400,97'
$VIForm.text = "Connect to VIServer"
$VIForm.TopMost = $false
$VIForm.FormBorderStyle = "FixedDialog"
$VIForm.MaximizeBox = $false
$VIForm.MinimizeBox = $false
$VIForm.StartPosition = "CenterScreen"
$VIServer_TB = New-Object system.Windows.Forms.TextBox
$VIServer_TB.multiline = $false
$VIServer_TB.width = 100
$VIServer_TB.height = 20
$VIServer_TB.location = New-Object System.Drawing.Point(30,44)
$VIServer_TB.Font = 'Microsoft Sans Serif,10'
$VIServer_TB.Add_KeyDown({
If($_.KeyCode -eq 'Enter') {
$_.SuppressKeyPress = $true
$VIServer_BT.PerformClick()
}
})
$VIServer_BT = New-Object system.Windows.Forms.Button
$VIServer_BT.text = "Verbidnen"
$VIServer_BT.width = 80
$VIServer_BT.height = 30
$VIServer_BT.location = New-Object System.Drawing.Point(234,34)
$VIServer_BT.Font = 'Microsoft Sans Serif,10'
$VIServer_BT.Add_Click{
if($VIServer_TB -ne ""){
Connect-VIServer $VIServer_TB.Text
if($global:defaultviserver -ne $null){
if((Get-View $DefaultViserver.ExtensionData.Client.ServiceContent.SessionManager).count -eq 1){
$Status_LB.ForeColor = "#008000"
$Status_LB.text = "VIServer connected"
Get-VMFolder
}
else
{
$Status_LB.ForeColor = "#008000"
$Status_LB.text = "VIServers connected"
Get-VMFolder
}
}
else{
$Status_LB.ForeColor = "#FF0000"
$Status_LB.text = "Not Connected"
}
$VIForm.Close()
}
}
$VIServer_LB = New-Object system.Windows.Forms.Label
$VIServer_LB.text = "VIServer Name"
$VIServer_LB.AutoSize = $true
$VIServer_LB.width = 25
$VIServer_LB.height = 10
$VIServer_LB.location = New-Object System.Drawing.Point(36,22)
$VIServer_LB.Font = 'Microsoft Sans Serif,10'
$VIForm.controls.AddRange(@($VIServer_TB,$VIServer_BT,$VIServer_LB))
$VIForm.ShowDialog()
}
## Form
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()
$Form = New-Object system.Windows.Forms.Form
$Form.ClientSize = '400,354'
$Form.text = "VMWare Report"
$Form.TopMost = $false
$Form.FormBorderStyle = "FixedDialog"
$Form.MaximizeBox = $false
$Form.MinimizeBox = $false
$Form.StartPosition = "CenterScreen"
$iconBase64 = 'AAABAAEAAAAAAAEAIAC4KAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAEAAAABAAgGAAAAXHKoZgAAKH9JREFUeNrt3Xl8lNd18PHffWZG+4YQkhCbQIAxxgbjLd6NjeO9ado0TdLF3dI0Sd04iW2cOLHBaWzj2Emc1O2bNmnfpE2bN2vt4B2M93hHGIzBBiyQQCAh0L7O3PP+8cxIArNomZk7Mzrfzwd7YEYzV3fmOXOf+5x7LiillFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSSimllFJKKaWUUkoppZRSanSM6wbEW+DWdQgGRMbUEYJBIPrf2D/K0CMMh/Waib2WGfbYYffb4T9w1DYN3e+/5ujaPZLfaTzk8J4Y5evLmNsQv16YgAyIF0RE4O5LTvTQ9OatWIv/cfEO+3dBPIPJAnKBbCAQfZCJ/oAMPhTERP8uGBEQM3S0it+TBoaO59h9NhoAho4T//Ygi7GIib6q+P90GCNmKOjIUaLEmI8FLw7HUQQvehiP/qk8BG+MTbBuPpvpfDwIIOJZS9iI8T74q1gJ4pkIdvWl6f0Le7euw1j/Qykm9mvYAjCzgYXRP7OBqUAJkA9k4QeAAP5BGAsCsQPSHufvMsr7YmScf489/5EEiIygqyKMPwiM5HWOJRZwR8vgv09jfU1vjD871td0zQJhoB/oBNqBJqARqAN2gmkE6QcIGsOAFeTey9IsAKxcidd7oX9bwAhBMZwKXA0sxz/wJ5O+b6RS8SRAD7AfqAV+CzwCNA2ddqYJc+tajP91jw1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SimllFJKKaWUUkoppZRSSimllFJKpYT/DyWnKnh+bg3pAAAAAElFTkSuQmCC'
$iconBytes = [Convert]::FromBase64String($iconBase64)
$stream = New-Object IO.MemoryStream($iconBytes, 0, $iconBytes.Length)
$stream.Write($iconBytes, 0, $iconBytes.Length);
$iconImage = [System.Drawing.Image]::FromStream($stream, $true)
$Form.Icon = [System.Drawing.Icon]::FromHandle((New-Object System.Drawing.Bitmap -Argument $stream).GetHIcon())
$Status_LB = New-Object system.Windows.Forms.Label
$Status_LB.text = "Wait..."
$Status_LB.AutoSize = $true
$Status_LB.width = 25
$Status_LB.height = 10
$Status_LB.location = New-Object System.Drawing.Point(200,50)
$Status_LB.Font = 'Microsoft Sans Serif,10'
$VIServerConnect_BT = New-Object system.Windows.Forms.Button
$VIServerConnect_BT.text = "Connect"
$VIServerConnect_BT.width = 80
$VIServerConnect_BT.height = 30
$VIServerConnect_BT.location = New-Object System.Drawing.Point(66,43)
$VIServerConnect_BT.Font = 'Microsoft Sans Serif,10'
$VIServerConnect_BT.Add_Click({ Connect-VMVIServer })
$Folder_CB = New-Object system.Windows.Forms.ComboBox
$Folder_CB.text = ""
$Folder_CB.width = 100
$Folder_CB.height = 20
$Folder_CB.location = New-Object System.Drawing.Point(44,155)
$Folder_CB.Font = 'Microsoft Sans Serif,10'
$Folder_CB.DropDownStyle = "DropDownList"
#$Folder_CB.SelectedIndex = 0
$Connection_GB = New-Object system.Windows.Forms.Groupbox
$Connection_GB.height = 91
$Connection_GB.width = 367
$Connection_GB.text = "Connection"
$Connection_GB.location = New-Object System.Drawing.Point(15,17)
$FIle_BT = New-Object system.Windows.Forms.Button
$FIle_BT.text = "File"
$FIle_BT.width = 60
$FIle_BT.height = 30
$FIle_BT.location = New-Object System.Drawing.Point(244,150)
$FIle_BT.Font = 'Microsoft Sans Serif,10'
$FIle_BT.Add_Click({ $global:File = Select-File })
$Progress_LB = New-Object system.Windows.Forms.Label
$Progress_LB.text = "Wait..."
$Progress_LB.AutoSize = $true
$Progress_LB.width = 25
$Progress_LB.height = 10
$Progress_LB.location = New-Object System.Drawing.Point(76,275)
$Progress_LB.Font = 'Microsoft Sans Serif,10'
$GO_BT = New-Object system.Windows.Forms.Button
$GO_BT.text = "Go"
$GO_BT.width = 60
$GO_BT.height = 30
$GO_BT.location = New-Object System.Drawing.Point(244,267)
$GO_BT.Font = 'Microsoft Sans Serif,10'
$GO_BT.Add_Click({ Get-VMReport })
$Folder_GB = New-Object system.Windows.Forms.Groupbox
$Folder_GB.height = 73
$Folder_GB.width = 160
$Folder_GB.text = "Folder"
$Folder_GB.location = New-Object System.Drawing.Point(15,127)
$File_GB = New-Object system.Windows.Forms.Groupbox
$File_GB.height = 73
$File_GB.width = 187
$File_GB.text = "File"
$File_GB.location = New-Object System.Drawing.Point(194,127)
$Groupbox1 = New-Object system.Windows.Forms.Groupbox
$Groupbox1.height = 111
$Groupbox1.width = 365
$Groupbox1.text = "Export"
$Groupbox1.location = New-Object System.Drawing.Point(15,224)
$Form.controls.AddRange(@($Status_LB,$VIServerConnect_BT,$Folder_CB,$Connection_GB,$FIle_BT,$Progress_LB,$GO_BT,$Folder_GB,$File_GB,$Groupbox1))
$Form.ShowDialog()