forked from canix1/ADACLScanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ADACLScan.ps1
17371 lines (15502 loc) · 749 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 ([email protected])
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"
Returns the permissions of the object CORP.
.EXAMPLE
.\ADACLScan.ps1 -Base rootdse
Returns the ACL of the domain root.
.EXAMPLE
.\ADACLScan.ps1 -Base "OU=CORP,DC=CONTOS,DC=COM" -Credentials $CREDS -Server 10.0.0.20
Returns the permissions of the object CORP using credentials on Domain Controller 10.0.0.20.
.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).
.EXAMPLE
.\ADACLScan.ps1 -Base "ou=mig,dc=contoso,dc=com" -Output CSVTEMPLATE
This will result in a CSV-file with a format adapted for comparing.
.EXAMPLE
.\ADACLScan.ps1 -Base "ou=mig,dc=contoso,dc=com" -Template C:\Scripts\mig_CONTOSO_adAclOutput20220722_182746.csv
The following command will result in an output with the possibility to see the state of each ACE on the object compared with the CSV-template.
.EXAMPLE
.\ADACLScan.ps1 -Base "ou=mig,dc=contoso,dc=com" -SDDL
The following command will result in an output with security descriptor in SDDL format.
.OUTPUTS
The output is an CSV,HTML or EXCEL report.
.LINK
https://github.com/canix1/ADACLScanner
.NOTES
**Version: 7.9**
**12 September, 2023**
**New Features**
* Show security descriptor in SDDL format
#>
Param
(
# DistinguishedName to start your search at or type RootDSE for the domain root. Will be included in the result if your filter matches the object.
[Alias("b")]
[Parameter(Mandatory=$false,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
ValueFromRemainingArguments=$false,
Position=0,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Base="",
# Targets allows you to use a predefined search for specific objects
[Parameter(Mandatory=$false,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
ValueFromRemainingArguments=$false,
Position=0,
ParameterSetName='Default')]
[ValidateSet("RiskyTemplates")]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Targets,
# Filter. Specify your custom filter. Default is OrganizationalUnit.
[Alias("filter")]
[Parameter(Mandatory=$false,
Position=1,
ParameterSetName='Default')]
[validatescript({$_ -like "(*=*)"})]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$LDAPFilter,
# 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,
# Specify the samAccountName of a security principal to check for its 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","CSVTEMPLATE", "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.
# This parameter will allow you compare the current state of a security descriptor with a previos created tempate.
[Parameter(Mandatory=$false,
Position=8,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Template,
# Filter what to return when comparing with a template.
# This parameter will allow you to filter the out put on "ALL", "MATCH", "MISSING","NEW"
# Example 1. -Returns "ALL"
# Example 2. -Returns "MATCH"
# Example 3. -Returns "MISSING"
# Example 4. -Returns "NEW"
[Parameter(Mandatory=$false,
Position=8,
ParameterSetName='Default')]
[ValidateSet("ALL", "MATCH", "MISSING","NEW")]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$TemplateFilter="ALL",
# User ExcelFile to defined your own path for the excel output
# This parameter will allow you to type the excel file path.
# Example 1. -ExcelFile "C:\Temp\ExcelOutput.xlsx"
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$ExcelFile="",
# Filter on Criticality.
# This parameter will filter the result based on a defined criticality level
[Alias("c")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateSet("Critical", "Warning", "Medium","Low","Info")]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Criticality="",
# Show color of criticality
# This parameter will add colors to the report if you selected HTML or EXCEL using the -OUTPUT parameter
[Alias("color")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$ShowCriticalityColor,
# Skip default permissions
# This parameter will skip permissions that match the permissions defined in the schema partition for the object
[Alias("sd")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$SkipDefaults,
# Skip protected permissions
# This parameter will skip permissions that match the permissions set when selecting "protect object from accidental deletaion"
[Alias("sp")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$SkipProtected,
# Skip Built-in security principals
# This parameter will skip permissions that match the built in groups
[Alias("sb")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$SkipBuiltIn,
# Filter the trustees on object type.
# This parameter will filter the result on an object type.
[Alias("rt")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateSet("user", "computer", "group","msds-groupmanagedserviceaccount","*")]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$ReturnObjectType="*",
# Expand groups
# This parameter will search any nested groups to show all security prinicpals that have access.
[Alias("rf")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$RecursiveFind,
# Filter on RecursiveObjectType.
# This parameter will filter the nested groups to show only users that have access.
[Alias("ro")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateSet("User", "Computer", "Group","*")]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$RecursiveObjectType="*",
# Translate GUIDs
# This parameter will translate any GUIDs if necessary
[Alias("tr")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$Translate,
# Get Group Policy Objects linked
# This parameter will let you search permissions on group policy objects that are linked to the path you have selected
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$GPO,
# Open HTML report
# This parameter will open the out report if you selected one using the -OUTPUT parameter
[Alias("s")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$Show,
# Include Security Descriptor modified date in report
# This parameter will include the date when the security descriptor was last changed
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$SDDate,
# Include Owner in report
# This parameter will make the scan to search the owner section in the security descriptor.
[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
# This parameter will add information in the report whether the object have disabled it's inheritnace
[Alias("p")]
[Parameter(Mandatory=$false,
ParameterSetName='Default')]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$Protected,
# Scan Default Security Descriptor
# This parameter will make AD ACL Scanner to search the schema partition for security descriptors of all objects.
[Alias("dsd")]
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$DefaultSecurityDescriptor,
# Filter Default Security Descriptor on a schema object
# This parameter let you select the schema object you would like to see the default security descriptor on.
# Example 1. -SchemaObjectName "User"
# Example 2. -SchemaObjectName "Computer"
[Alias("son")]
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$SchemaObjectName="*",
# Filter Default Security Descriptor on modified with version number higher than 1
# This parameter will check the metadata of the NTSecurityDescriptor if it have ever been changed, basically have a version number higher than 1.
[Alias("om")]
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$OnlyModified,
# Include inherited permissions
# By default only explicit permissions are shown
[Alias("in")]
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$IncludeInherited,
# Returns ACE's in the format that .Net presents access permissions
# Use this option if you would like to create a template for compairson
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$RAW,
# Returns ACE's in the SDDL format
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$SDDL,
# Filter ACL for access type
# Example 1. -AccessType "Allow"
# Example 2. -AccessType "Deny"
[Alias("acc")]
[Parameter(Mandatory=$false)]
[ValidateSet("Allow", "Deny")]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$AccessType,
# Filter ACL for a specific permission
# Example 1. -Permissions "GenericAll"
# Example 2. -Permissions "WriteProperty|ExtendedRight"
[Alias("perm")]
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$Permission,
# Filter ACL ObjectName
# Example 1. -ApplyTo user
# Example 2. -ApplyTo "user|computer"
[Alias("at")]
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$ApplyTo="",
# Filter ACL for matching strings in Trustee
# Example 1 -FilterTrustee "*Domain*"
# Example 1 -FilterTrustee "contoso\user1"
[Alias("ft")]
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[String]
$FilterTrustee="",
# Show the progressbar in the CLI
[Parameter(Mandatory=$false)]
[ValidateNotNull()]
[ValidateNotNullOrEmpty()]
[switch]
$ShowProgressBar,
# Add Credentials to the command by first creating a pscredential object like for example $CREDS = get-credential
[Parameter(Mandatory=$false)]
[PSCredential]
$Credentials
)
[string]$ADACLScanVersion = "-------`nAD ACL Scanner 7.9 , Author: Robin Granberg, @ipcdollar1, Github: github.com/canix1 `n-------"
[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";
8="Windows Server 2019"
}
#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";
8="Windows Server 2019"
}
$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";
88="Windows Server 2019"
}
# 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-CU5";
15330="Exchange Server 2016 CU6";
15332="Exchange Server 2016 CU7-CU18";
15333="Exchange Server 2016 CU19";
17000="Exchange Server 2019";
17001="Exchange Server 2019 CU2-CU7";
17002="Exchange Server 2019 CU8"
}
# 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/Skype for Business 2015"
}
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="300" 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 7.9" 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="405" VerticalAlignment="Top" Width="630" Margin="5,5,0,0">
<TabItem x:Name="tabScan" Header="Scan Options" Width="85">
<Grid >
<StackPanel Orientation="Vertical" Margin="0,0">
<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"/>
<RadioButton x:Name="rdbOnlyCSVTEMPLATE" Content="CSV Template" HorizontalAlignment="Left" Height="18" Margin="20,05,0,0" VerticalAlignment="Top" Width="91" 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="220" 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="Vertical" Margin="0,0,0,0">
<StackPanel Orientation="Horizontal" Height="19" Margin="0,0,0.2,0">
<CheckBox x:Name="chkBoxUseCanonicalName" Content="Canonical Name" HorizontalAlignment="Left" Margin="5,05,0,0" VerticalAlignment="Top" Width="120"/>
<CheckBox x:Name="chkBoxSDDLView" Content="SDDL" HorizontalAlignment="Left" Height="30" Margin="30,05,0,0" VerticalAlignment="Top" Width="90"/>
</StackPanel>
<Label x:Name="lblReturnObjectType" Content="Filter report on security principal type:" Margin="5,0,0,0"/>
<ComboBox x:Name="combReturnObjectType" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" Width="120" IsEnabled="True"/>
</StackPanel>
</StackPanel>
</GroupBox>
</StackPanel>
</StackPanel>
<GroupBox x:Name="gBoxExclude" Header="Excluded Path (matching string in distinguishedName):" HorizontalAlignment="Left" Height="75" Margin="2,0,0,0" VerticalAlignment="Top" Width="605">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Vertical">
<TextBox x:Name="txtBoxExcluded" HorizontalAlignment="Left" Height="20" Margin="5,10,0,0" TextWrapping="NoWrap" VerticalAlignment="Top" Width="585" />
<Button x:Name="btnClearExcludedBox" Content="Clear" Height="21" Margin="10,0,0,0" IsEnabled="true" Width="100"/>
</StackPanel>
</StackPanel>
</GroupBox>
</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: Examples: * User|Computer" />
<StackPanel Orientation="Horizontal" Margin="0,0">
<CheckBox x:Name="chkBoxObject" Content="" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" IsEnabled="False"/>
<TextBox x:Name="txtBoxObjectFilter" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" Width="160" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="5,5,0,0" Width="320">
<Label x:Name="lblPermission" Content="Filter by permissions: Examples: GenericAll WriteProperty|ExtendedRight" />
<StackPanel Orientation="Horizontal" Margin="0,0">
<CheckBox x:Name="chkBoxPermission" Content="" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" IsEnabled="False"/>
<TextBox x:Name="txtPermission" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Top" Width="160" IsEnabled="False"/>
</StackPanel>
<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="160" 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="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>
<TabItem x:Name="tabEffectiveR" Header="Effective Rights">
<Grid >