forked from canix1/ADACLScanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ADACLScan.ps1
15480 lines (13751 loc) · 654 KB
/
ADACLScan.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
<#
.Synopsis
ADACLScan.ps1
AUTHOR: Robin Granberg (robin.g@home.se)
THIS CODE-SAMPLE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR
FITNESS FOR A PARTICULAR PURPOSE.
.DESCRIPTION
A tool with GUI or command linte used to create reports of access control lists (DACLs) and system access control lists (SACLs) in Active Directory.
See https://github.com/canix1/ADACLScanner
.EXAMPLE
.\ADACLScan.ps1
Start in GUI mode.
.EXAMPLE
.\ADACLScan.ps1 -Base "OU=CORP,DC=CONTOS,DC=COM"
Create a CSV file with the permissions of the object CORP.
.EXAMPLE
.\ADACLScan.ps1 -Base "OU=CORP,DC=CONTOS,DC=COM" -Output HTML
Create a HTML file with the permissions of the object CORP.
.EXAMPLE
.\ADACLScan.ps1 -Base "OU=CORP,DC=CONTOS,DC=COM" -Output EXCEL
Create a Excel file with the permissions of the object CORP.
.EXAMPLE
.\ADACLScan.ps1 -Base "OU=CORP,DC=CONTOS,DC=COM" -Output HTML -Show
Opens the HTML (HTA) file with the permissions of the object CORP.
.EXAMPLE
.\ADACLScan.ps1 -Base "OU=CORP,DC=CONTOS,DC=COM" -Output HTML -Show -SDDate
Opens the HTML (HTA) file with the permissions of the object CORP including the modified date of the security descriptor.
.EXAMPLE
.\ADACLScan.ps1 -Base "OU=CORP,DC=CONTOS,DC=COM" -OutputFolder C:\Temp
Create a CSV file in the folder C:\Temp, with the permissions of the object CORP.
.EXAMPLE
.\ADACLScan.ps1 -Base "OU=CORP,DC=CONTOS,DC=COM" -Scope subtree
Create a CSV file with the permissions of the object CORP and all child objects of type OrganizationalUnit.
.EXAMPLE
.\ADACLScan.ps1 -Base "OU=CORP,DC=CONTOS,DC=COM" -Scope subtree -EffectiveRightsPrincipal joe"
Create a CSV file with the effective permissions of all the objects in the path for the user "joe".
.EXAMPLE
.\ADACLScan.ps1 -Base "OU=CORP,DC=CONTOS,DC=COM" -Scope subtree -Filter "(objectClass=user)"
Create a CSV file with the permissions of all the objects in the path and below that matches the filter (objectClass=user).
.EXAMPLE
.\ADACLScan.ps1 -Base "OU=CORP,DC=CONTOS,DC=COM" -Scope subtree -Filter "(objectClass=user)" -Server DC1
Targeted search against server "DC1" that will create a CSV file with the permissions of all the objects in the path and below that matches the filter (objectClass=user).
.EXAMPLE
.\ADACLScan.ps1 -Base "OU=CORP,DC=CONTOS,DC=COM" -Scope subtree -Filter "(objectClass=user)" -Server DC1 -Port 389
Targeted search against server "DC1" on port 389 that will create a CSV file with the permissions of all the objects in the path and below that matches the filter (objectClass=user).
.OUTPUTS
The output is an CSV,HTML or EXCEL report.
.LINK
https://github.com/canix1/ADACLScanner
.NOTES
Version: 6.2
26 April, 2020
*SHA256:*
*Fixed issues*
* Could not retrieve object sid
#>
Param
(
# DistinguishedName to start your search at. Always included as long as your filter matches your object.
[Alias("b")]
[Parameter(Mandatory=$false,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
ValueFromRemainingArguments=$false,
Position=0,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Base,
# Filter. Specify your custom filter. Default is OrganizationalUnit.
[Alias("f")]
[Parameter(Mandatory=$false,
Position=1,
ParameterSetName='Default')]
[validatescript({$_ -like "(*=*)"})]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Filter,
# Scope. Set your scope. Default is base.
[Parameter(Mandatory=$false,
Position=2,
ParameterSetName='Default')]
[ValidateSet("base", "onelevel", "subtree")]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Scope = "base",
# Server. Specify your specific server to target your search at.
[Parameter(Mandatory=$false,
Position=3,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Server,
# Port. Specify your custom port.
[Parameter(Mandatory=$false,
Position=4,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Port,
# EffectiveRightsPrincipal. Specify your security principal to chech for effective permissions
[Parameter(Mandatory=$false,
Position=5,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$EffectiveRightsPrincipal,
# Generates a HTML report, default is a CSV.
[Parameter(Mandatory=$false,
Position=6,
ParameterSetName='Default')]
[ValidateSet("CSV", "HTML", "EXCEL")]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Output = "",
# Output folder path for where results are written.
[Parameter(Mandatory=$false,
Position=7,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$OutputFolder,
# Template to compare with.
[Parameter(Mandatory=$false,
Position=8,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Template,
# Template to compare with.
[Parameter(Mandatory=$false,
Position=8,
ParameterSetName='Default')]
[ValidateSet("ALL", "MATCH", "NEW","MISSING")]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Returns="ALL",
# Template to compare with.
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$ExcelFile="",
# Filter on Criticality.
[Alias("c")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateSet("Critical", "Warning", "Medium","Low","Info")]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Criticality="",
# Skip default permissions
[Alias("sd")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$SkipDefaults,
# Skip Built-in security principals
[Alias("sb")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$SkipBuiltIn,
# Expand groups
[Alias("rf")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$RecursiveFind,
# Filter on Criticality.
[Alias("ro")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateSet("User", "Computer", "Group","*")]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$RecursiveObjectType="*",
# Skip Built-in security principals
[Alias("tr")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$Translate,
# Get Group Policy Objects linked
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$GPO,
# Open HTML report
[Alias("s")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$Show,
# Include Security Descriptor modified date in report
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$SDDate,
# Include Owner in report
[Alias("o")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$Owner,
# Include Canonical Names in report
[Alias("cn")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$CanonicalNames,
# Include if inheritance is disabled in report
[Alias("p")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$Protected,
# Data Managment Delegation OU Name
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$help,
# Scan Default Security Descriptor
[Alias("dsd")]
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$DefaultSecurityDescriptor,
# Filter Default Security Descriptor on ObjectName
[Alias("on")]
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$ObjectName="*",
# Filter Default Security Descriptor on modified with version number higher than 1
[Alias("om")]
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$OnlyModified
)
[string]$global:SessionID = [GUID]::NewGuid().Guid
[string]$global:ACLHTMLFileName = "ACLHTML-$SessionID"
[string]$global:SPNHTMLFileName = "SPNHTML-$SessionID"
[string]$global:ModifiedDefSDAccessFileName = "ModifiedDefSDAccess-$SessionID"
[string]$global:LegendHTMLFileName = "LegendHTML-$SessionID"
if([threading.thread]::CurrentThread.ApartmentState.ToString() -eq 'MTA')
{
write-host -ForegroundColor RED "RUN PowerShell.exe with -STA switch"
write-host -ForegroundColor RED "Example:"
write-host -ForegroundColor RED " PowerShell -STA $PSCommandPath"
Write-Host "Press any key to continue ..."
[VOID]$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Exit
}
#Set global value for time out in paged searches
$global:TimeoutSeconds = 120
#Set global value for page size in paged searches
$global:PageSize = 1000
# Hash table for Forest Level
$global:ForestFLHashAD = @{
0="Windows 2000 Server";
1="Windows Server 2003/Interim";
2="Windows Server 2003";
3="Windows Server 2008";
4="Windows Server 2008 R2";
5="Windows Server 2012";
6="Windows Server 2012 R2";
7="Windows Server 2016"
}
#Hash table for Domain Level
$global:DomainFLHashAD = @{
0="Windows 2000 Server";
1="Windows Server 2003/Interim";
2="Windows Server 2003";
3="Windows Server 2008";
4="Windows Server 2008 R2";
5="Windows Server 2012";
6="Windows Server 2012 R2";
7="Windows Server 2016"
}
$global:SchemaHashAD = @{
13="Windows 2000 Server";
30="Windows Server 2003";
31="Windows Server 2003 R2";
44="Windows Server 2008";
47="Windows Server 2008 R2";
56="Windows Server 2012";
69="Windows Server 2012 R2";
72="Windows Server 2016 Technical Preview";
81="Windows Server 2016 Technical Preview 2";
82="Windows Server 2016 Technical Preview 3";
85="Windows Server 2016 Technical Preview 4";
87="Windows Server 2016"
}
# List of Exchange Schema versions
$global:SchemaHashExchange = @{
4397="Exchange Server 2000";
4406="Exchange Server 2000 SP3";
6870="Exchange Server 2003";
6936="Exchange Server 2003 SP3";
10628="Exchange Server 2007";
10637="Exchange Server 2007";
11116="Exchange Server 2007 SP1";
14622="Exchange Server 2007 SP2 or Exchange Server 2010";
14726="Exchange Server 2010 SP1";
14732="Exchange Server 2010 SP2";
14734="Exchange Server 2010 SP3";
15137="Exchange Server 2013 RTM";
15254="Exchange Server 2013 CU1";
15281="Exchange Server 2013 CU2";
15283="Exchange Server 2013 CU3";
15292="Exchange Server 2013 SP1/CU4";
15300="Exchange Server 2013 CU5";
15303="Exchange Server 2013 CU6";
15312="Exchange Server 2013 CU7";
15317="Exchange Server 2016";
15323="Exchange Server 2016 CU1";
15325="Exchange Server 2016 CU2";
15326="Exchange Server 2016 CU3";
}
# List of Lync Schema versions
$global:SchemaHashLync = @{
1006="LCS 2005";
1007="OCS 2007 R1";
1008="OCS 2007 R2";
1100="Lync Server 2010";
1150="Lync Server 2013"
}
Function BuildSchemaDic
{
$global:dicSchemaIDGUIDs = @{"BF967ABA-0DE6-11D0-A285-00AA003049E2" ="user";`
"BF967A86-0DE6-11D0-A285-00AA003049E2" = "computer";`
"BF967A9C-0DE6-11D0-A285-00AA003049E2" = "group";`
"BF967ABB-0DE6-11D0-A285-00AA003049E2" = "volume";`
"F30E3BBE-9FF0-11D1-B603-0000F80367C1" = "gPLink";`
"F30E3BBF-9FF0-11D1-B603-0000F80367C1" = "gPOptions";`
"BF967AA8-0DE6-11D0-A285-00AA003049E2" = "printQueue";`
"4828CC14-1437-45BC-9B07-AD6F015E5F28" = "inetOrgPerson";`
"5CB41ED0-0E4C-11D0-A286-00AA003049E2" = "contact";`
"BF967AA5-0DE6-11D0-A285-00AA003049E2" = "organizationalUnit";`
"BF967A0A-0DE6-11D0-A285-00AA003049E2" = "pwdLastSet"}
$global:dicNameToSchemaIDGUIDs = @{"user"="BF967ABA-0DE6-11D0-A285-00AA003049E2";`
"computer" = "BF967A86-0DE6-11D0-A285-00AA003049E2";`
"group" = "BF967A9C-0DE6-11D0-A285-00AA003049E2";`
"volume" = "BF967ABB-0DE6-11D0-A285-00AA003049E2";`
"gPLink" = "F30E3BBE-9FF0-11D1-B603-0000F80367C1";`
"gPOptions" = "F30E3BBF-9FF0-11D1-B603-0000F80367C1";`
"printQueue" = "BF967AA8-0DE6-11D0-A285-00AA003049E2";`
"inetOrgPerson" = "4828CC14-1437-45BC-9B07-AD6F015E5F28";`
"contact" = "5CB41ED0-0E4C-11D0-A286-00AA003049E2";`
"organizationalUnit" = "BF967AA5-0DE6-11D0-A285-00AA003049E2";`
"pwdLastSet" = "BF967A0A-0DE6-11D0-A285-00AA003049E2"}
}
BuildSchemaDic
$CurrentFSPath = $PSScriptRoot
Add-Type -Assembly PresentationFramework
$xamlBase = @"
<Window x:Class="ADACLScanXAMLProj.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="AD ACL Scanner" WindowStartupLocation="CenterScreen" Height="690" Width="1035" ResizeMode="CanResizeWithGrip" WindowState="Normal" Background="#2A3238" >
<Window.Resources>
<XmlDataProvider x:Name="xmlprov" x:Key="DomainOUData"/>
<DrawingImage x:Name="FolderImage" x:Key="FolderImage" >
<DrawingImage.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="#FF3D85F5">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="3,6,32,22" RadiusX="0" RadiusY="0" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#FF3D81F5">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="18,3,13,5" RadiusX="2" RadiusY="2" />
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<HierarchicalDataTemplate x:Key="NodeTemplate" ItemsSource="{Binding XPath=OU}">
<StackPanel Orientation="Horizontal">
<Image Width="16" Height="16" Stretch="Fill" Source="{Binding XPath=@Img}"/>
<TextBlock Text="{Binding XPath=@Name}" Margin="2,0,0,0" />
</StackPanel>
</HierarchicalDataTemplate>
</Window.Resources>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Height="640" Width="1000">
<StackPanel Orientation="Vertical" Margin="10,0,0,0" >
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical">
<TabControl x:Name="tabConnect" HorizontalAlignment="Left" Height="245" Margin="0,10,0,0" VerticalAlignment="Top" Width="350">
<TabItem x:Name="tabNCSelect" Header="Connect" Width="85">
<StackPanel Orientation="Vertical" Margin="05,0">
<StackPanel Orientation="Horizontal">
<RadioButton x:Name="rdbDSdef" Content="Domain" HorizontalAlignment="Left" Height="18" Margin="5,10,0,0" VerticalAlignment="Top" Width="65" IsChecked="True"/>
<RadioButton x:Name="rdbDSConf" Content="Config" HorizontalAlignment="Left" Height="18" Margin="5,10,0,0" VerticalAlignment="Top" Width="61"/>
<RadioButton x:Name="rdbDSSchm" Content="Schema" HorizontalAlignment="Left" Height="18" Margin="5,10,0,0" VerticalAlignment="Top" Width="65"/>
<RadioButton x:Name="rdbCustomNC" Content="Custom" HorizontalAlignment="Left" Height="18" Margin="5,10,0,0" VerticalAlignment="Top" Width="65"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="05,05,0,0" >
<Label x:Name="lblServer" Content="Server:" HorizontalAlignment="Left" Height="28" Margin="0,0,0,0" Width="45"/>
<TextBox x:Name="txtBdoxDSServer" HorizontalAlignment="Left" Height="18" Text="" Width="150" Margin="0,0,0.0,0" IsEnabled="False"/>
<Label x:Name="lblPort" Content="Port:" HorizontalAlignment="Left" Height="28" Margin="10,0,0,0" Width="35"/>
<TextBox x:Name="txtBdoxDSServerPort" HorizontalAlignment="Left" Height="18" Text="" Width="45" Margin="0,0,0.0,0" IsEnabled="False"/>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="05,05,0,0" >
<StackPanel Orientation="Horizontal" Margin="0,0,0.0,0" >
<Label x:Name="lblDomain" Content="Naming Context:" HorizontalAlignment="Left" Height="28" Margin="0,0,0,0" Width="110"/>
<CheckBox x:Name="chkBoxCreds" Content="Credentials" HorizontalAlignment="Right" Margin="80,0,0,0" Height="18" />
</StackPanel>
<TextBox x:Name="txtBoxDomainConnect" HorizontalAlignment="Left" Height="18" Text="rootDSE" Width="285" Margin="0,0,0.0,0" IsEnabled="False"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="05,05,0,0" >
<Button x:Name="btnDSConnect" Content="Connect" HorizontalAlignment="Left" Height="23" Margin="0,2,0,0" VerticalAlignment="Top" Width="84"/>
<Button x:Name="btnListDdomain" Content="List Domains" HorizontalAlignment="Left" Height="23" Margin="50,2,0,0" VerticalAlignment="Top" Width="95"/>
</StackPanel>
<GroupBox x:Name="gBoxBrowse" Grid.Column="0" Header="Browse Options" HorizontalAlignment="Left" Height="47" Margin="00,05,0,0" VerticalAlignment="Top" Width="290" BorderBrush="Black">
<StackPanel Orientation="Vertical" Margin="0,0">
<StackPanel Orientation="Horizontal">
<RadioButton x:Name="rdbBrowseOU" Content="OU's" HorizontalAlignment="Left" Height="18" Margin="5,05,0,0" VerticalAlignment="Top" Width="61" IsChecked="True"/>
<RadioButton x:Name="rdbBrowseAll" Content="All Objects" HorizontalAlignment="Left" Height="18" Margin="20,05,0,0" VerticalAlignment="Top" Width="80"/>
<CheckBox x:Name="chkBoxShowDel" Content="Show Deleted" HorizontalAlignment="Right" Margin="10,05,0,0" Height="18" />
</StackPanel>
</StackPanel>
</GroupBox>
</StackPanel>
</TabItem>
<TabItem x:Name="tabForestInfo" Header="Forest Info" Width="85">
<StackPanel Orientation="Vertical" Margin="0,05" Width="345" HorizontalAlignment="Left">
<Button x:Name="btnGetForestInfo" Content="Get Forest Info" Margin="0,0,0,0" Width="280" Height="19" />
<StackPanel Orientation="Horizontal" Margin="0,05">
<Label x:Name="lblFFL" Content="Forest Functional Level:" Width="150" Height="24"/>
<TextBox x:Name="txtBoxFFL" Text="" Width="170" Margin="05,0" Height="19" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,01">
<Label x:Name="lblDFL" Content="Domain Functional Level:" Width="150" Height="24"/>
<TextBox x:Name="txtBoxDFL" Text="" Width="170" Margin="05,0" Height="19" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,01">
<Label x:Name="ldblADSchema" Content="AD Schema Version:" Width="150" Height="24"/>
<TextBox x:Name="txtBoxADSchema" Text="" Width="170" Margin="05,0" Height="19" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,01">
<Label x:Name="lblExchSchema" Content="Exchange Schema Version:" Width="150" Height="24"/>
<TextBox x:Name="txtBoxExSchema" Text="" Width="170" Margin="05,0" Height="19" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,01">
<Label x:Name="lblLyncSchema" Content="Lync Schema Version:" Width="150" Height="24" VerticalAlignment="Top"/>
<TextBox x:Name="txtBoxLyncSchema" Text="" Width="170" Margin="05,0,0,0" Height="19" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,01">
<Label x:Name="lblListObjectMode" Content="List Object Mode:" Width="150" Height="24" VerticalAlignment="Top"/>
<TextBox x:Name="txtListObjectMode" Text="" Width="170" Margin="05,0,0,0" Height="19" />
</StackPanel>
</StackPanel>
</TabItem>
<TabItem x:Name="tabConnectionInfo" Header="Connection Info" Width="100" Margin="0,0,0,0">
<StackPanel Orientation="Vertical" Margin="0,0" HorizontalAlignment="Left" Width="345">
<Label x:Name="lblDC" Content="Domain Controller:" Width="175" Height="24" HorizontalAlignment="Left" />
<TextBox x:Name="txtDC" Text="" Width="320" Margin="05,0" Height="19" HorizontalAlignment="Left" />
<Label x:Name="lbldefaultnamingcontext" Content="Default Naming Context:" Width="175" Height="24" HorizontalAlignment="Left" />
<TextBox x:Name="txtdefaultnamingcontext" Text="" Width="320" Margin="05,0" Height="19" HorizontalAlignment="Left" />
<Label x:Name="lblconfigurationnamingcontext" Content="Configuration Naming Context:" Width="175" Height="24" HorizontalAlignment="Left" />
<TextBox x:Name="txtconfigurationnamingcontext" Text="" Width="320" Margin="05,0" Height="19" HorizontalAlignment="Left" />
<Label x:Name="lblschemanamingcontext" Content="Schema Naming Context:" Width="175" Height="24" HorizontalAlignment="Left" />
<TextBox x:Name="txtschemanamingcontext" Text="" Width="320" Margin="05,0" Height="19" HorizontalAlignment="Left" />
<Label x:Name="lblrootdomainnamingcontext" Content="Root Domain Naming Context:" Width="175" Height="24" HorizontalAlignment="Left" />
<TextBox x:Name="txtrootdomainnamingcontext" Text="" Width="320" Margin="05,0,0,0" Height="19" HorizontalAlignment="Left" />
</StackPanel>
</TabItem>
</TabControl>
<GroupBox x:Name="gBoxSelectNodeTreeView" Grid.Column="0" Header="Nodes" HorizontalAlignment="Left" Height="330" Margin="0,0,0,0" VerticalAlignment="Top" Width="350" Foreground="White" BorderThickness="0" BorderBrush="#FF2A3238" >
<StackPanel Orientation="Vertical">
<TreeView x:Name="treeView1" Height="320" Width="340" Margin="0,5,0,0" HorizontalAlignment="Left"
DataContext="{Binding Source={StaticResource DomainOUData}, XPath=/DomainRoot}"
ItemTemplate="{StaticResource NodeTemplate}"
ItemsSource="{Binding}">
<TreeView.ContextMenu>
<ContextMenu x:Name="ContextMUpdateNode" >
<MenuItem Header="Refresh Childs">
<MenuItem.Icon>
<Image Width="15" Height="15" Source="{Binding XPath=@Icon}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Exclude Node">
<MenuItem.Icon>
<Image Width="15" Height="15" Source="{Binding XPath=@Icon2}" />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</TreeView.ContextMenu>
</TreeView>
</StackPanel>
</GroupBox>
<StackPanel Orientation="Horizontal" >
<StackPanel Orientation="Horizontal" Margin="0,0,0,0">
<StackPanel Orientation="Vertical" >
<StackPanel Orientation="Horizontal" >
<Label x:Name="lblStyleVersion1" Content="AD ACL Scanner 6.2" HorizontalAlignment="Left" Height="25" Margin="0,0,0,0" VerticalAlignment="Top" Width="140" Foreground="White" Background="{x:Null}" FontWeight="Bold" FontSize="14"/>
</StackPanel>
<StackPanel Orientation="Horizontal" >
<Label x:Name="lblStyleVersion2" Content="written by Robin Granberg " HorizontalAlignment="Left" Height="27" Margin="0,0,0,0" VerticalAlignment="Top" Width="150" Foreground="White" Background="{x:Null}" FontSize="12"/>
<Image x:Name="imgTwitter" HorizontalAlignment="Left" Height="15" VerticalAlignment="Center" Width="15" />
<Label x:Name="lblStyleVersion3" Content="@ipcdollar1" HorizontalAlignment="Left" Height="27" Margin="0,0,0,0" VerticalAlignment="Top" Width="72" Foreground="White" Background="{x:Null}" FontSize="12"/>
<Image x:Name="imgGithub" HorizontalAlignment="Left" Height="15" VerticalAlignment="Center" Width="15" />
<Label x:Name="lblStyleVersion4" Content="@canix1" HorizontalAlignment="Left" Height="27" Margin="0,0,0,0" VerticalAlignment="Top" Width="53" Foreground="White" Background="{x:Null}" FontSize="12"/>
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical">
<Label x:Name="lblSelectedNode" Content="Selected Object:" HorizontalAlignment="Left" Height="26" Margin="0,0,0,0" VerticalAlignment="Top" Width="158" Foreground="White" />
<StackPanel Orientation="Horizontal" >
<TextBox x:Name="txtBoxSelected" HorizontalAlignment="Left" Height="20" Margin="5,0,0,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="630"/>
</StackPanel>
<Label x:Name="lblStatusBar" Content="Log:" HorizontalAlignment="Left" Height="26" Margin="0,0,0,0" VerticalAlignment="Top" Width="158" Foreground="White" />
<ListBox x:Name="TextBoxStatusMessage" DisplayMemberPath="Message" SelectionMode="Extended" HorizontalAlignment="Left" Height="80" Margin="5,0,0,0" VerticalAlignment="Top" Width="630" ScrollViewer.HorizontalScrollBarVisibility="Auto">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Type}" Value="Error">
<Setter Property="ListBoxItem.Foreground" Value="Red" />
<Setter Property="ListBoxItem.Background" Value="LightGray" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=Type}" Value="Warning">
<Setter Property="ListBoxItem.Foreground" Value="Yellow" />
<Setter Property="ListBoxItem.Background" Value="Gray" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=Type}" Value="Info">
<Setter Property="ListBoxItem.Foreground" Value="Black" />
<Setter Property="ListBoxItem.Background" Value="White" />
</DataTrigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
<TabControl x:Name="tabScanTop" HorizontalAlignment="Left" Height="315" VerticalAlignment="Top" Width="630" Margin="5,5,0,0">
<TabItem x:Name="tabScan" Header="Scan Options" Width="85">
<Grid >
<StackPanel Orientation="Horizontal" Margin="0,0">
<StackPanel Orientation="Vertical" Margin="0,0">
<GroupBox x:Name="gBoxScanType" Header="Scan Type" HorizontalAlignment="Left" Height="71" Margin="2,1,0,0" VerticalAlignment="Top" Width="290" >
<StackPanel Orientation="Vertical" Margin="0,0">
<StackPanel Orientation="Horizontal">
<RadioButton x:Name="rdbDACL" Content="DACL (Access)" HorizontalAlignment="Left" Height="18" Margin="5,10,0,0" VerticalAlignment="Top" Width="95" IsChecked="True"/>
<RadioButton x:Name="rdbSACL" Content="SACL (Audit)" HorizontalAlignment="Left" Height="18" Margin="20,10,0,0" VerticalAlignment="Top" Width="90"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Height="35" Margin="0,0,0.2,0">
<CheckBox x:Name="chkBoxRAWSDDL" Content="RAW SDDL" HorizontalAlignment="Left" Height="18" Margin="5,05,0,0" VerticalAlignment="Top" Width="120"/>
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox x:Name="gBoxScanDepth" Header="Scan Depth" HorizontalAlignment="Left" Height="51" Margin="2,1,0,0" VerticalAlignment="Top" Width="290">
<StackPanel Orientation="Vertical" Margin="0,0">
<StackPanel Orientation="Horizontal">
<RadioButton x:Name="rdbBase" Content="Base" HorizontalAlignment="Left" Height="18" Margin="5,10,0,0" VerticalAlignment="Top" Width="61" IsChecked="True"/>
<RadioButton x:Name="rdbOneLevel" Content="One Level" HorizontalAlignment="Left" Height="18" Margin="20,10,0,0" VerticalAlignment="Top" Width="80"/>
<RadioButton x:Name="rdbSubtree" Content="Subtree" HorizontalAlignment="Left" Height="18" Margin="20,10,0,0" VerticalAlignment="Top" Width="80"/>
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox x:Name="gBoxRdbFile" Header="Output Options" HorizontalAlignment="Left" Height="158" Margin="2,0,0,0" VerticalAlignment="Top" Width="290">
<StackPanel Orientation="Vertical" Margin="0,0">
<StackPanel Orientation="Horizontal">
<RadioButton x:Name="rdbOnlyHTA" Content="HTML" HorizontalAlignment="Left" Height="18" Margin="5,05,0,0" VerticalAlignment="Top" Width="61" GroupName="rdbGroupOutput" IsChecked="True"/>
<RadioButton x:Name="rdbOnlyCSV" Content="CSV file" HorizontalAlignment="Left" Height="18" Margin="20,05,0,0" VerticalAlignment="Top" Width="61" GroupName="rdbGroupOutput"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<RadioButton x:Name="rdbEXcel" Content="Excel file" HorizontalAlignment="Left" Height="18" Margin="5,05,0,0" VerticalAlignment="Top" Width="155" GroupName="rdbGroupOutput"/>
</StackPanel>
<CheckBox x:Name="chkBoxTranslateGUID" Content="Translate GUID's in CSV output" HorizontalAlignment="Left" Height="18" Margin="5,05,0,0" VerticalAlignment="Top" Width="200"/>
<Label x:Name="lblTempFolder" Content="CSV file destination" />
<TextBox x:Name="txtTempFolder" Margin="0,0,02,0"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
<Button x:Name="btnGetTemplateFolder" Content="Change Folder" Width="90" Margin="-100,00,0,0" />
</StackPanel>
</StackPanel>
</GroupBox>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,0">
<GroupBox x:Name="gBoxRdbScan" Header="Objects to scan" HorizontalAlignment="Left" Height="75" Margin="2,0,0,0" VerticalAlignment="Top" Width="310">
<StackPanel Orientation="Vertical" Margin="0,0">
<StackPanel Orientation="Horizontal">
<RadioButton x:Name="rdbScanOU" Content="OUs" HorizontalAlignment="Left" Height="18" Margin="5,10,0,0" VerticalAlignment="Top" Width="61" IsChecked="True" GroupName="rdbGroupFilter"/>
<RadioButton x:Name="rdbScanContainer" Content="Containers" HorizontalAlignment="Left" Height="18" Margin="5,10,0,0" VerticalAlignment="Top" Width="80" GroupName="rdbGroupFilter"/>
<RadioButton x:Name="rdbScanAll" Content="All Objects" HorizontalAlignment="Left" Height="18" Margin="5,10,0,0" VerticalAlignment="Top" Width="80" GroupName="rdbGroupFilter"/>
<RadioButton x:Name="rdbGPO" Content="GPOs" HorizontalAlignment="Left" Height="18" Margin="5,10,0,0" VerticalAlignment="Top" Width="80" GroupName="rdbGroupFilter"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<RadioButton x:Name="rdbScanFilter" Content="" HorizontalAlignment="Left" Height="18" Margin="5,5,0,0" VerticalAlignment="Top" Width="15" GroupName="rdbGroupFilter"/>
<TextBox x:Name="txtCustomFilter" Text="(objectClass=*)" HorizontalAlignment="Left" Height="18" Width="250" Margin="0,0,0.0,0" IsEnabled="False"/>
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox x:Name="gBoxReportOpt" Header="View in report" HorizontalAlignment="Left" Height="165" Margin="2,0,0,0" VerticalAlignment="Top" Width="310">
<StackPanel Orientation="Vertical" Margin="0,0">
<StackPanel Orientation="Horizontal">
<CheckBox x:Name="chkBoxGetOwner" Content="View Owner" HorizontalAlignment="Left" Height="18" Margin="5,05,0,0" VerticalAlignment="Top" Width="120"/>
<CheckBox x:Name="chkBoxACLSize" Content="DACL Size" HorizontalAlignment="Left" Height="18" Margin="30,05,0,0" VerticalAlignment="Top" Width="80"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0.2,0" Height="35">
<CheckBox x:Name="chkInheritedPerm" Content="Inherited Permissions" HorizontalAlignment="Left" Height="30" Margin="5,05,0,0" VerticalAlignment="Top" Width="120"/>
<CheckBox x:Name="chkBoxGetOUProtected" Content="Inheritance Disabled" HorizontalAlignment="Left" Height="30" Margin="30,05,0,0" VerticalAlignment="Top" Width="120"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Height="35" Margin="0,0,0.2,0">
<CheckBox x:Name="chkBoxDefaultPerm" Content="Skip Default Permissions" HorizontalAlignment="Left" Height="30" Margin="5,05,0,0" VerticalAlignment="Top" Width="120"/>
<CheckBox x:Name="chkBoxReplMeta" Content="SD Modified date" HorizontalAlignment="Left" Height="30" Margin="30,05,0,0" VerticalAlignment="Top" Width="120"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Height="35" Margin="0,0,0.2,0">
<CheckBox x:Name="chkBoxSkipProtectedPerm" Content="Skip Protected Permissions" HorizontalAlignment="Left" Height="30" Margin="5,05,0,0" VerticalAlignment="Top" Width="120"/>
<CheckBox x:Name="chkBoxObjType" Content="ObjectClass" HorizontalAlignment="Left" Height="30" Margin="30,05,0,0" VerticalAlignment="Top" Width="90"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Height="34" Margin="0,0,0,0">
<CheckBox x:Name="chkBoxUseCanonicalName" Content="Canonical Name" HorizontalAlignment="Left" Height="30" Margin="155,00,0,0" VerticalAlignment="Top" Width="120"/>
</StackPanel>
</StackPanel>
</GroupBox>
</StackPanel>
</StackPanel>
</Grid>
</TabItem>
<TabItem x:Name="tabOfflineScan" Header="Additional Options">
<Grid>
<StackPanel>
<GroupBox x:Name="gBoxImportCSV" Header="CSV to HTML" HorizontalAlignment="Left" Height="136" Margin="2,1,0,0" VerticalAlignment="Top" Width="290">
<StackPanel Orientation="Vertical" Margin="0,0">
<Label x:Name="lblCSVImport" Content="This file will be converted HTML:" />
<TextBox x:Name="txtCSVImport"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="btnGetCSVFile" Content="Select CSV" />
</StackPanel>
<CheckBox x:Name="chkBoxTranslateGUIDinCSV" Content="CSV file do not contain object GUIDs" HorizontalAlignment="Left" Height="18" Margin="5,10,0,0" VerticalAlignment="Top" Width="290"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="btnCreateHTML" Content="Create HTML View" />
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox x:Name="gBoxProgress" Header="Progress Bar" HorizontalAlignment="Left" Height="75" Margin="2,0,0,0" VerticalAlignment="Top" Width="290">
<StackPanel Orientation="Vertical" Margin="0,0">
<CheckBox x:Name="chkBoxSkipProgressBar" Content="Use Progress Bar" HorizontalAlignment="Left" Margin="5,10,0,0" VerticalAlignment="Top" IsEnabled="True" IsChecked="True"/>
<Label x:Name="lblSkipProgressBar" Content="For speed you could disable the progress bar." />
</StackPanel>
</GroupBox>
</StackPanel>
</Grid>
</TabItem>
<TabItem x:Name="tabOther" Header="Default SD">
<Grid>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="0,0,0,-40">
<GroupBox x:Name="gBoxdDefSecDesc" Header="Output Format" HorizontalAlignment="Left" Height="45" Margin="0,0,0,0" VerticalAlignment="Top" Width="290">
<StackPanel Orientation="Horizontal" Margin="0,0">
<RadioButton x:Name="rdbDefSD_Access" Content="DACL" HorizontalAlignment="Left" Height="18" Margin="5,05,0,0" VerticalAlignment="Top" Width="50" IsChecked="True"/>
<RadioButton x:Name="rdbDefSD_SDDL" Content="SDDL" HorizontalAlignment="Left" Height="18" Margin="10,05,0,0" VerticalAlignment="Top" Width="50"/>
</StackPanel>
</GroupBox>
<CheckBox x:Name="chkModifedDefSD" Content="Only modified defaultSecurityDescriptors" HorizontalAlignment="Left" Margin="5,10,0,0" VerticalAlignment="Top"/>
<Label x:Name="lblObjectDefSD" Content="Select objects to scan:" />
<StackPanel Orientation="Horizontal" Margin="0,0">
<ComboBox x:Name="combObjectDefSD" HorizontalAlignment="Left" Margin="05,05,00,00" VerticalAlignment="Top" Width="120" IsEnabled="True" SelectedValue="*"/>
<Button x:Name="btnScanDefSD" Content="Run Scan" HorizontalAlignment="Right" Width="90" Height="19" Margin="37,05,00,00" IsEnabled="True"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0">
<Button x:Name="btnGetSchemaClass" Content="Load all classSchema" HorizontalAlignment="Left" Width="120" Height="19" Margin="05,05,00,00" IsEnabled="True"/>
<Button x:Name="btnExportDefSD" Content="Export to CSV" HorizontalAlignment="Right" Width="90" Height="19" Margin="37,05,00,00" IsEnabled="True"/>
</StackPanel>
</StackPanel>
<GroupBox x:Name="gBoxdDefSecDescCompare" Header="Compare" HorizontalAlignment="Left" Height="260" Margin="0,0,0,0" VerticalAlignment="Top" Width="290">
<StackPanel Margin="0,0">
<Label x:Name="lblCompareDefSDText" Content="You can compare the current state with a previously created CSV file." />
<Label x:Name="lblCompareDefSDTemplate" Content="CSV Template File" />
<TextBox x:Name="txtCompareDefSDTemplate" Margin="2,0,0,0" Width="275" IsEnabled="True"/>
<Button x:Name="btnGetCompareDefSDInput" Content="Select Template" HorizontalAlignment="Right" Width="90" Height="19" Margin="162,05,00,00" IsEnabled="True"/>
<Button x:Name="btnCompDefSD" Content="Run Compare" HorizontalAlignment="Right" Width="90" Height="19" Margin="162,05,00,00" IsEnabled="True"/>
<Label x:Name="lblDownloadCSVDefSD" Content="Download CSV templates for comparing with your defaultSecurityDescriptors:" Margin="05,20,00,00" />
<Button x:Name="btnDownloadCSVDefSD" Content="Download CSV Templates" HorizontalAlignment="Left" Width="140" Height="19" Margin="05,05,00,00" IsEnabled="True"/>
</StackPanel>
</GroupBox>
</StackPanel>
</Grid>
</TabItem>
<TabItem x:Name="Exclude" Header="Exclude">
<Grid>
<StackPanel Orientation="Vertical">
<Label x:Name="lblExcludeddNode" Content="Excluded Path (matching string in distinguishedName):" HorizontalAlignment="Left" Height="26" Margin="0,0,0,0" VerticalAlignment="Top" Width="300"/>
<StackPanel Orientation="Vertical">
<TextBox x:Name="txtBoxExcluded" HorizontalAlignment="Left" Height="20" Margin="5,0,0,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="600" />
<Button x:Name="btnClearExcludedBox" Content="Clear" Height="21" Margin="10,0,0,0" IsEnabled="true" Width="100"/>
</StackPanel>
</StackPanel>
</Grid>
</TabItem>
<TabItem x:Name="tabCompare" Header="Compare">
<Grid>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="0,0" HorizontalAlignment="Left">
<CheckBox x:Name="chkBoxCompare" Content="Enable Compare" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top"/>
<Label x:Name="lblCompareDescText" Content="You can compare the current state with a previously created CSV file." />
<Label x:Name="lblCompareTemplate" Content="CSV Template File" />
<TextBox x:Name="txtCompareTemplate" Margin="2,0,0,0" Width="275" IsEnabled="False"/>
<Button x:Name="btnGetCompareInput" Content="Select Template" HorizontalAlignment="Right" Height="19" Margin="65,00,00,00" IsEnabled="False"/>
<StackPanel Orientation="Horizontal" Margin="5,5,0,0">
<Label x:Name="lblReturn" Content="Return:" />
<ComboBox x:Name="combReturns" HorizontalAlignment="Left" Margin="05,02,00,00" VerticalAlignment="Top" Width="80" IsEnabled="False" SelectedValue="ALL"/>
</StackPanel>
<StackPanel Orientation="Vertical">
<CheckBox x:Name="chkBoxTemplateNodes" Content="Use nodes from template." HorizontalAlignment="Left" Width="160" Margin="2,5,00,00" IsEnabled="False" />
<CheckBox x:Name="chkBoxScanUsingUSN" Content="Faster compare using USNs of the NTSecurityDescriptor. This requires that your template to contain USNs.Requires SD Modified date selected when creating the template." HorizontalAlignment="Left" Width="280" Margin="2,5,00,00" IsEnabled="False" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Width="300">
<Label x:Name="lblReplaceDN" Content="Replace DN in file with current domain DN. E.g. DC=contoso,DC=com Type the old DN to be replaced:" />
<TextBox x:Name="txtReplaceDN" Margin="2,0,0,0" Width="250" IsEnabled="False"/>
<Label x:Name="lblReplaceNetbios" Content="Replace principals prefixed domain name with current domain. E.g. CONTOSO Type the old NETBIOS name to be replaced:" />
<TextBox x:Name="txtReplaceNetbios" Margin="2,0,0,0" Width="250" IsEnabled="False"/>
<Label x:Name="lblDownloadCSVDefACLs" Content="Download CSV templates for comparing with your environment:" Margin="05,20,00,00" />
<Button x:Name="btnDownloadCSVDefACLs" Content="Download CSV Templates" HorizontalAlignment="Left" Width="140" Height="19" Margin="05,05,00,00" IsEnabled="True"/>
</StackPanel>
</StackPanel>
</Grid>
</TabItem>
<TabItem x:Name="tabFilter" Header="Filter">
<Grid>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="0,0">
<CheckBox x:Name="chkBoxFilter" Content="Enable Filter" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top"/>
<Label x:Name="lblAccessCtrl" Content="Filter by Access Type:(example: Allow)" />
<StackPanel Orientation="Horizontal" Margin="0,0">
<CheckBox x:Name="chkBoxType" Content="" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" IsEnabled="False"/>
<ComboBox x:Name="combAccessCtrl" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" Width="120" IsEnabled="False"/>
</StackPanel>
<Label x:Name="lblFilterExpl" Content="Filter by Object:(example: user)" />
<StackPanel Orientation="Horizontal" Margin="0,0">
<CheckBox x:Name="chkBoxObject" Content="" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" IsEnabled="False"/>
<ComboBox x:Name="combObjectFilter" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" Width="120" IsEnabled="False"/>
</StackPanel>
<Label x:Name="lblGetObj" Content="The list box contains a few number of standard objects. To load all objects from schema press Load." />
<StackPanel Orientation="Horizontal" Margin="0,0">
<Label x:Name="lblGetObjExtend" Content="This may take a while!" />
<Button x:Name="btnGetObjFullFilter" Content="Load" IsEnabled="False" Width="50" />
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5,5,0,0" Width="320">
<Label x:Name="lblFilterTrusteeExpl" Content="Filter by Trustee: Examples: CONTOSO\User CONTOSO\JohnDoe* *Smith *Doe*" />
<StackPanel Orientation="Horizontal" Margin="0,0">
<CheckBox x:Name="chkBoxTrustee" Content="" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" IsEnabled="False"/>
<TextBox x:Name="txtFilterTrustee" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" Width="120" IsEnabled="False"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0">
<CheckBox x:Name="chkBoxFilterBuiltin" Content="" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top" IsEnabled="False"/>
<Label x:Name="lblFilterBuiltin" Content="Exclude all built-in security principals" />
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
</TabItem>
<TabItem x:Name="tabEffectiveR" Header="Effective Rights">
<Grid >
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="0,0">
<CheckBox x:Name="chkBoxEffectiveRights" Content="Enable Effective Rights" HorizontalAlignment="Left" Margin="5,5,0,0" VerticalAlignment="Top"/>
<Label x:Name="lblEffectiveDescText" Content="Effective Access allows you to view the effective permissions for a user, group, or device account." />
<Label x:Name="lblEffectiveText" Content="Type the account name (samAccountName) for a user, group or computer" />
<Label x:Name="lblSelectPrincipalDom" Content=":" />
<TextBox x:Name="txtBoxSelectPrincipal" IsEnabled="False" />
<StackPanel Orientation="Horizontal" Margin="0,0">
<Button x:Name="btnGetSPAccount" Content="Get Account" Margin="5,0,0,0" IsEnabled="False"/>
<Button x:Name="btnListLocations" Content="Locations..." Margin="50,0,0,0" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5,5,0,0" Width="320">
<StackPanel Orientation="Vertical" Margin="0,0" >
<GroupBox x:Name="gBoxEffectiveSelUser" Header="Selected Security Principal:" HorizontalAlignment="Left" Height="50" Margin="2,2,0,0" VerticalAlignment="Top" Width="290">
<StackPanel Orientation="Vertical" Margin="0,0">
<Label x:Name="lblEffectiveSelUser" Content="" />
</StackPanel>
</GroupBox>
<Button x:Name="btnGETSPNReport" HorizontalAlignment="Left" Content="View Account" Margin="5,2,0,0" IsEnabled="False" Width="110"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Grid>
</TabItem>
<TabItem x:Name="tabAssess" Header="Assessment">
<Grid >
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="0,0">
<GroupBox x:Name="gBoxdCriticals" Header="Assessment Options" HorizontalAlignment="Left" Height="200" Margin="0,5,0,0" VerticalAlignment="Top" Width="290">
<StackPanel>
<Label x:Name="lblFilterServerity" Content="Filter by Severity" />
<StackPanel Orientation="Horizontal" Margin="0,0">
<CheckBox x:Name="chkBoxSeverity" Content="" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" IsEnabled="True"/>
<ComboBox x:Name="combServerity" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" Width="120" IsEnabled="false"/>
</StackPanel>
<Label x:Name="lblRecursiveFind" Content="Perform a recursive search and return these objects:" />
<StackPanel Orientation="Horizontal" Margin="0,0">
<CheckBox x:Name="chkBoxRecursiveFind" Content="" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" IsEnabled="True"/>
<ComboBox x:Name="combRecursiveFind" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" Width="120" IsEnabled="false"/>
</StackPanel>
</StackPanel>
</GroupBox>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5,5">
<GroupBox x:Name="gBoxCriticality" Header="Access Rights Criticality" HorizontalAlignment="Left" Height="150" Margin="2,0,0,0" VerticalAlignment="Top" Width="290">
<StackPanel Orientation="Vertical" Margin="0,0">
<CheckBox x:Name="chkBoxEffectiveRightsColor" Content="Show color coded criticality" HorizontalAlignment="Left" Margin="5,10,0,0" VerticalAlignment="Top" IsEnabled="True"/>
<Label x:Name="lblEffectiveRightsColor" Content="Use colors in report to identify criticality level of permissions.This might help you in implementing Least-Privilege Administrative Models" />
<Button x:Name="btnViewLegend" Content="View Color Legend" HorizontalAlignment="Left" Margin="5,0,0,0" IsEnabled="True" Width="110"/>
</StackPanel>
</GroupBox>
</StackPanel>
</StackPanel>
</Grid>
</TabItem>
</TabControl>
<StackPanel Orientation="Horizontal" Margin="5,5">
<Button x:Name="btnScan" Content="Run Scan" HorizontalAlignment="Left" Height="19" Margin="0,0,0,0" VerticalAlignment="Top" Width="66"/>
<Button x:Name="btnExit" Content="Exit" HorizontalAlignment="Left" Margin="100,0,0,0" VerticalAlignment="Top" Width="75"/>
<Button x:Name="btnSupport" Height="23" Tag="Support Statement" Margin="270,0,0,0" Foreground="White" HorizontalAlignment="Right">
<TextBlock TextDecorations="Underline" Text="{Binding Path=Tag, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}}" />
<Button.Template>
<ControlTemplate TargetType="{x:Type Button}">
<ContentPresenter />
</ControlTemplate>
</Button.Template>
</Button>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel >
</StackPanel>
</StackPanel>
</Grid>
</ScrollViewer>
</Window>
"@
[XML] $XAML = $xamlBase
$xaml.Window.RemoveAttribute("x:Class")
$reader=(New-Object System.Xml.XmlNodeReader $XAML)
$Window=[Windows.Markup.XamlReader]::Load( $reader )
#Replace x:Name to XML variable Name
$xamlBase = $xamlBase.Replace("x:Name","Name")
[XML] $XAML = $xamlBase
#Search the XML data for object and create variables
$XAML.SelectNodes("//*[@Name]")| %{set-variable -Name ($_.Name) -Value $Window.FindName($_.Name)}
$Icon = @"
iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAABGdBTUEAALGPC/xhBQAAAwBQTFRFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAszD0iAAAAQB0Uk5T////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////AFP3ByUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjEuNWRHWFIAAAI3SURBVGhD7ZLRluQgCETn/3+6t4WrYoIKmfTM7p7c
hwhFQb3k6/UDPCEpnpAUT0iKJyRFLuSrgRAj4eZ8AzlA1MrhAwx3xHzcdMCwJuLi3gRMKwIejilTacXWwqUCCiAWUKasDRwpoAwwKqD4LKasK2gHGCpoDqcRGyPMHDCMMGtEQphMwGRh0tiHoC/A2EFvbEIQt2AHxMYqBCUISwWUxiSEJo2/7YdQX8Bd/8WQyyn+9n
8coj7qPO7yzSH+8r8YItuUnV8MobxANqQUgnRH7EBcfUkKi6NYvyCdBb1g+lrKO+BJdrMgbQdVMQqlPCOOtglBBCNRyjPiaKeQwYNUMZqW8j3giGaxPQ3pDUaU0sUZmcX2VKR9QwueZpmO2JOnm7Q9LrmiYTaqe/VVtDvt+GpnF6KFap8JaUV1aXNXSF/rVWs+G6L1
x0LURn1TiN0617eGWAZdm46vdqIh6rO1wVc77kiXRoaBNB1XNORCTilajNqZcIg9Z/BU0SxeyME7tDQNTxTNkg1xD1JXRLPMQ2jeaO+nOFIo5GQ9CvTCSXgjmuVKSGEQZNxB7Tgh9/OEpPgLQiZ/y0DA8+0Le0cwZGHaGgqb8e7IZgy7+frMctjZGlaHFqOBvWN+aj
o4ErDMjk1kh4jHP+eKPiFTPWjMCMF13g2cbG7a6DbvDo7qWcpoRjjEXO4w2RIPOaUgB0hYDymIETJeG4MQI+euMTRRsv4SQxEnv3GBJyTFE5LiCUnxhCR4vf4AzHXw0b9akGYAAAAASUVORK5CYII=
"@
$IconImage = New-Object System.Windows.Media.Imaging.BitmapImage
$IconImage.BeginInit()
$IconImage.StreamSource = [System.IO.MemoryStream][System.Convert]::FromBase64String($Icon)
$IconImage.EndInit()