-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHFServerEvents.ps1
2828 lines (2732 loc) · 115 KB
/
HFServerEvents.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
write-host 'Starting HF Event Server Setup Script..'
$EvtServer = ((Get-WmiObject win32_computersystem).DNSHostName+"."+(Get-WmiObject win32_computersystem).Domain)
$EvtS = (Get-WmiObject win32_computersystem).DNSHostName
$Forest = [system.directoryservices.activedirectory.Forest]::GetCurrentForest()
$DCs = $Forest.domains | ForEach-Object {$_.DomainControllers}
################################################## Configure Collector Server ###########################################################
function ConfigCollector {
try{
if ((Test-Path -Path C:\EvtHF -PathType Container) -eq $false) {New-Item -Type Directory -Force -Path C:\EvtHF}
$DCSec = ("C:\EvtHF\EvtHF_DC_Sec.xml")
if ((test-path $DCSec) -eq $false) {new-item $DCSec -Type file -Force}
Clear-Content $DCSec
$DCSys = ("C:\EvtHF\EvtHF_DC_Sys.xml")
if ((test-path $DCSys) -eq $false) {new-item $DCSys -Type file -Force}
Clear-Content $DCSys
$XMLDCSec = @'
<?xml version="1.0" encoding="UTF-8"?>
<Subscription xmlns="http://schemas.microsoft.com/2006/03/windows/events/subscription">
<SubscriptionId>HFEventServer_DC_Security</SubscriptionId>
<SubscriptionType>SourceInitiated</SubscriptionType>
<Description></Description>
<Enabled>true</Enabled>
<Uri>http://schemas.microsoft.com/wbem/wsman/1/windows/EventLog</Uri>
<ConfigurationMode>Custom</ConfigurationMode>
<Delivery Mode="Push">
<Batching>
<MaxLatencyTime>900000</MaxLatencyTime>
</Batching>
<PushSettings>
<Heartbeat Interval="900000"/>
</PushSettings>
</Delivery>
<Query>
<![CDATA[
<QueryList>
<Query Id="0"><Select Path="Security">*[System[(EventID=4618 or EventID=4618 or EventID=4649 or EventID=4719 or EventID=4765 or EventID=4766 or EventID=4794 or EventID=4897)]]</Select></Query>
<Query Id="1"><Select Path="Security">*[System[(EventID=4964 or EventID=5124 or EventID=1102 or EventID=4621 or EventID=4675 or EventID=4692 or EventID=4693 or EventID=4706)]]</Select></Query>
<Query Id="2"><Select Path="Security">*[System[(EventID=4713 or EventID=4714 or EventID=4715 or EventID=4716 or EventID=4724 or EventID=4727 or EventID=4735 or EventID=4737)]]</Select></Query>
<Query Id="3"><Select Path="Security">*[System[(EventID=4739 or EventID=4754 or EventID=4755 or EventID=4764 or EventID=4764 or EventID=4780 or EventID=4816 or EventID=4865)]]</Select></Query>
<Query Id="4"><Select Path="Security">*[System[(EventID=4866 or EventID=4867 or EventID=4868 or EventID=4870 or EventID=4882 or EventID=4885 or EventID=4890 or EventID=4892)]]</Select></Query>
<Query Id="5"><Select Path="Security">*[System[(EventID=4896 or EventID=4906 or EventID=4907 or EventID=4908 or EventID=4912 or EventID=4960 or EventID=4961 or EventID=4962)]]</Select></Query>
<Query Id="6"><Select Path="Security">*[System[(EventID=4963 or EventID=4965 or EventID=4976 or EventID=4977 or EventID=4978 or EventID=4983 or EventID=4984 or EventID=5027)]]</Select></Query>
<Query Id="7"><Select Path="Security">*[System[(EventID=5028 or EventID=5029 or EventID=5030 or EventID=5035 or EventID=5037 or EventID=5038 or EventID=5120 or EventID=5121)]]</Select></Query>
<Query Id="8"><Select Path="Security">*[System[(EventID=5122 or EventID=5123 or EventID=5376 or EventID=5377 or EventID=5453 or EventID=5480 or EventID=5483 or EventID=5484)]]</Select></Query>
<Query Id="9"><Select Path="Security">*[System[(EventID=5485 or EventID=6145 or EventID=6273 or EventID=6274 or EventID=6275 or EventID=6276 or EventID=6277 or EventID=6278)]]</Select></Query>
<Query Id="10"><Select Path="Security">*[System[(EventID=6279 or EventID=6280 or EventID=24586 or EventID=24592 or EventID=24593 or EventID=24594 or EventID=4608 or EventID=4609)]]</Select></Query>
<Query Id="11"><Select Path="Security">*[System[(EventID=4610 or EventID=4611 or EventID=4612 or EventID=4614 or EventID=4615 or EventID=4616 or EventID=4622 or EventID=4624)]]</Select></Query>
<Query Id="12"><Select Path="Security">*[System[(EventID=4625 or EventID=4634 or EventID=4646 or EventID=4647 or EventID=4648 or EventID=4650 or EventID=4651 or EventID=4652)]]</Select></Query>
<Query Id="13"><Select Path="Security">*[System[(EventID=4653 or EventID=4654 or EventID=4655 or EventID=4656 or EventID=4657 or EventID=4658 or EventID=4659 or EventID=4660)]]</Select></Query>
<Query Id="14"><Select Path="Security">*[System[(EventID=4661 or EventID=4662 or EventID=4663 or EventID=4664 or EventID=4665 or EventID=4666 or EventID=4667 or EventID=4668)]]</Select></Query>
<Query Id="15"><Select Path="Security">*[System[(EventID=4670 or EventID=4671 or EventID=4672 or EventID=4673 or EventID=4674 or EventID=4688 or EventID=4689 or EventID=4690)]]</Select></Query>
<Query Id="16"><Select Path="Security">*[System[(EventID=4691 or EventID=4694 or EventID=4695 or EventID=4696 or EventID=4697 or EventID=4698 or EventID=4699 or EventID=4700)]]</Select></Query>
<Query Id="17"><Select Path="Security">*[System[(EventID=4701 or EventID=4702 or EventID=4704 or EventID=4705 or EventID=4707 or EventID=4709 or EventID=4710 or EventID=4711)]]</Select></Query>
<Query Id="18"><Select Path="Security">*[System[(EventID=4712 or EventID=4717 or EventID=4718 or EventID=4720 or EventID=4722 or EventID=4723 or EventID=4725 or EventID=4726)]]</Select></Query>
<Query Id="19"><Select Path="Security">*[System[(EventID=4728 or EventID=4729 or EventID=4730 or EventID=4731 or EventID=4732 or EventID=4733 or EventID=4734 or EventID=4738)]]</Select></Query>
<Query Id="20"><Select Path="Security">*[System[(EventID=4740 or EventID=4741 or EventID=4742 or EventID=4743 or EventID=4744 or EventID=4745 or EventID=4746 or EventID=4747)]]</Select></Query>
<Query Id="21"><Select Path="Security">*[System[(EventID=4748 or EventID=4749 or EventID=4750 or EventID=4751 or EventID=4752 or EventID=4753 or EventID=4756 or EventID=4757)]]</Select></Query>
<Query Id="22"><Select Path="Security">*[System[(EventID=4758 or EventID=4759 or EventID=4760 or EventID=4761 or EventID=4762 or EventID=4767 or EventID=4768 or EventID=4769)]]</Select></Query>
<Query Id="23"><Select Path="Security">*[System[(EventID=4770 or EventID=4771 or EventID=4772 or EventID=4774 or EventID=4775 or EventID=4776 or EventID=4777 or EventID=4778)]]</Select></Query>
<Query Id="24"><Select Path="Security">*[System[(EventID=4779 or EventID=4781 or EventID=4782 or EventID=4783 or EventID=4784 or EventID=4785 or EventID=4786 or EventID=4787)]]</Select></Query>
<Query Id="25"><Select Path="Security">*[System[(EventID=4788 or EventID=4789 or EventID=4790 or EventID=4793 or EventID=4800 or EventID=4801 or EventID=4802 or EventID=4803)]]</Select></Query>
<Query Id="26"><Select Path="Security">*[System[(EventID=4864 or EventID=4869 or EventID=4871 or EventID=4872 or EventID=4873 or EventID=4874 or EventID=4875 or EventID=4876)]]</Select></Query>
<Query Id="27"><Select Path="Security">*[System[(EventID=4877 or EventID=4878 or EventID=4879 or EventID=4880 or EventID=4881 or EventID=4883 or EventID=4884 or EventID=4886)]]</Select></Query>
<Query Id="28"><Select Path="Security">*[System[(EventID=4887 or EventID=4888 or EventID=4889 or EventID=4891 or EventID=4893 or EventID=4894 or EventID=4895 or EventID=4898)]]</Select></Query>
<Query Id="29"><Select Path="Security">*[System[(EventID=4902 or EventID=4904 or EventID=4905 or EventID=4909 or EventID=4910 or EventID=4928 or EventID=4929 or EventID=4930)]]</Select></Query>
<Query Id="30"><Select Path="Security">*[System[(EventID=4931 or EventID=4932 or EventID=4933 or EventID=4934 or EventID=4935 or EventID=4936 or EventID=4937 or EventID=4944)]]</Select></Query>
<Query Id="31"><Select Path="Security">*[System[(EventID=4945 or EventID=4946 or EventID=4947 or EventID=4948 or EventID=4949 or EventID=4950 or EventID=4951 or EventID=4952)]]</Select></Query>
<Query Id="32"><Select Path="Security">*[System[(EventID=4953 or EventID=4954 or EventID=4956 or EventID=4957 or EventID=4958 or EventID=4979 or EventID=4980 or EventID=4981)]]</Select></Query>
<Query Id="33"><Select Path="Security">*[System[(EventID=4982 or EventID=4985 or EventID=5024 or EventID=5025 or EventID=5031 or EventID=5032 or EventID=5033 or EventID=5034)]]</Select></Query>
<Query Id="34"><Select Path="Security">*[System[(EventID=5039 or EventID=5040 or EventID=5041 or EventID=5042 or EventID=5043 or EventID=5044 or EventID=5045 or EventID=5046)]]</Select></Query>
<Query Id="35"><Select Path="Security">*[System[(EventID=5047 or EventID=5048 or EventID=5050 or EventID=5051 or EventID=5056 or EventID=5057 or EventID=5058 or EventID=5059)]]</Select></Query>
<Query Id="36"><Select Path="Security">*[System[(EventID=5060 or EventID=5061 or EventID=5062 or EventID=5063 or EventID=5064 or EventID=5065 or EventID=5066 or EventID=5067)]]</Select></Query>
<Query Id="37"><Select Path="Security">*[System[(EventID=5068 or EventID=5069 or EventID=5070 or EventID=5125 or EventID=5126 or EventID=5127 or EventID=5136 or EventID=5137)]]</Select></Query>
<Query Id="38"><Select Path="Security">*[System[(EventID=5138 or EventID=5139 or EventID=5140 or EventID=5141 or EventID=5152 or EventID=5153 or EventID=5154 or EventID=5155)]]</Select></Query>
<Query Id="39"><Select Path="Security">*[System[(EventID=5156 or EventID=5157 or EventID=5158 or EventID=5159 or EventID=5378 or EventID=5440 or EventID=5441 or EventID=5442)]]</Select></Query>
<Query Id="40"><Select Path="Security">*[System[(EventID=5443 or EventID=5444 or EventID=5446 or EventID=5447 or EventID=5448 or EventID=5449 or EventID=5450 or EventID=5451)]]</Select></Query>
<Query Id="41"><Select Path="Security">*[System[(EventID=5452 or EventID=5456 or EventID=5457 or EventID=5458 or EventID=5459 or EventID=5460 or EventID=5461 or EventID=5462)]]</Select></Query>
<Query Id="42"><Select Path="Security">*[System[(EventID=5463 or EventID=5464 or EventID=5465 or EventID=5466 or EventID=5467 or EventID=5468 or EventID=5471 or EventID=5472)]]</Select></Query>
<Query Id="43"><Select Path="Security">*[System[(EventID=5473 or EventID=5474 or EventID=5477 or EventID=5479 or EventID=5632 or EventID=5633 or EventID=5712 or EventID=5888)]]</Select></Query>
<Query Id="44"><Select Path="Security">*[System[(EventID=5889 or EventID=5890 or EventID=6008 or EventID=6144 or EventID=6272 or EventID=24577 or EventID=24578 or EventID=24579)]]</Select></Query>
<Query Id="45"><Select Path="Security">*[System[(EventID=24580 or EventID=24581 or EventID=24582 or EventID=24583 or EventID=24584 or EventID=24588 or EventID=24595 or EventID=24621)]]</Select></Query>
<Query Id="46"><Select Path="Security">*[System[(EventID=5049 or EventID=5478)]]</Select></Query>
</QueryList>
]]>
</Query>
<ReadExistingEvents>false</ReadExistingEvents>
<TransportName>HTTP</TransportName>
<ContentFormat>RenderedText</ContentFormat>
<Locale Language="en-US"/>
<LogFile>ForwardedEvents</LogFile>
<PublisherName>Microsoft-Windows-EventCollector</PublisherName>
<AllowedSourceNonDomainComputers>
<AllowedIssuerCAList>
</AllowedIssuerCAList>
</AllowedSourceNonDomainComputers>
<AllowedSourceDomainComputers>O:NSG:BAD:P(A;;GA;;;DD)S:</AllowedSourceDomainComputers>
</Subscription>
'@
Add-Content $DCSec $XMLDCSec
$XMLDCSys = @'
<?xml version="1.0" encoding="UTF-8"?>
<Subscription xmlns="http://schemas.microsoft.com/2006/03/windows/events/subscription">
<SubscriptionId>HFEventServer_DC_System</SubscriptionId>
<SubscriptionType>SourceInitiated</SubscriptionType>
<Description></Description>
<Enabled>true</Enabled>
<Uri>http://schemas.microsoft.com/wbem/wsman/1/windows/EventLog</Uri>
<ConfigurationMode>Custom</ConfigurationMode>
<Delivery Mode="Push">
<Batching>
<MaxLatencyTime>900000</MaxLatencyTime>
</Batching>
<PushSettings>
<Heartbeat Interval="900000"/>
</PushSettings>
</Delivery>
<Query>
<![CDATA[
<QueryList><Query Id="0"><Select Path="System">*[System[(Level=1 or Level=2 or Level=3)]]</Select></Query></QueryList>
]]>
</Query>
<ReadExistingEvents>false</ReadExistingEvents>
<TransportName>HTTP</TransportName>
<ContentFormat>RenderedText</ContentFormat>
<Locale Language="en-US"/>
<LogFile>ForwardedEvents</LogFile>
<PublisherName>Microsoft-Windows-EventCollector</PublisherName>
<AllowedSourceNonDomainComputers>
<AllowedIssuerCAList>
</AllowedIssuerCAList>
</AllowedSourceNonDomainComputers>
<AllowedSourceDomainComputers>O:NSG:BAD:P(A;;GA;;;DD)S:</AllowedSourceDomainComputers>
</Subscription>
'@
Add-Content $DCSys $XMLDCSys
################################################## Configure Collector Server ###########################################################
write-host 'Configuring Collector Server..'
Invoke-Command -ScriptBlock {winrm quickconfig}
Invoke-Command -ScriptBlock {net stop wecsvc}
Invoke-Command -ScriptBlock {net start wecsvc}
Invoke-Command -ScriptBlock {wecutil qc /quiet}
Invoke-Command -ScriptBlock {wecutil cs $DCSec}
Invoke-Command -ScriptBlock {wecutil cs $DCSys}
Invoke-Command -ScriptBlock {New-LocalGroup -Name 'HF Event Report Viewer' -Description 'Group Created by the HF Event Server Script.'}
Invoke-Command -ScriptBlock {New-NetFirewallRule -DisplayName 'HF Server Event Reports' -Direction Inbound -LocalPort 80 -Protocol TCP -Action Allow}
write-host 'Setting Forwarded Events Max Size to 4 GB..'
Set-Itemproperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\ForwardedEvents' -Name 'MaxSize' -value '1193424384'
}
catch
{
throw $Error
}
}
#################################################### SQL Server Local #################################################################
function ConfigSQLServer {
try{
$EvtTables = ('SecurityLog','SystemLog')
Invoke-Sqlcmd
if(Get-Module -Name "*Sql*") {
CD SQLSERVER:\sql\localhost\
$srv = get-item default
$sqlsrv = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server($EvtS)
$db = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Database -argumentlist $srv, "EventServerDB"
$db.Create()
$ftc = New-Object -TypeName Microsoft.SqlServer.Management.SMO.FullTextCatalog -argumentlist $db, "FTS_Catalog"
$ftc.IsDefault = $true
$ftc.Create()
Foreach ($Table in $EvtTables)
{
$tb = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Table -argumentlist $db, $Table
$Type = [Microsoft.SqlServer.Management.SMO.DataType]::NChar(50)
$col0 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Column -argumentlist $tb,"SQLID", ([Microsoft.SqlServer.Management.SMO.DataType]::bigint)
$col1 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Column -argumentlist $tb,"ID", ([Microsoft.SqlServer.Management.SMO.DataType]::int)
$col2 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Column -argumentlist $tb,"LevelDisplayName", ([Microsoft.SqlServer.Management.SMO.DataType]::varchar(255))
$col3 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Column -argumentlist $tb,"LogName", ([Microsoft.SqlServer.Management.SMO.DataType]::varchar(255))
$col4 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Column -argumentlist $tb,"MachineName", ([Microsoft.SqlServer.Management.SMO.DataType]::varchar(255))
$col5 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Column -argumentlist $tb,"Message", ([Microsoft.SqlServer.Management.SMO.DataType]::varcharmax)
$col6 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Column -argumentlist $tb,"Source", ([Microsoft.SqlServer.Management.SMO.DataType]::varchar(255))
$col7 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Column -argumentlist $tb,"RecordID", ([Microsoft.SqlServer.Management.SMO.DataType]::bigint)
$col8 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Column -argumentlist $tb,"TaskDisplayName", ([Microsoft.SqlServer.Management.SMO.DataType]::varchar(255))
$col9 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Column -argumentlist $tb,"TimeCreated", ([Microsoft.SqlServer.Management.SMO.DataType]::smalldatetime)
$col0.Nullable = $false
$col0.Identity = $true
$col0.IdentitySeed = 1
$col0.IdentityIncrement = 1
$col1.Nullable = $true
$col2.Nullable = $true
$col3.Nullable = $true
$col4.Nullable = $true
$col5.Nullable = $true
$col6.Nullable = $true
$col7.Nullable = $true
$col8.Nullable = $true
$col9.Nullable = $true
$tb.Columns.Add($col0)
$tb.Columns.Add($col1)
$tb.Columns.Add($col2)
$tb.Columns.Add($col3)
$tb.Columns.Add($col4)
$tb.Columns.Add($col5)
$tb.Columns.Add($col6)
$tb.Columns.Add($col7)
$tb.Columns.Add($col8)
$tb.Columns.Add($col9)
$tb.Create()
$idx = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Index -argumentlist $tb, ('UniquedIndex-'+$Table)
$icol0 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.IndexedColumn -argumentlist $idx, "SQLID", $true
$idx.IndexedColumns.Add($icol0)
$idx.IndexKeyType = [Microsoft.SqlServer.Management.SMO.IndexKeyType]::DriUniqueKey
$idx.Create()
$idx = New-Object -TypeName Microsoft.SqlServer.Management.SMO.Index -argumentlist $tb, ('ClusteredIndex-'+$Table)
$icol1 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.IndexedColumn -argumentlist $idx, "ID", $true
$idx.IndexedColumns.Add($icol1)
$icol2 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.IndexedColumn -argumentlist $idx, "MachineName", $true
$idx.IndexedColumns.Add($icol2)
$icol3 = New-Object -TypeName Microsoft.SqlServer.Management.SMO.IndexedColumn -argumentlist $idx, "Source", $true
$idx.IndexedColumns.Add($icol3)
$idx.IsClustered = $true
$idx.IgnoreDuplicateKeys = $true
$idx.Create()
$fti = New-Object -TypeName Microsoft.SqlServer.Management.SMO.FullTextIndex -argumentlist $tb
$ftic = New-Object -TypeName Microsoft.SqlServer.Management.SMO.FullTextIndexColumn -argumentlist $fti, "Message"
$fti.IndexedColumns.Add($ftic)
$fti.ChangeTracking = [Microsoft.SqlServer.Management.SMO.ChangeTracking]::Automatic
$fti.UniqueIndexName = ('UniquedIndex-'+$Table)
$fti.CatalogName = "FTS_Catalog"
$fti.Create()
}
$db2 = $sqlsrv.Databases['EventServerDB']
$login = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Login -ArgumentList $sqlsrv, ($EvtS+'\HF Event Report Viewer')
$login.LoginType = "WindowsGroup"
$login.DefaultDatabase = 'EventServerDB'
$login.Create()
$user = New-Object -typeName Microsoft.SqlServer.Management.Smo.User -ArgumentList $db2, ($EvtS+'\HF Event Report Viewer')
$user.Login = ($EvtS+'\HF Event Report Viewer')
$user.create()
$role = $db2.Roles['db_datareader']
$role.AddMember(($EvtS+'\HF Event Report Viewer'))
}
else {Write-Host 'SQL Server Powershell Module NOT FOUND!'}
CD C:
}
catch
{
throw $Error
}
}
#################################################### Configure Client Machines to forward #################################################################
function ConfigDCs {
Foreach ($DC in $DCs)
{
write-host 'Configuring Domain Controllers to Forward Events..'
Invoke-Command -ScriptBlock {winrm quickconfig} -ComputerName $DC.Name
Invoke-Command -ScriptBlock {wecutil qc /quiet} -ComputerName $DC.Name
Invoke-Command -ScriptBlock {if (!(Test-Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\EventLog\EventForwarding\SubscriptionManager')) {New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\EventLog\EventForwarding\SubscriptionManager' -Force | Out-Null}} -ComputerName $DC.Name
Invoke-Command -ComputerName $DC.Name -ScriptBlock {if (!(Get-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\EventLog\EventForwarding\SubscriptionManager' -Name 1)) {New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\EventLog\EventForwarding\SubscriptionManager' -Name 1 -Value ('Server=http://'+$($args)+':5985/wsman/SubscriptionManager/WEC,Refresh=60') -PropertyType String -Force | Out-Null}} -ArgumentList $EvtServer
}
Invoke-Command -ComputerName $DC.Name -ScriptBlock {net localgroup "Event Log Readers" /add 'Network Service'}
#Invoke-Command -ComputerName $DC.Name -ScriptBlock {$Acc = Get-ADComputer -Identity $($args); Get-ADGroup -Identity "Event Log Readers" | Add-ADGroupMember -Members $Acc} -ArgumentList $EvtS
}
#################################################### Creating de Task Scheduler #################################################################
Function CreateTask {
try{
$PsScript = @'
$time = Get-Date
$SyncLog = ("C:\EvtHF\DBSync.log")
if ((test-path $SyncLog) -eq $false)
{
new-item $SyncLog -Type file -Force
Add-Content $SyncLog 'New HF Event Server Database Sincronization log'
Add-Content $SyncLog ('New HF DB Sync log created at: '+$time)
Add-Content $SyncLog ('Starting First Sync')
}
if (!(Get-Item -Path 'HKLM:\SOFTWARE\HFEvents' -ErrorAction SilentlyContinue))
{
New-Item -Path 'HKLM:\SOFTWARE\HFEvents' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\HFEvents' -Name 'LastSync' -Value $time -PropertyType string -Force | Out-Null
$Regkey = $false
}
else
{
$Regkey = $true
}
if ($Regkey -eq $true)
{
$TimeKey = Get-ItemProperty -Path 'HKLM:\SOFTWARE\HFEvents' -Name 'LastSync' -ErrorAction SilentlyContinue
$timediff = [int](New-TimeSpan -Start (Get-Date -Date $TimeKey.LastSync) -End (Get-Date)).TotalMilliseconds
$XMLQuery = @"
<QueryList>
<Query Id="0" Path="ForwardedEvents">
<Select Path="ForwardedEvents">*[System[TimeCreated[timediff(@SystemTime) <= $timediff ]]]</Select>
</Query>
</QueryList>
"@
$events = Get-WinEvent -FilterXml $XMLQuery | Select-Object ID, LevelDisplayName, LogName, MachineName, Message, ProviderName, RecordID, TaskDisplayName, TimeCreated
}
else
{
$events = Get-WinEvent -LogName 'ForwardedEvents' | Select-Object ID, LevelDisplayName, LogName, MachineName, Message, ProviderName, RecordID, TaskDisplayName, TimeCreated
}
$curtime = (Get-Date)
$evt = $events | ? {$_.LogName -eq 'System'}
$totalevts = $evt.Count
if ($Regkey -eq $true)
{
$evt = $evt | ? {$_.TimeCreated -ge [DateTime]$TimeKey.LastSync}
$totalevts = $evt.Count
}
Add-Content $SyncLog ([string]$curtime+' - Starting DB Sync of: '+$totalevts + ' System Events.')
$EvtServer = ((Get-WmiObject win32_computersystem).DNSHostName+"."+(Get-WmiObject win32_computersystem).Domain)
$connectionString = ('Data Source='+$EvtServer+';Integrated Security=true;Initial Catalog=EventServerDB;')
$bulkCopy = new-object ("Data.SqlClient.SqlBulkCopy") $connectionString
$bulkCopy.DestinationTableName = "SystemLog"
$bulkCopy.BulkCopyTimeout = 900
$dt = New-Object "System.Data.DataTable"
$cols = $evt | select -first 1 | get-member -MemberType NoteProperty | select -Expand Name
$null = $dt.Columns.Add('SQLID')
foreach ($col in $cols) {$null = $dt.Columns.Add($col)}
foreach ($event in $evt)
{
$row = $dt.NewRow()
$row.Item('SQLID') = (([guid]::NewGuid()).Guid)
foreach ($col in $cols) { $row.Item($col) = $event.$col }
$dt.Rows.Add($row)
}
$bulkCopy.WriteToServer($dt)
$curtime = (Get-Date)
$evt = $events | ? {$_.LogName -eq 'Security'}
$totalevts = $evt.Count
if ($Regkey -eq $true)
{
$evt = $evt | ? {$_.TimeCreated -ge [DateTime]$TimeKey.LastSync}
$totalevts = $evt.Count
}
Add-Content $SyncLog ([string]$curtime+' - Starting DB Sync of: '+$totalevts + ' Security Events.')
$bulkCopy = new-object ("Data.SqlClient.SqlBulkCopy") $connectionString
$bulkCopy.DestinationTableName = "SecurityLog"
$bulkCopy.BulkCopyTimeout = 900
$dt = New-Object "System.Data.DataTable"
$cols = $evt | select -first 1 | get-member -MemberType NoteProperty | select -Expand Name
$null = $dt.Columns.Add('SQLID')
foreach ($col in $cols) {$null = $dt.Columns.Add($col)}
foreach ($event in $evt)
{
$row = $dt.NewRow()
$row.Item('SQLID') = (([guid]::NewGuid()).Guid)
foreach ($col in $cols) { $row.Item($col) = $event.$col }
$dt.Rows.Add($row)
}
$bulkCopy.WriteToServer($dt)
if ($Regkey -eq $true) {Set-ItemProperty -Path 'HKLM:\SOFTWARE\HFEvents' -Name 'LastSync' -Value $time -Force | Out-Null}
'@
$PsScript | Out-File C:\EvtHF\DefaultScript.ps1
$user = [Security.Principal.WindowsIdentity]::GetCurrent()
$action = New-ScheduledTaskAction -Execute 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' -Argument '-NoProfile -WindowStyle Hidden -command "& {C:\EvtHF\DefaultScript.ps1}"'
$trigger = New-ScheduledTaskTrigger -Once -at (Get-Date) -RepetitionInterval (New-TimeSpan -hours 1)
$principal = New-ScheduledTaskPrincipal -UserId $user.Name -LogonType S4U -RunLevel Highest
$task = New-ScheduledTask -Action $action -Trigger $trigger -Principal $principal -Description "Hourly task to add Forwarded Events into de SQL Server Database. This Task was created automatically by the HF Event Server script (by Claudio Merola)"
Register-ScheduledTask "HFEventServer\HFEventServer-DCEssentials" -InputObject $task
}
catch
{
throw $Error
}
}
#################################################### Creating the Reports Files #################################################################
function ReportFiles {
try{
if ((Test-Path -Path C:\EvtHF\Reports -PathType Container) -eq $false) {New-Item -Type Directory -Force -Path C:\EvtHF\Reports}
$SecReport = @'
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns:cl="http://schemas.microsoft.com/sqlserver/reporting/2010/01/componentdefinition" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition">
<AutoRefresh>0</AutoRefresh>
<DataSources>
<DataSource Name="HardFinger">
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>Data Source=localhost;Initial Catalog=EventServerDB</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
<rd:SecurityType>Integrated</rd:SecurityType>
<rd:DataSourceID>94c9029b-e7c6-4bc0-b977-66e92cc2c98f</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="MainReport">
<Query>
<DataSourceName>HardFinger</DataSourceName>
<QueryParameters>
<QueryParameter Name="@ID">
<Value>=Parameters!ID.Value</Value>
</QueryParameter>
<QueryParameter Name="@Message">
<Value>=Parameters!Message.Value</Value>
<rd:UserDefined>true</rd:UserDefined>
</QueryParameter>
<QueryParameter Name="@Source">
<Value>=Parameters!Source.Value</Value>
</QueryParameter>
<QueryParameter Name="@Level">
<Value>=Parameters!Level.Value</Value>
<rd:UserDefined>true</rd:UserDefined>
</QueryParameter>
</QueryParameters>
<CommandText>if (@Message = '')
SELECT
SecurityLog.ID
,SecurityLog.LevelDisplayName
,SecurityLog.LogName
,SecurityLog.MachineName
,SecurityLog.Message
,SecurityLog.Source
,SecurityLog.RecordID
,SecurityLog.TaskDisplayName
,SecurityLog.TimeCreated
FROM
SecurityLog
WHERE
SecurityLog.ID like
case
when @ID = 'All' then '%'
ELSE @ID
END
and SecurityLog.Source like
case
when @Source = 'All' then '%'
ELSE @Source
END
and SecurityLog.LevelDisplayName like
case
when @Level = 'All' then '%'
ELSE @Level
END
else
SELECT
SecurityLog.ID
,SecurityLog.LevelDisplayName
,SecurityLog.LogName
,SecurityLog.MachineName
,SecurityLog.Message
,SecurityLog.Source
,SecurityLog.RecordID
,SecurityLog.TaskDisplayName
,SecurityLog.TimeCreated
FROM
SecurityLog
WHERE
SecurityLog.ID like
case
when @ID = 'All' then '%'
ELSE @ID
END
and SecurityLog.Source like
case
when @Source = 'All' then '%'
ELSE @Source
END
and SecurityLog.LevelDisplayName like
case
when @Level = 'All' then '%'
ELSE @Level
END
and FREETEXT (SecurityLog.Message, @Message)</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
<Fields>
<Field Name="Id">
<DataField>ID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="LevelDisplayName">
<DataField>LevelDisplayName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="LogName">
<DataField>LogName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="MachineName">
<DataField>MachineName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Message">
<DataField>Message</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Source">
<DataField>Source</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="RecordID">
<DataField>RecordID</DataField>
<rd:TypeName>System.Int64</rd:TypeName>
</Field>
<Field Name="TaskDisplayName">
<DataField>TaskDisplayName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="TimeCreated">
<DataField>TimeCreated</DataField>
<rd:TypeName>System.DateTime</rd:TypeName>
</Field>
</Fields>
<Filters>
<Filter>
<FilterExpression>=Fields!TimeCreated.Value</FilterExpression>
<Operator>Between</Operator>
<FilterValues>
<FilterValue>=Parameters!StartDate.Value</FilterValue>
<FilterValue>=Parameters!EndDate.Value</FilterValue>
</FilterValues>
</Filter>
</Filters>
</DataSet>
<DataSet Name="IDs">
<Query>
<DataSourceName>HardFinger</DataSourceName>
<CommandText>select 0 as [Order],'All' as [ID]
union
SELECT Distinct
1,
cast(SecurityLog.ID as varchar)
FROM
SecurityLog
order by 1</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
<Fields>
<Field Name="ID">
<DataField>ID</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
</DataSet>
<DataSet Name="Source">
<Query>
<DataSourceName>HardFinger</DataSourceName>
<CommandText>select 0 as [Order],'All' as [Source]
union
SELECT Distinct
1,
SecurityLog.Source
FROM
SecurityLog
order by 1</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
<Fields>
<Field Name="Source">
<DataField>Source</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
</DataSet>
<DataSet Name="Level">
<Query>
<DataSourceName>HardFinger</DataSourceName>
<CommandText>select 0 as [Order],'All' as [Level]
union
SELECT Distinct
1,
SecurityLog.LevelDisplayName
FROM
SecurityLog
order by 1</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
<Fields>
<Field Name="Level">
<DataField>Level</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
</DataSet>
<DataSet Name="StartDate">
<Query>
<DataSourceName>HardFinger</DataSourceName>
<CommandText>SELECT top 1
SecurityLog.TimeCreated
FROM
SecurityLog
order by 1</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
<Fields>
<Field Name="TimeCreated">
<DataField>TimeCreated</DataField>
<rd:TypeName>System.DateTime</rd:TypeName>
</Field>
</Fields>
</DataSet>
<DataSet Name="EndDate">
<Query>
<DataSourceName>HardFinger</DataSourceName>
<CommandText>SELECT top 1
SecurityLog.TimeCreated
FROM
SecurityLog
order by 1 Desc</CommandText>
<rd:UseGenericDesigner>true</rd:UseGenericDesigner>
</Query>
<Fields>
<Field Name="TimeCreated">
<DataField>TimeCreated</DataField>
<rd:TypeName>System.DateTime</rd:TypeName>
</Field>
</Fields>
</DataSet>
</DataSets>
<ReportSections>
<ReportSection>
<Body>
<ReportItems>
<Tablix Name="Tablix1">
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>1.8253in</Width>
</TablixColumn>
<TablixColumn>
<Width>1.4503in</Width>
</TablixColumn>
<TablixColumn>
<Width>1.72113in</Width>
</TablixColumn>
<TablixColumn>
<Width>1.40863in</Width>
</TablixColumn>
<TablixColumn>
<Width>5.9753in</Width>
</TablixColumn>
<TablixColumn>
<Width>2.37738in</Width>
</TablixColumn>
<TablixColumn>
<Width>2.37738in</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>0.25in</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Textbox2">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Machine Name</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>11pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox2</rd:DefaultName>
<Style>
<Border>
<Color>#4e648a</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#384c70</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox3">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Log Name</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>11pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox3</rd:DefaultName>
<Style>
<Border>
<Color>#4e648a</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#384c70</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox5">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Category</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>11pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox5</rd:DefaultName>
<Style>
<Border>
<Color>#4e648a</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#384c70</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox7">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Event ID</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>11pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox7</rd:DefaultName>
<Style>
<Border>
<Color>#4e648a</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#384c70</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox9">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Message</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>11pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox9</rd:DefaultName>
<Style>
<Border>
<Color>#4e648a</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#384c70</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox11">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Source</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>11pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox11</rd:DefaultName>
<Style>
<Border>
<Color>#4e648a</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#384c70</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
<TablixCell>
<CellContents>
<Textbox Name="Textbox13">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Event Date</Value>
<Style>
<FontFamily>Tahoma</FontFamily>
<FontSize>11pt</FontSize>
<FontWeight>Bold</FontWeight>
<Color>White</Color>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<rd:DefaultName>Textbox13</rd:DefaultName>
<Style>
<Border>
<Color>#4e648a</Color>
<Style>Solid</Style>
</Border>
<BackgroundColor>#384c70</BackgroundColor>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
</Style>
</Textbox>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
<TablixRow>
<Height>0.25in</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="MachineName">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=Fields!MachineName.Value</Value>
<Style>