-
Notifications
You must be signed in to change notification settings - Fork 0
/
PowerRemoteShell.Export.ps1
7128 lines (6907 loc) · 455 KB
/
PowerRemoteShell.Export.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
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#------------------------------------------------------------------------
# Source File Information (DO NOT MODIFY)
# Source ID: 5e03a9cc-5dca-4c27-9fea-2f6230e3bd67
# Source File: PowerRemoteShell.psproj
#------------------------------------------------------------------------
#region Project Recovery Data (DO NOT MODIFY)
<#RecoveryData:
8wIAAB+LCAAAAAAABAClklFrgzAQgN8L/Q/iu9Xq2lKwgY3i1od1UsteR4zndItGkljXf790icXR
jcH6dt/l7jvCXbgDwg7Aj2ssMRqPLCuMOXsDIr9A4TNwUbIa+RMvdHswb1FJYbNGM/ACvCTEmWUE
OzfEXzjLHLDj53M/8CBIs/kidE2xaTVT9scGkBIPsZczmqlxljucJgwYtO7akmYr27NRIjGXbTNp
hNCzfqu0kgJzUOGet2BbO8iBQ00gamsi1edW9qY+sHdw7ilLMX1pxNRGOhbKPv3D/oMvKVjnPOKy
jhivlC+3UU9KmP9TeJtlW+gemJBCOweJa7Qpa6URnsIrVHECH0DUaqvGGIeZC7EGveHzRWh64uVr
WWN6KtjiClDMOuA7qJiEpABKlaxRDaF7UTkehe63I/8EpeVSfPMCAAA=#>
#endregion
<#
.NOTES
--------------------------------------------------------------------------------
Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.140
Generated on: 1/25/2018 11:20 PM
Generated by: Administrator
--------------------------------------------------------------------------------
.DESCRIPTION
Script generated by PowerShell Studio 2017
#>
#region Source: Startup.pss
#region File Recovery Data (DO NOT MODIFY)
<#RecoveryData:
2gMAAB+LCAAAAAAABAC9k0tLAzEQgO+C/yH0vGR33a5rIbsglV4EFVfUazadLcE8yiRpyb+3rVJF
QaGHMJd5MPMxL/YIwm4A4w33nOwUJ61pJxe0nHTnZ4Swe5QrabhaSAV3XEPXe44+rOnaOZb/ih5y
rp0DPSgJ7mB/eWKnnbCo5JCR50/WlBZ7ycg8KB8QWgPBI1cZeQi7GuIW4pN9A9MOTcNrUV+Ws2oK
xdWM5ceqPyl9dB50CgZ9kWZpt44uLGqXhLjfVBoQ8q00q1NYRTXWYzOW5bIueMX/Z71qlaSnuUVI
MzyJILzF2ANupICTbuPvMR7Nj0dj+fdf7t4BtbYVHtoDAAA=#>
#endregion
#----------------------------------------------
#region Import Assemblies
#----------------------------------------------
[void][Reflection.Assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
[void][Reflection.Assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
[void][Reflection.Assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
[void][Reflection.Assembly]::Load('System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
#endregion Import Assemblies
#Define a Param block to use custom parameters in the project
#Param ($CustomParameter)
function Main {
<#
.SYNOPSIS
The Main function starts the project application.
.PARAMETER Commandline
$Commandline contains the complete argument string passed to the script packager executable.
.NOTES
Use this function to initialize your script and to call GUI forms.
.NOTES
To get the console output in the Packager (Forms Engine) use:
$ConsoleOutput (Type: System.Collections.ArrayList)
#>
Param ([String]$Commandline)
#--------------------------------------------------------------------------
#TODO: Add initialization script here (Load modules and check requirements)
#--------------------------------------------------------------------------
if((Show-MainForm_psf) -eq 'OK')
{
}
$script:ExitCode = 0 #Set the exit code for the Packager
}
#endregion Source: Startup.pss
#region Source: Globals.ps1
#--------------------------------------------
# Declare Global Variables and Functions here
#--------------------------------------------
#Sample function that provides the location of the script
function Get-ScriptDirectory
{
<#
.SYNOPSIS
Get-ScriptDirectory returns the proper location of the script.
.OUTPUTS
System.String
.NOTES
Returns the correct path within a packaged executable.
#>
[OutputType([string])]
param ()
if ($null -ne $hostinvocation)
{
Split-Path $hostinvocation.MyCommand.path
}
else
{
Split-Path $script:MyInvocation.MyCommand.Path
}
}
#Sample variable that provides the location of the script
[string]$ScriptDirectory = Get-ScriptDirectory
#region Control Helper Functions
function Update-DataGridView
{
<#
.SYNOPSIS
This functions helps you load items into a DataGridView.
.DESCRIPTION
Use this function to dynamically load items into the DataGridView control.
.PARAMETER DataGridView
The DataGridView control you want to add items to.
.PARAMETER Item
The object or objects you wish to load into the DataGridView's items collection.
.PARAMETER DataMember
Sets the name of the list or table in the data source for which the DataGridView is displaying data.
.PARAMETER AutoSizeColumns
Resizes DataGridView control's columns after loading the items.
#>
Param (
[ValidateNotNull()]
[Parameter(Mandatory = $true)]
[System.Windows.Forms.DataGridView]$DataGridView,
[ValidateNotNull()]
[Parameter(Mandatory = $true)]
$Item,
[Parameter(Mandatory = $false)]
[string]$DataMember,
[System.Windows.Forms.DataGridViewAutoSizeColumnMode]$AutoSizeColumns = 'None'
)
$DataGridView.SuspendLayout()
$DataGridView.DataMember = $DataMember
if ($Item -is [System.Data.DataSet] -and $Item.Tables.Count -gt 0)
{
$DataGridView.DataSource = $Item.Tables[0]
}
elseif ($Item -is [System.ComponentModel.IListSource]`
-or $Item -is [System.ComponentModel.IBindingList] -or $Item -is [System.ComponentModel.IBindingListView])
{
$DataGridView.DataSource = $Item
}
else
{
$array = New-Object System.Collections.ArrayList
if ($Item -is [System.Collections.IList])
{
$array.AddRange($Item)
}
else
{
$array.Add($Item)
}
$DataGridView.DataSource = $array
}
if ($AutoSizeColumns -ne 'None')
{
$DataGridView.AutoResizeColumns($AutoSizeColumns)
}
$DataGridView.ResumeLayout()
}
function ConvertTo-DataTable
{
<#
.SYNOPSIS
Converts objects into a DataTable.
.DESCRIPTION
Converts objects into a DataTable, which are used for DataBinding.
.PARAMETER InputObject
The input to convert into a DataTable.
.PARAMETER Table
The DataTable you wish to load the input into.
.PARAMETER RetainColumns
This switch tells the function to keep the DataTable's existing columns.
.PARAMETER FilterWMIProperties
This switch removes WMI properties that start with an underline.
.EXAMPLE
$DataTable = ConvertTo-DataTable -InputObject (Get-Process)
#>
[OutputType([System.Data.DataTable])]
param (
[ValidateNotNull()]
$InputObject,
[ValidateNotNull()]
[System.Data.DataTable]$Table,
[switch]$RetainColumns,
[switch]$FilterWMIProperties)
if ($null -eq $Table)
{
$Table = New-Object System.Data.DataTable
}
if ($InputObject -is [System.Data.DataTable])
{
$Table = $InputObject
}
elseif ($InputObject -is [System.Data.DataSet] -and $InputObject.Tables.Count -gt 0)
{
$Table = $InputObject.Tables[0]
}
else
{
if (-not $RetainColumns -or $Table.Columns.Count -eq 0)
{
#Clear out the Table Contents
$Table.Clear()
if ($null -eq $InputObject) { return } #Empty Data
$object = $null
#find the first non null value
foreach ($item in $InputObject)
{
if ($null -ne $item)
{
$object = $item
break
}
}
if ($null -eq $object) { return } #All null then empty
#Get all the properties in order to create the columns
foreach ($prop in $object.PSObject.Get_Properties())
{
if (-not $FilterWMIProperties -or -not $prop.Name.StartsWith('__')) #filter out WMI properties
{
#Get the type from the Definition string
$type = $null
if ($null -ne $prop.Value)
{
try { $type = $prop.Value.GetType() }
catch { Out-Null }
}
if ($null -ne $type) # -and [System.Type]::GetTypeCode($type) -ne 'Object')
{
[void]$table.Columns.Add($prop.Name, $type)
}
else #Type info not found
{
[void]$table.Columns.Add($prop.Name)
}
}
}
if ($object -is [System.Data.DataRow])
{
foreach ($item in $InputObject)
{
$Table.Rows.Add($item)
}
return @( ,$Table)
}
}
else
{
$Table.Rows.Clear()
}
foreach ($item in $InputObject)
{
$row = $table.NewRow()
if ($item)
{
foreach ($prop in $item.PSObject.Get_Properties())
{
if ($table.Columns.Contains($prop.Name))
{
$row.Item($prop.Name) = $prop.Value
}
}
}
[void]$table.Rows.Add($row)
}
}
return @( ,$Table)
}
#endregion
Function Get-hostList
{
If ((Show-AddNewHosts_psf) -eq 'OK')
{
$List = ($AddNewHosts_textbox1).ToString().Trim()
if ($List)
{
$HostList = $List.Split("`n")
$c = 1
$OriginalList = foreach ($Item in $HostList)
{
$Computer = $Item.ToString().Trim()
if ($Computer)
{
$Obj = New-Object -TypeName System.Management.Automation.PSObject
Add-Member -InputObject $Obj -MemberType NoteProperty -Name ComputerName -Value $Computer
Add-Member -InputObject $Obj -MemberType NoteProperty -Name SLNo -Value $c
Add-Member -InputObject $Obj -MemberType NoteProperty -Name Executed -Value $false
Add-Member -InputObject $Obj -MemberType NoteProperty -Name Result -Value $null
Add-Member -InputObject $Obj -MemberType NoteProperty -Name Error -Value $false
Add-Member -InputObject $Obj -MemberType NoteProperty -Name ErrMsg -Value $null
$c++
$Obj
}
}
$global:Targetlist = @($OriginalList)
#Set-Variable -Name Original -Value $OriginalList -Option Constant -Scope Global -Force
Display-DGV
}
}
}
function Reset-Targetlist
{
foreach ($line1 in $global:targetList)
{
$line1.Executed = $false
$line1.Error = $false
$line1.Result = $null
}
}
function Display-DGV
{
$Datagridview1.Datasource = $null
$Display = $Targetlist | Select-Object -Property SLNo, ComputerName, Executed, Error
$Displaytable = ConvertTo-DataTable -InputObject $Display
Update-DataGridView -DataGridView $datagridview1 -Item $Displaytable -AutoSizeColumns DisplayedCells
Highlight-Cell
}
function Highlight-Cell
{
$columnCount = $datagridviewResults.ColumnCount
$rowCount = $datagridviewResults.RowCount
$Statusindex = 0
#
for ($RowIndex = 0; $RowIndex -lt $rowCount; $RowIndex++)
{
$StatusCell = $datagridviewResults.Rows[$RowIndex].Cells[$Statusindex]
$StatusVal = $StatusCell.Value
if ($StatusVal -eq $true)
{
#$StatusCell.Style.Backcolor = "Green"
$datagridviewResults.Rows[$RowIndex].Cells[$Statusindex].Style.BackColor = 'DeepSkyBlue'
}
else
{
$datagridviewResults.Rows[$RowIndex].Cells[$Statusindex].Style.BackColor = 'Orange'
}
}
}
#endregion Source: Globals.ps1
#region Source: MainForm.psf
function Show-MainForm_psf
{
#region File Recovery Data (DO NOT MODIFY)
<#RecoveryData:
MgwGAB+LCAAAAAAABADtnWlz6jzToL+nKv+BOlM1NVM+7xE79sx9nyq2BBKSkISsX55iMUtCIGGH
t+a/j7ptwIBXsMEkree5OSGxL0stqdVutaR/7uRqdyT3ppnyoBzgP/Rb3c6/v8J/Qr/+np4EAv/c
9FqNVqfcPmu15evyh/z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Psc5MQxdNa8zsTtv1pb8lrX593cED
A8oTbdWWWQ6Psa4swshMa8v8Xk/615Nc6etGJulUlXn2rCor2e/LH1yEcn/+CPU3078f/Wq3125V
XKiGf9iCuv4UpeL38QzXG5f1E2GLk/08qFcetzqNbZ4VjNRj9UQ9FKrFguVI2fpZzx/tvZQp3e3J
7j9o8VVp8v+wO7kKYS5TqKu//x8FlFe5MgwGAA==#>
#endregion
#----------------------------------------------
#region Import the Assemblies
#----------------------------------------------
[void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
[void][reflection.assembly]::Load('System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')
[void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
[void][reflection.assembly]::Load('System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
#endregion Import Assemblies
#----------------------------------------------
#region Define SAPIEN Types
#----------------------------------------------
try{
[ProgressBarOverlay] | Out-Null
}
catch
{
Add-Type -ReferencedAssemblies ('System.Windows.Forms', 'System.Drawing') -TypeDefinition @"
using System;
using System.Windows.Forms;
using System.Drawing;
namespace SAPIENTypes
{
public class ProgressBarOverlay : System.Windows.Forms.ProgressBar
{
public ProgressBarOverlay() : base() { SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); }
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == 0x000F)// WM_PAINT
{
if (Style != System.Windows.Forms.ProgressBarStyle.Marquee || !string.IsNullOrEmpty(this.Text))
{
using (Graphics g = this.CreateGraphics())
{
using (StringFormat stringFormat = new StringFormat(StringFormatFlags.NoWrap))
{
stringFormat.Alignment = StringAlignment.Center;
stringFormat.LineAlignment = StringAlignment.Center;
if (!string.IsNullOrEmpty(this.Text))
g.DrawString(this.Text, this.Font, Brushes.Black, this.ClientRectangle, stringFormat);
else
{
int percent = (int)(((double)Value / (double)Maximum) * 100);
g.DrawString(percent.ToString() + "%", this.Font, Brushes.Black, this.ClientRectangle, stringFormat);
}
}
}
}
}
}
public string TextOverlay
{
get
{
return base.Text;
}
set
{
base.Text = value;
Invalidate();
}
}
}
}
"@ -IgnoreWarnings | Out-Null
}
#endregion Define SAPIEN Types
#----------------------------------------------
#region Generated Form Objects
#----------------------------------------------
[System.Windows.Forms.Application]::EnableVisualStyles()
$formPowerRemoteShell10 = New-Object 'System.Windows.Forms.Form'
$splitcontainer2 = New-Object 'System.Windows.Forms.SplitContainer'
$statusbar1 = New-Object 'System.Windows.Forms.StatusBar'
$menustrip1 = New-Object 'System.Windows.Forms.MenuStrip'
$splitcontainer1 = New-Object 'System.Windows.Forms.SplitContainer'
$groupboxhostList = New-Object 'System.Windows.Forms.GroupBox'
$buttonAddHosts = New-Object 'System.Windows.Forms.Button'
$datagridview1 = New-Object 'System.Windows.Forms.DataGridView'
$groupbox1 = New-Object 'System.Windows.Forms.GroupBox'
$buttonShow = New-Object 'System.Windows.Forms.Button'
$textboxPwd = New-Object 'System.Windows.Forms.TextBox'
$textboxUname = New-Object 'System.Windows.Forms.TextBox'
$labelPassword = New-Object 'System.Windows.Forms.Label'
$labelUserName = New-Object 'System.Windows.Forms.Label'
$radiobuttonUseAlternateCredenti = New-Object 'System.Windows.Forms.RadioButton'
$radiobuttonUseDefaultCredential = New-Object 'System.Windows.Forms.RadioButton'
$fileToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$helpToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$richtextboxResult = New-Object 'System.Windows.Forms.RichTextBox'
$buttonExecute = New-Object 'System.Windows.Forms.Button'
$progressbaroverlay1 = New-Object 'SAPIENTypes.ProgressBarOverlay'
$labelForeachComputerInTar = New-Object 'System.Windows.Forms.Label'
$labelComputerNameComputer = New-Object 'System.Windows.Forms.Label'
$labelYourScriptblockDefin = New-Object 'System.Windows.Forms.Label'
$textboxblock = New-Object 'System.Windows.Forms.TextBox'
$tabcontrol1 = New-Object 'System.Windows.Forms.TabControl'
$tabpage1 = New-Object 'System.Windows.Forms.TabPage'
$richtextboxResult = New-Object 'System.Windows.Forms.RichTextBox'
$labelComputerNameRemoteCo = New-Object 'System.Windows.Forms.Label'
$labelInCaseOfEmergencyGla = New-Object 'System.Windows.Forms.Label'
$buttonBreak = New-Object 'System.Windows.Forms.Button'
$addHostsToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$aboutToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$contactAuthorToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$resetConfigToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$documentationToolStripMenuItem = New-Object 'System.Windows.Forms.ToolStripMenuItem'
$InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
#endregion Generated Form Objects
#----------------------------------------------
# User Generated Script
#----------------------------------------------
$formPowerRemoteShell10_Load={
#TODO: Initialize Form Controls here
$global:EscapeChar = $false
}
$buttonExecute_Click={
#TODO: Place custom script here
$buttonExecute.Enabled = $false
$global:EscapeChar = $false
Reset-Targetlist
Display-DGV
$RunSpacePool = [RunspaceFactory]::CreateRunspacePool(1, 30)
$RunSpacePool.ApartmentState = "MTA"
#$RunSpacePool.ApartmentState = "STA"
$RunSpacePool.Open()
#Alternate Credentials
if ($radiobuttonUseAlternateCredenti.Checked)
{
$userName = $textboxUname.Text
$securePassword = $textboxPwd.Text | ConvertTo-SecureString -AsPlainText -Force
$PScredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $userName, $securePassword
}
else
{
$PScredential = $null
}
$progressbaroverlay1.Visible = $true
$progressbaroverlay1.Style = 'Continuous'
$progressbaroverlay1.Maximum = (($Targetlist.count) * 3) + 1
$progressbaroverlay1.Step = 1
$progressbaroverlay1.Value = 0
$progressbaroverlay1.TextOverlay = "Starting background threads..."
#$CommandText = $richtextboxCommand.Text
$CommandText = $textboxblock.Text
$ScriptBlock = [scriptblock]::Create($CommandText)
$Datepart = (Get-Date).ToString("yyyyMMdd-hhmmss")
New-Item -Type Directory -Name RemoteScript00 -Path "C:\" -erroraction SilentlyContinue
if (!(Test-Path "C:\RemoteScript00\Psexec.exe"))
{
if (!(Test-Path .\Psexec.exe))
{
#[System.Windows.Forms.MessageBox]::Show("Psexec may be required to Run your scriptblock on machines without properly configured WinRM. If you are confident that WinRM is configured on all your target machines, you can ignore this message. Otherwise, please place psexec.exe on the same folder this tool is running from and Press OK after you are done.", 'Psexec request', 'OK', 'Warning')
$LoadedConfig = Get-Content .\PowerRSConfig.json | ConvertFrom-Json
if (!($LoadedConfig.NeverPromptPSexec -eq $true))
{
if ((Show-PSexecPrompt_psf) -eq 'OK')
{
if ($PSexecPrompt_checkboxDontPromptMeForPSexe)
{
$PowerConfig = New-Object -TypeName System.Management.Automation.PSObject
Add-Member -InputObject $PowerConfig -MemberType NoteProperty -Name NeverPromptPSexec -Value $true
$PowerConfig | ConvertTo-Json | Out-File .\PowerRSConfig.json -Force
}
}
}
}
$null = Copy-Item .\psexec.exe C:\RemoteScript00\Psexec.exe -erroraction SilentlyContinue
}
$ScriptBlock | Out-File C:\RemoteScript00\remotescript_$Datepart.ps1 -Force
#Main ScriptBlock
$MainBlock = {
param (
[Parameter(Mandatory = $true,
Position = 0)]
$textboxblock,
# Param2 help description
[Parameter(Mandatory = $true,
Position = 1)]
$Computer,
[Parameter(Mandatory = $true,
Position = 2)]
$Datepart,
[Parameter(Mandatory = $false,
Position = 3)]
$PScredential
)
$CommandText = $textboxblock.Text
$ScriptBlock = [scriptblock]::Create($CommandText)
try
{
if ($PScredential)
{
$Result = Invoke-Command -ScriptBlock $Scriptblock -ComputerName $Computer -Credential $PScredential -ErrorAction Stop
}
else
{
$Result = Invoke-Command -ScriptBlock $Scriptblock -ComputerName $Computer -ErrorAction Stop
}
}
catch [System.Management.Automation.Remoting.PSRemotingTransportException]
{
$RemotePath = "\\$Computer\C$\RemoteScript00"
$BannerFile = "RCBanner_" + "$Computer" + "_$Datepart.txt"
if ($PScredential)
{
if (!(Test-Path $RemotePath))
{
$null = New-Item -Path "\\$Computer\C$" -Name "RemoteScript00" -ItemType Directory -erroraction SilentlyContinue -Credential $PScredential
}
$null = Copy-Item "C:\RemoteScript00\remotescript_$Datepart.ps1" "\\$Computer\C$\RemoteScript00\remotescript_$Datepart.ps1" -Force -Credential $PScredential
$uname = $PScredential.Username
$pswd = $PScredential.GetnetworkCredential().Password
$Result = C:\RemoteScript00\Psexec.exe \\$Computer -u $uname -p $pswd cmd /c "echo . | powershell C:\RemoteScript00\remotescript_$Datepart.ps1" 2>"C:\RemoteScript00\$BannerFile"
}
else
{
if (!(Test-Path $RemotePath))
{
$null = New-Item -Path "\\$Computer\C$" -Name "RemoteScript00" -ItemType Directory -erroraction SilentlyContinue
}
$null = Copy-Item "C:\RemoteScript00\remotescript_$Datepart.ps1" "\\$Computer\C$\RemoteScript00\remotescript_$Datepart.ps1" -Force
$Result = C:\RemoteScript00\Psexec.exe \\$Computer cmd /c "echo . | powershell C:\RemoteScript00\remotescript_$Datepart.ps1" 2>"C:\RemoteScript00\$BannerFile"
}
if (!$Result)
{
$ErrorMsg = Get-Content C:\RemoteScript00\$BannerFile
Throw $ErrorMsg
}
$null = Remove-Item "\\$Computer\C$\RemoteScript00\remotescript_$Datepart.ps1"
}
Return $Result
}
$Threads = @()
#kickoff Runspace Execution
foreach ($Line in $global:Targetlist)
{
if ($global:EscapeChar -eq $false)
{
$Computer = ($Line.ComputerName).tostring().trim()
$slno = $Line.Slno
#Create Runspace Object
$RunSpaceObject = [PSCustomObject] @{
Runspace = [PowerShell]::Create()
Invoker = $null
Name = $slno
}
$RunSpaceObject.Runspace.AddScript($MainBlock) | Out-Null
$RunSpaceObject.Runspace.AddArgument($textboxblock)
$RunSpaceObject.Runspace.AddArgument($Computer)
$RunSpaceObject.Runspace.AddArgument($Datepart)
if ($PScredential)
{
$RunSpaceObject.Runspace.AddArgument($PScredential)
}
$RunSpaceObject.Runspace.RunspacePool = $RunSpacePool
$RunSpaceObject.Invoker = $RunSpaceObject.Runspace.BeginInvoke()
$Threads += $RunSpaceObject
$progressbaroverlay1.PerformStep()
}
}
#Waiting and displaying progress
$i = 0
#$JobCount = $Targetlist.count
$ThreadCount = $Threads.count
$Ref = $Completed = 0
do
{
Start-Sleep -Milliseconds 50
[System.Windows.Forms.Application]::DoEvents()
if ($i % 20 -eq 0)
{
#$RunningJobs = (Get-Job -State Running).count
$RunningThreads = (@($Threads | Where-Object { $_.Invoker.Iscompleted -eq $false })).Count
#$Completed = $JobCount - $RunningJobs
$Completed = $ThreadCount - $RunningThreads