-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathGet PVS device info.ps1
985 lines (821 loc) · 44.9 KB
/
Get PVS device info.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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
#Requires -version 3.0
<#
Grab all PVS devices and their collections, machine catalogues, delivery groups and more and output to csv or a grid view
Use of this script is entirely at the risk of the user. The author accepts no liability or responsibility for any undesired issues it may cause
Guy Leech, 2018
Modification history:
19/01/18 GL Fixed issue where not showing not booted off latest if different vdisk assigned from what is booted off
Fixed issue with PoSH v5
Added -name filter and -tags
Added warning for pre PoSH v5 and more than 30 columns in Out-GridView
Added error trapping when fails to retrive boot time
22/01/18 GL Added action GUI
26/01/18 GL Added ability to match AD group regex and output group memberships
01/02/18 GL Added disk version descriptions and dns lookup option
22/02/18 GL Added capability to include machines retrieved from DDCs which are not present in PVS
Changed main device collection to .NET array so we can add potential orphans to it
Added MaxRecordCount parameter for DDC
25/02/18 GL Added GUI options to remove from PVS and DDC
27/02/18 GL Added saving DDC and PVS servers to registry
14/03/18 GL Changed AD Account Exists to Created date
16/03/18 GL "Remove from AD" and "Remove from Hypervisor" (VMware) actions added
Added ability to identify orphaned VMs in VMware
Include VM information if have hypervisor connection (VMware)
Added progress bar
17/03/18 GL Completion message after actions completed with error count
18/03/18 GL Disable Remove from Hypervisor and AD buttons if not available
Added profiling and optimised
Made MessageBox calls app modal as well as system
20/03/18 GL Added remote memory, CPU and hard disk status via WMI/CIM
Added -help option
21/03/18 GL Changed action UI to use context menus rather than buttons
Added vdisk file size
06/04/18 GL Retry count, device IP and PVS server booted from fields added
-noGridview option added and will produce both csv and gridview if -csv specified unless -nogridview used
17/04/18 GL Implemented timeout when getting remote information as Invoke-Command can take up to 25 minutes to timeout.
Added remote domain health check via Test-ComputerSecureChannel and AD account modification time
30/05/18 GL Added Load indexes
01/06/18 GL Changed to run device queries in runspaces to speed up
19/06/18 GL Split main code into module so can re-use in other scripts
20/06/18 GL Added option to split VMware VM names in case have description, etc after an _ character or similar
21/01/21 GL Added remove from delivery group option
16/06/21 GL Bug fixes where full domain name passed as part of machine name to DDC actions
13/09/21 GL Added menu item to delete DNS entry
14/09/21 GL Added "Erase from Existence" menu item to delete from PVS, DDC, AD, DNS and VMware. Use with caution!
#>
<#
Copyright © 2021 Guy Leech
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#>
<#
.SYNOPSIS
Produce grid view or csv report of Citrix Provisioning Services devices, cross referenced with information from Delivery Controllers and Active Directory
.DESCRIPTION
Alows easy identification of potential problems such as devices booted off the wrong vdisk or vdisk version, devices with no AD account or devices overdue a reboot.
Devices can be selected in the grid view and then shutdown, restarted, booted or maintenance mode turned on or off from a simple GUI
.PARAMETER pvsServers
Comma separated list of PVS servers to contact. Do not specify multiple servers if they use the same SQL database
.PARAMETER ddcs
Comma separated list of Delivery Controllers to contact. Do not specify multiple servers if they use the same SQL database
.PARAMETER registry
Pick up the PVS and DDC servers from the registry rather than the command line. Must previously have saved them with -save and an optional server set name via -serverSet
.PARAMETER serverSet
Pick up the PVS and DDC servers from the registry sub key specified in this paramter rather than the command line. Must previously have saved them with -save and this server set name
.PARAMETER domain
The FQDN domain to search for the selected PVS devices when deleting DNS records. If not specified, the DNS domain for the user running the script will be used
.PARAMETER save
Save the PVS and DDC servers to the registry for later use with -registry. Use -serverSet to specify named sets of servers, e.g. preproduction and production
.PARAMETER csv
Path to a csv file that will have the results written to it.
.PARAMETER noGridView
Do not produce an on screen grid view containing the results. Default behaviour will display one.
.PARAMETER cpuSamples
The number of CPU usage samples to gather from a remote system if -noRemoting is not specified. The higher the number, the more accurate the figure but the longer it will take.
Set to zero to not gather CPU but still gather other remote data like memory usage and free disk space
.PARAMETER noRemoting
Will not try and contact active devices to gather information like last boot time. If WinRM not setup correctly or other issues mean remote calls will fail then this option can speed the script up
.PARAMETER noOrphans
Do not display machines which are present on DDCs/Studio but not in PVS. May be physical, MCS or VMs with local disks or could be orphans that did exist in PVS but do not any longer.
.PARAMETER jobTimeout
Timeout in seconds for the command to retrieve information remotely from a device.
.PARAMETER maxRecordCount
Citrix DDC cmdlets by default only return 250 items so if there are more machines than this on a DDC then this parameter may need to be increased
.PARAMETER name
Only show devices whose name matches the regular expression specified
.PARAMETER tags
Adds a column containing Citrix tags, if present, for each device
.PARAMETER ADGroups
A regular expression of AD groups to match and will output ones that match for which the device is a member
.PARAMETER noProgress
Do not show a progress bar
.PARAMETER hypervisors
Comma separated list of VMware vSphere servers to connect to in order to gather VM information such as memory and CPU configuration.
Will prompt for authentication if no pass thru or saved credentials
.PARAMETER vmPattern
When hypervisors are specified, or retrieved from the registry, a regular expression must be specified to match the VM names in vCenter to prevent all VMs
being included rather than just XenApp/XenDesktop ones
.PARAMETER provisioningType
The type of catalogue provisioning to check for in machines that are suspected of being orphaned from PVS as they were found on a DDC but not PVS
.PARAMETER dns
Perform DNS ipV4 lookup. This can cause the script to run slower.
.PARAMETER noMenu
Do not display "OK" and "Cancel" buttons on grid view so no action menu is presented after grid view is closed
.PARAMETER messageText
Text to send to users in the action GUI. If none specified and the message option is clicked then you will be prompted for the text
.PARAMETER messageCaption
Caption of the message to send to users in the action GUI. If none specified and the message option is clicked then you will be prompted for the text
.PARAMETER timeout
Timeout in seconds for PVS power commands
.PARAMETER splitVM
Split VMware name on a specific character such as an underscore where the second and subsequent parts of the name are descriptions, etc
.PARAMETER help
Show full help via Get-Help cmdlet
.EXAMPLE
& '.\Get PVS device info.ps1' -pvsservers pvsprod01,pvstest01 -ddcs ddctest02,ddcprod03
Retrieve devices from the listed PVS servers, cross reference to the listed DDCs (list order does not matter) and display on screen in a sortable and filterable grid view
.EXAMPLE
& '.\Get PVS device info.ps1' -pvsservers pvsprod01 -ddcs ddcprod03 -name CTXUAT -tags -dns -csv h:\pvs.ctxuat.csv
Retrieve devices matching regular expression CTXUAT from the listed PVS server, cross reference to the listed DDC and output to the given csv file, including Citrix tag information and IPv4 address from DNS query
.EXAMPLE
& '.\Get PVS device info.ps1' -pvsservers pvsprod01 -ddcs ddcprod03 -ADGroups '^GRP-' -hypervisors vmware01 -vmPattern '^CTX[15]\d{3}$'
Retrieve all devices from the listed PVS server, cross reference to the listed DDC and VMware, including AD groups which start withg "GRP", and output to an on-screen grid view
.NOTES
Uses local PowerShell cmdlets for PVS, DDCs and VMware, as well as Active Directory, so run from a machine where both PVS and Studio consoles and the VMware PowerCLI are installed.
#>
[CmdletBinding()]
Param
(
[Parameter(ParameterSetName='Manual',mandatory=$true,HelpMessage='Comma separated list of PVS servers')]
[string[]]$pvsServers ,
[Parameter(ParameterSetName='Manual',mandatory=$true,HelpMessage='Comma separated list of Delivery controllers')]
[string[]]$ddcs ,
[Parameter(ParameterSetName='Manual',mandatory=$false)]
[switch]$save ,
[Parameter(ParameterSetName='Registry',mandatory=$true,HelpMessage='Use default server set name from registry')]
[switch]$registry ,
[string]$serverSet = 'Default' ,
[string[]]$hypervisors ,
[string]$csv ,
[switch]$dns ,
[string]$name ,
[switch]$tags ,
[string]$ADgroups ,
[switch]$noProgress ,
[switch]$noRemoting ,
[switch]$noMenu ,
[switch]$noOrphans ,
[switch]$noGridView ,
[ValidateSet('PVS','MCS','Manual','Any')]
[string]$provisioningType = 'PVS' ,
[string]$configRegKey = 'HKCU:\software\Guy Leech\PVS Fetcher' ,
[string]$messageText ,
[string]$messageCaption ,
[string]$domain ,
[int]$maxRecordCount = 2000 ,
[int]$jobTimeout = 120 ,
[int]$timeout = 60 ,
[int]$cpuSamples = 2 ,
[int]$maxThreads = 10 ,
[string]$pvsShare ,
[string]$splitVM ,
[switch]$help ,
[string[]]$snapins = @( 'Citrix.Broker.Admin.*' ) ,
[string[]]$modules = @( 'ActiveDirectory', 'DNSServer' , "$env:ProgramFiles\Citrix\Provisioning Services Console\Citrix.PVS.SnapIn.dll" , 'Guys.Common.Functions.psm1' ) ,
[string]$vmWareModule = 'VMware.VimAutomation.Core'
)
if( $help )
{
Get-Help -Name ( & { $myInvocation.ScriptName } ) -Full
return
}
[string]$script:dnsserver = $null
$columns = [System.Collections.Generic.List[string]]( @( 'Name','DomainName','Description','PVS Server','DDC','SiteName','CollectionName','Machine Catalogue','Delivery Group','Load Index','Load Indexes','Registration State','Maintenance_Mode','User_Sessions','devicemac','active','enabled',
'Store Name','Disk Version Access','Disk Version Created','AD Account Created','AD Account Modified','Domain Membership','AD Last Logon','AD Description','Disk Name','Booted off vdisk','Booted Disk Version','Vdisk Production Version','Vdisk Latest Version','Latest Version Description','Override Version',
'Retries','Booted Off','Device IP','Booted off latest','Disk Description','Cache Type','Disk Size (GB)','vDisk Size (GB)','Write Cache Size (MB)' ) )
if( $dns )
{
$columns.Add( 'IPv4 address' )
}
if( $tags )
{
$columns.Add( 'Tags')
}
if( ! [string]::IsNullOrEmpty( $ADgroups ) )
{
$columns.Add( 'AD Groups')
}
if( ! $noRemoting )
{
$columns.Add( 'Boot_Time' )
$columns.Add( 'Available Memory (GB)' )
$columns.Add( 'Committed Memory %' )
$columns.Add( 'Free disk space %' )
if( $cpuSamples -gt 0 )
{
$columns.Add( 'CPU Usage %' )
}
}
if( $snapins -and $snapins.Count -gt 0 )
{
ForEach( $snapin in $snapins )
{
Add-PSSnapin $snapin -ErrorAction Continue
}
}
ForEach( $module in $modules )
{
Import-Module $module -ErrorAction SilentlyContinue
[bool]$loaded = $?
if( ! $loaded -and $module -notmatch '^[a-z]:\\' -and $module -notmatch '^\\\\' ) ## only check script folder if not an absolute or UNC path
{
## try same folder as the script if there is no path in the module name
Import-Module (Join-Path ( & { Split-Path -Path $myInvocation.ScriptName -Parent } ) $module ) -ErrorAction Continue
$loaded = $?
}
if( ! $loaded )
{
Write-Warning "Unable to load module `"$module`" so functionality may be limited"
}
}
$messageWindowXAML = @"
<Window x:Class="Direct2Events.MessageWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Direct2Events"
mc:Ignorable="d"
Title="Send Message" Height="414.667" Width="309.333">
<Grid>
<TextBox x:Name="txtMessageCaption" HorizontalAlignment="Left" Height="53" Margin="85,20,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="180"/>
<Label Content="Caption" HorizontalAlignment="Left" Height="24" Margin="10,20,0,0" VerticalAlignment="Top" Width="63"/>
<TextBox x:Name="txtMessageBody" HorizontalAlignment="Left" Height="121" Margin="85,171,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="180"/>
<Label Content="Message" HorizontalAlignment="Left" Height="25" Margin="10,167,0,0" VerticalAlignment="Top" Width="56" RenderTransformOrigin="0.47,1.333"/>
<StackPanel Orientation="Horizontal" Height="43" Margin="10,332,0,0" Width="283">
<Button x:Name="btnMessageOk" Content="OK" Height="20" Width="89"/>
<Button x:Name="btnMessageCancel" Content="Cancel" Height="20" Margin="50,0,0,0" Width="89"/>
</StackPanel>
<ComboBox x:Name="comboMessageStyle" HorizontalAlignment="Left" Height="27" Margin="85,98,0,0" VerticalAlignment="Top" Width="180">
<ComboBoxItem Content="Information" IsSelected="True"/>
<ComboBoxItem Content="Question"/>
<ComboBoxItem Content="Exclamation"/>
<ComboBoxItem Content="Critical"/>
</ComboBox>
<Label Content="Level" HorizontalAlignment="Left" Height="27" Margin="15,98,0,0" VerticalAlignment="Top" Width="58"/>
</Grid>
</Window>
"@
$pvsDeviceActionerXAML = @'
<Window x:Name="formDeviceActioner" x:Class="PVSDeviceViewerActions.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PVSDeviceViewerActions"
mc:Ignorable="d"
Title="PVS Device Actioner" Height="522.565" Width="401.595">
<Grid Margin="0,0,-20.333,-111.667">
<ListView x:Name="lstMachines" HorizontalAlignment="Left" Height="452" Margin="23,22,0,0" VerticalAlignment="Top" Width="346">
<ListView.ContextMenu>
<ContextMenu>
<MenuItem Header="VMware" Name="VMwareContextMenu" >
<MenuItem Header="Power On" Name="VMwarePowerOnContextMenu" />
<MenuItem Header="Power Off" Name="VMwarePowerOffContextMenu" />
<MenuItem Header="Restart" Name="VMwareRestartContextMenu" />
<MenuItem Header="Delete" Name="VMwareDeleteContextMenu" />
<MenuItem Header="Reconfigure" >
<MenuItem Header="CPUs" Name="VMwareReconfigCPUsContextMenu" />
<MenuItem Header="Memory" Name="VMwareReconfigMemoryContextMenu" />
</MenuItem>
</MenuItem>
<MenuItem Header="PVS" Name="PVSContextMenu">
<MenuItem Header="Boot" Name="PVSBootContextMenu" />
<MenuItem Header="Shutdown" Name="PVSShutdownContextMenu" />
<MenuItem Header="Restart" Name="PVSRestartContextMenu" />
<MenuItem Header="Delete" Name="PVSDeleteContextMenu" />
</MenuItem>
<MenuItem Header="DDC" Name="DDCContextMenu" >
<MenuItem Header="Maintenance Mode On" Name="DDCMaintModeOnContextMenu" />
<MenuItem Header="Maintenance Mode Off" Name="DDCMaintModeOffContextMenu" />
<MenuItem Header="Message Users" Name="DDCMessageUsersContextMenu" />
<MenuItem Header="Remove from Delivery Group" Name="DDCRemoveDeliveryGroupContextMenu" />
<MenuItem Header="Delete" Name="DDCDeleteContextMenu" />
</MenuItem>
<MenuItem Header="AD" Name="ADContextMenu">
<MenuItem Header="Delete Computer" Name="ADDeleteComputerContextMenu" />
<MenuItem Header="Delete DNS Record" Name="ADDeleteDNSContextMenu" />
</MenuItem>
<MenuItem Header="Windows" Name="WindowsContextMenu">
<MenuItem Header="Shutdown" Name="WinShutdownModeOnContextMenu" />
<MenuItem Header="Restart" Name="WinRestartContextMenu" />
</MenuItem>
<MenuItem Header="Erase from Existence" Name="EraseFromExistenceContextMenu" />
</ContextMenu>
</ListView.ContextMenu>
<ListView.View>
<GridView>
<GridViewColumn Header="Device" DisplayMemberBinding ="{Binding 'Name'}" />
<GridViewColumn Header="Boot Time" DisplayMemberBinding ="{Binding 'Boot_Time'}" />
<GridViewColumn Header="Users" DisplayMemberBinding ="{Binding 'User_Sessions'}" />
<GridViewColumn Header="Maintenance Mode" DisplayMemberBinding ="{Binding 'Maintenance_Mode'}" />
</GridView>
</ListView.View>
<ListBoxItem Content="Device"/>
</ListView>
</Grid>
</Window>
'@
## Adding so we can make it app modal as well as system
Add-Type @'
using System;
using System.Runtime.InteropServices;
namespace PInvoke.Win32
{
public static class Windows
{
[DllImport("user32.dll")]
public static extern int MessageBox(int hWnd, String text, String caption, uint type);
}
}
'@
Add-Type -TypeDefinition @'
public enum MessageBoxReturns
{
IDYES = 6,
IDNO = 7 ,
IDOK = 1 ,
IDABORT = 3,
IDCANCEL = 2 ,
IDCONTINUE = 11 ,
IDIGNORE = 5 ,
IDRETRY = 4 ,
IDTRYAGAIN = 10
}
'@
Function Save-ConfigToRegistry( [string]$serverSet = 'Default' , [string[]]$DDCs , [string[]]$PVSServers , [string[]]$hypervisors )
{
[string]$key = Join-Path $configRegKey $serverSet
if( ! ( Test-Path $key -ErrorAction SilentlyContinue ) )
{
$null = New-Item -Path $key -Force
}
Set-ItemProperty -Path $key -Name 'DDC' -Value $DDCs
Set-ItemProperty -Path $key -Name 'PVS' -Value $PVSServers
Set-ItemProperty -Path $Key -Name 'Hypervisor' -Value $hypervisors
}
Function Get-ConfigFromRegistry
{
Param
(
[string]$serverSet = 'Default' ,
[ref]$DDCs ,
[ref]$PVSServers ,
[ref]$hypervisors
)
[string]$key = Join-Path $configRegKey $serverSet
if( ! ( Test-Path $key -ErrorAction SilentlyContinue ) )
{
Write-Warning "Config registry key `"$key`" does not exist"
}
$hypervisors.value = Get-ItemProperty -Path $key -Name 'Hypervisor' -ErrorAction SilentlyContinue | select -ExpandProperty 'Hypervisor'
$DDCs.value = Get-ItemProperty -Path $key -Name 'DDC' -ErrorAction SilentlyContinue | select -ExpandProperty 'DDC'
$PVSServers.value = Get-ItemProperty -Path $key -Name 'PVS' -ErrorAction SilentlyContinue | select -ExpandProperty 'PVS'
}
Function Load-GUI( $inputXaml )
{
$form = $NULL
$inputXaml = $inputXaml -replace 'mc:Ignorable="d"','' -replace "x:N",'N' -replace '^<Win.*', '<Window'
[xml]$XAML = $inputXaml
$reader = New-Object Xml.XmlNodeReader $xaml
try
{
$Form = [Windows.Markup.XamlReader]::Load( $reader )
}
catch
{
Write-Error "Unable to load Windows.Markup.XamlReader. Double-check syntax and ensure .NET is installed.`n$_"
return $null
}
$xaml.SelectNodes("//*[@Name]") | ForEach-Object `
{
Set-Variable -Name "WPF$($_.Name)" -Value $Form.FindName($_.Name) -Scope Script
}
return $form
}
Function Display-MessageBox( $window , $text , $caption , [System.Windows.MessageBoxButton]$buttons , [System.Windows.MessageBoxImage]$icon )
{
if( $window -and $window.Handle )
{
[int]$modified = switch( $buttons )
{
'OK' { [System.Windows.MessageBoxButton]::OK }
'OKCancel' { [System.Windows.MessageBoxButton]::OKCancel }
'YesNo' { [System.Windows.MessageBoxButton]::YesNo }
'YesNoCancel' { [System.Windows.MessageBoxButton]::YesNo }
}
[int]$choice = [PInvoke.Win32.Windows]::MessageBox( $Window.handle , $text , $caption , ( ( $icon -as [int] ) -bor $modified ) ) ## makes it app modal so UI blocks
switch( $choice )
{
([MessageBoxReturns]::IDYES -as [int]) { 'Yes' }
([MessageBoxReturns]::IDNO -as [int]) { 'No' }
([MessageBoxReturns]::IDOK -as [int]) { 'Ok' }
([MessageBoxReturns]::IDABORT -as [int]) { 'Abort' }
([MessageBoxReturns]::IDCANCEL -as [int]) { 'Cancel' }
([MessageBoxReturns]::IDCONTINUE -as [int]) { 'Continue' }
([MessageBoxReturns]::IDIGNORE -as [int]) { 'Ignore' }
([MessageBoxReturns]::IDRETRY -as [int]) { 'Retry' }
([MessageBoxReturns]::IDTRYAGAIN -as [int]) { 'TryAgain' }
}
}
else
{
[Windows.MessageBox]::Show( $text , $caption , $buttons , $icon )
}
}
Function Perform-Action( [string]$action , $form , [bool]$prompt = $true)
{
if( $_ -and $_.PSObject.Properties[ 'Handled' ] )
{
$_.Handled = $true
}
## Get HWND so we can make app modal dialogues
$thisWindow = [System.Windows.Interop.WindowInteropHelper]::new($form)
if( $prompt )
{
$answer = Display-MessageBox -text "Are you sure you want to $action these $($WPFlstMachines.SelectedItems.Count) devices ?" -caption 'Confirm' -buttons YesNo -icon Question -window $thisWindow
if( $answer -ne 'Yes' )
{
return
}
}
if( $action -eq 'Message' )
{
$messageForm = Load-GUI $messageWindowXAML
if( $messageForm )
{
## Load up caption and text and set callbacks
$WPFtxtMessageCaption.Text = if( [string]::IsNullOrEmpty( $messageCaption ) ) { "Message from $env:USERNAME at $(Get-Date -Format F)" } else { $messageCaption }
$WPFtxtMessageBody.Text = $messageText
$WPFbtnMessageOk.Add_Click({
$messageForm.DialogResult = $true
$messageForm.Close()
})
$WPFbtnMessageOk.IsDefault = $true
$WPFbtnMessageCancel.Add_Click({ $messageForm.Close() })
$WPFbtnMessageCancel.IsCancel = $true
$result = $messageForm.ShowDialog()
if( ! $result )
{
return
}
}
}
if( $form -and $prompt )
{
$oldCursor = $form.Cursor
$form.Cursor = [Windows.Input.Cursors]::Wait
}
[int]$errors = 0
ForEach( $device in $WPFlstMachines.SelectedItems )
{
Write-Verbose "Action $action on $($device.Name)"
[string]$FQDN = $device.Name
if( ! [string]::IsNullOrEmpty( $device.DomainName ) )
{
$FQDN = ( $device.DomainName -split '\.')[0] + '\' + $device.Name
}
if( $prompt -and $action -imatch 'remove|erase|reboot|shutdown|restart|off' -and $device.user_sessions -ge 1 )
{
if( ( $answer = Display-MessageBox -text "$FQDN has $($device.user_sessions) user sessions - are you sure you want to $action ?" -caption 'Confirm' -buttons YesNo -icon Question -window $thisWindow ) -ne 'Yes' )
{
continue
}
}
switch -regex ( $action )
{
'Erase from Existence' `
{
Perform-Action -action 'Remove From Delivery Group' -form $form -prompt $false
Perform-Action -action 'Remove From DDC' -form $form -prompt $false
Perform-Action -action 'VMware Power Off' -form $form -prompt $false
Perform-Action -action 'Remove from Hypervisor' -form $form -prompt $false
Perform-Action -action 'Remove From AD' -form $form -prompt $false
Perform-Action -action 'Remove From DNS' -form $form -prompt $false
Perform-Action -action 'Remove From PVS' -form $form -prompt $false
break
}
'Message' { Get-BrokerSession -AdminAddress $device.ddc -MachineName $FQDN | Send-BrokerSessionMessage -AdminAddress $device.ddc -Title $WPFtxtMessageCaption.Text -Text $WPFtxtMessageBody.Text -MessageStyle ($WPFcomboMessageStyle.SelectedItem.Content) ;break }
'Remove From AD' { Remove-ADComputer -Identity $device.Name -Confirm:$False ;break }
'Remove From DNS' { Get-DnsServerResourceRecord -Name $device.Name -ComputerName $script:dnsserver -ZoneName $device.DomainName | Remove-DnsServerResourceRecord -ZoneName $device.DomainName -ComputerName $script:dnsserver -Force ;break }
'Remove From Delivery Group' { Remove-BrokerMachine -Force -DesktopGroup $device.'Delivery Group' -AdminAddress $device.ddc -MachineName $FQDN ; break }
'Remove From DDC' { Remove-BrokerMachine -Force -AdminAddress $device.ddc -MachineName $FQDN ; break }
'Remove From PVS' { Set-PvsConnection -Server $device.'PVS Server'; Remove-PvsDevice -DeviceName $device.Name ; break }
'Maintenance Mode On' { Set-BrokerMachine -AdminAddress $device.ddc -InMaintenanceMode $true -MachineName $FQDN ; break }
'Maintenance Mode Off' { Set-BrokerMachine -AdminAddress $device.ddc -InMaintenanceMode $false -MachineName $FQDN ; break }
'Reboot' { Restart-Computer -ComputerName $device.Name ; break }
'Shutdown' { Stop-Computer -ComputerName $device.Name ; break }
'Remove from Hypervisor' { Get-VM -Name $device.Name | Remove-VM -DeletePermanently -Confirm:$false ;break }
'VMware Boot' { Get-VM -Name $device.name | Start-VM -Confirm:$false ;break }
'VMware Power Off' { Get-VM -Name $device.name | Stop-VM -Confirm:$false ;break }
'VMware Restart' { Get-VM -Name $device.name | Restart-VM -Confirm:$false ;break }
'PVS Boot|PVS Power Off|PVS Restart' ` ## Can't use New-BrokerHostingPowerAction as may not be known to DDC
{
Set-PvsConnection -Server $device.'PVS Server'
if( $_ -match 'Boot' )
{
if( [string]::IsNullOrEmpty( $device.'Disk Name' ) )
{
$answer = Display-MessageBox -window $thisWindow -text "$($device.Name) has no vdisk assigned so may not boot - continue ?" -caption 'Confirm' -buttons YesNo -icon Question
if( $answer -ne 'Yes' )
{
continue
}
}
$thePvsTask = Start-PvsDeviceBoot -DeviceName $device.Name
}
elseif( $_ -match 'Off' )
{
$thePvsTask = Start-PvsDeviceShutdown -DeviceName $device.Name
}
elseif( $_ -match 'Restart' )
{
$thePvsTask = Start-PvsDeviceReboot -DeviceName $device.Name
}
$timer = [Diagnostics.Stopwatch]::StartNew()
[bool]$timedOut = $false
while ( $thePvsTask -and $thePvsTask.State -eq 0 )
{
$percentFinished = Get-PvsTaskStatus -Object $thePvsTask
if( ! $percentFinished -or $percentFinished.ToString() -ne 100 )
{
Start-Sleep -timer 500
if( $timer.Elapsed.TotalSeconds -gt $timeout )
{
$timeOut = $true
break
}
}
$thePvsTask = Get-PvsTask -Object $thePvsTask
}
$timer.Stop()
if ( $timedOut )
{
Display-MessageBox -window $thisWindow -text "Failed to perform action on $($device.Name) - timed out after $timeout seconds" -caption $action -buttons OK -icon Error
$errors++
}
elseif ( ! $thePvsTask -or $thePvsTask.State -ne 2)
{
Display-MessageBox -window $thisWindow -text "Failed to perform action on $($device.Name)" -caption $action -buttons OK -icon Error
$errors++
}
}
default { Write-Warning "Unknown command `"$action`"" }
}
if( ! $? )
{
$errors++
}
}
if( $prompt )
{
if( $form )
{
$form.Cursor = $oldCursor
}
[string]$status = [System.Windows.MessageBoxImage]::Information
if( $errors )
{
$status = [System.Windows.MessageBoxImage]::Error
}
Display-MessageBox -window $thisWindow -text "$errors / $($WPFlstMachines.SelectedItems.Count) errors" -caption "Finished $action" -buttons OK -icon $status
}
}
if( $noProgress )
{
$ProgressPreference = 'SilentlyContinue'
}
if( $registry )
{
Get-ConfigFromRegistry -serverSet $serverSet -DDCs ( [ref] $ddcs ) -PVSServers ( [ref] $pvsServers ) -hypervisors ( [ref] $hypervisors )
if( ! $ddcs -or ! $ddcs.Count -or ! $pvsServers -or ! $pvsServers.Count )
{
Write-Warning "Failed to get PVS and/or DDC servers from registry key `"$configRegKey`" for server set `"$serverSet`""
return
}
}
elseif( $save )
{
Save-ConfigToRegistry -serverSet $serverSet -DDCs $ddcs -PVSServers $pvsServers -hypervisors $hypervisors
}
if( $hypervisors -and $hypervisors.Count )
{
if( [string]::IsNullOrEmpty( $name ) )
{
Write-Error "Must specify a VM name pattern via -name when cross referencing to VMware"
exit
}
Import-Module $vmWareModule -ErrorAction Stop
Write-Progress -Activity "Connecting to hypervisors $($hypervisors -split ' ')" -PercentComplete 1
$null = Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
if( Connect-VIserver -Server $hypervisors )
{
$columns.Add( 'CPUs')
$columns.Add( 'Memory (GB)')
$columns.Add( 'Hard Drives (GB)')
$columns.Add( 'NICs')
$columns.Add( 'Hypervisor')
## we pass the modules list to our function so that they can be loaded into the runspaces
$modules += $vmWareModule
}
else
{
Write-Error "Failed to connect to vmware $($hypervisors -join ' ')"
exit
}
}
if( $PSVersionTable.PSVersion.Major -lt 5 -and $columns.Count -gt 30 -and [string]::IsNullOrEmpty( $csv ) )
{
Write-Warning "This version of PowerShell limits the number of columns in a grid view to 30 and we have $($columns.Count) so those from `"$($columns[30])`" will be lost in grid view"
}
[datetime]$startTime = Get-Date
[hashtable]$devices = Get-PVSDevices -pvsservers $pvsServers -ddcs $ddcs -hypervisors $hypervisors -dns:$dns -name $name -tags:$tags -adgroups $ADgroups -noRemoting:$noRemoting -cpusamples:$cpuSamples -noProgress:$noprogress `
-maxThreads $maxThreads -timeout $timeout -jobTimeout $jobTimeout -maxRecordCount $maxRecordCount -provisioningType $provisioningType -noOrphans:$noOrphans -pvsShare $pvsShare -modules $modules -splitVM $splitVM
if( $devices -and $devices.Count )
{
if( ! [string]::IsNullOrEmpty( $csv ) )
{
$devices.GetEnumerator() | ForEach-Object { $_.Value } | Select-Object -Property $columns | Sort-Object -Property Name | Export-Csv -Path $csv -NoTypeInformation -NoClobber
}
if( ! $noGridView )
{
[hashtable]$params = @{}
if( $noMenu )
{
$params.Add( 'Wait' , $true )
}
else
{
$params.Add( 'PassThru' , $true )
}
[string]$title = "$(Get-Date -Format G) : $($devices.count) PVS devices via $($pvsServers -join ' ') & ddc $($ddcs -join ' ')"
if( ! [string]::IsNullOrEmpty( $name ) )
{
$title += " matching `"$name`""
}
[array]$selected = @( $devices.GetEnumerator() | ForEach-Object { $_.Value } | Select-Object -Property $columns | Sort-Object -Property Name | Out-GridView -Title $title @Params )
if( $selected -and $selected.Count )
{
if( -Not ( $mainForm = Load-GUI $pvsDeviceActionerXAML ) )
{
return
}
$mainForm.Title += " - $($selected.Count) devices"
if( $hypervisors -and $hypervisors.Count )
{
$WPFVMwarePowerOnContextMenu.Add_Click({ Perform-Action -action 'VMware Boot' -form $mainForm })
$WPFVMwarePowerOffContextMenu.Add_Click({ Perform-Action -action 'VMware Power Off' -form $mainForm })
$WPFVMwareRestartContextMenu.Add_Click({ Perform-Action -action 'VMware Restart' -form $mainForm })
$WPFVMwareDeleteContextMenu.Add_Click({ Perform-Action -action 'Remove From Hypervisor' -form $mainForm })
}
else
{
$WPFVMwareContextMenu.IsEnabled = $false
}
[int]$ADmenuItems = 0
if( Get-Module -Name ActiveDirectory -ErrorAction SilentlyContinue )
{
$WPFADDeleteComputerContextMenu.Add_Click({ Perform-Action -action 'Remove From AD' -form $mainForm })
$ADmenuItems++
}
if( Get-Module -Name DNSServer -ErrorAction SilentlyContinue )
{
## need to get DNS server so we can remote the delete DNS entry menu item to it
[hashtable]$ipaddressesChecked = @{}
if( -Not $PSBoundParameters[ 'domain' ] )
{
$domain = $env:USERDNSDOMAIN
}
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration -Filter 'IPEnabled = TRUE' | Select-Object -ExpandProperty DNSServerSearchOrder | ForEach-Object `
{
$ipaddress = $_
if( [string]::IsNullOrEmpty( $script:dnsserver ) -and -Not $ipaddressesChecked.ContainsKey( $ipaddress ) )
{
Write-Verbose -Message "Checking DNS server IP $ipaddress"
if( $dnsinfo = Get-DnsServer -ComputerName $ipaddress -ErrorAction SilentlyContinue )
{
ForEach( $zone in $dnsinfo.ServerZone )
{
if( $zone.ZoneName -ieq $domain )
{
$script:dnsserver = $ipaddress
Write-Verbose -Message "Using $script:dnsserver for DNS"
}
}
}
$ipaddressesChecked.Add( $ipaddress , $ipaddress ) ## so we only check any given IP address once
}
}
if( [string]::IsNullOrEmpty( $script:dnsserver ) )
{
Write-Warning -Message "Unable to find DNS server for domain $domain"
}
else
{
$WPFADDeleteDNSContextMenu.Add_Click({ Perform-Action -action 'Remove From DNS' -form $mainForm })
$ADmenuItems++
}
}
if( $ADmenuItems -eq 0 )
{
$WPFADContextMenu.IsEnabled = $false
}
$WPFDDCMessageUsersContextMenu.Add_Click({ Perform-Action -action Message -form $mainForm })
$WPFDDCRemoveDeliveryGroupContextMenu.Add_Click({ Perform-Action -action 'Remove From Delivery Group' -form $mainForm })
$WPFDDCDeleteContextMenu.Add_Click({ Perform-Action -action 'Remove From DDC' -form $mainForm })
$WPFDDCMaintModeOffContextMenu.Add_Click({ Perform-Action -action 'Maintenance Mode Off' -form $mainForm })
$WPFDDCMaintModeOnContextMenu.Add_Click({ Perform-Action -action 'Maintenance Mode On' -form $mainForm })
$WPFWinShutdownModeOnContextMenu.Add_Click({ Perform-Action -action Shutdown -form $mainForm })
$WPFWinRestartContextMenu.Add_Click({ Perform-Action -action Reboot -form $mainForm })
$WPFPVSDeleteContextMenu.Add_Click({ Perform-Action -action 'Remove From PVS' -form $mainForm })
$WPFPVSBootContextMenu.Add_Click({ Perform-Action -action 'PVS Boot' -form $mainForm })
$WPFPVSShutdownContextMenu.Add_Click({ Perform-Action -action 'PVS Power Off' -form $mainForm })
$WPFPVSRestartContextMenu.Add_Click({ Perform-Action -action 'PVS Restart' -form $mainForm })
$WPFEraseFromExistenceContextMenu.Add_Click({ Perform-Action -action 'Erase from Existence' -form $mainForm })
$WPFlstMachines.Items.Clear()
$WPFlstMachines.ItemsSource = $selected
## Select all items since already selected them in grid view
$WPFlstMachines.SelectAll()
$null = $mainForm.ShowDialog()
## Put in clipboard so we can paste into something if we need to
if( $selected )
{
$selected | Clip.exe
}
}
}
}
else
{
Write-Warning "No PVS devices found via $($pvsServers -join ' ')"
}
if( ( Get-Variable global:DefaultVIServers -ErrorAction SilentlyContinue ) -and $global:DefaultVIServers.Count )
{
Disconnect-VIServer -Server $hypervisors -Force -Confirm:$false
}
# SIG # Begin signature block
# MIINRQYJKoZIhvcNAQcCoIINNjCCDTICAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQU81BUw+pErsGyjWnY17lG+3NS
# Jc2gggqHMIIFMDCCBBigAwIBAgIQBAkYG1/Vu2Z1U0O1b5VQCDANBgkqhkiG9w0B
# AQsFADBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYD
# VQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ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