@@ -85,6 +85,7 @@ private async Task<User> ProcessUserObject(ISearchResultEntry entry,
85
85
ret . Properties . Add ( "name" , resolvedSearchResult . DisplayName ) ;
86
86
ret . Properties . Add ( "distinguishedname" , entry . DistinguishedName . ToUpper ( ) ) ;
87
87
ret . Properties . Add ( "domainsid" , resolvedSearchResult . DomainSid ) ;
88
+ ret . Properties . Add ( "highvalue" , false ) ;
88
89
89
90
if ( ( _methods & ResolvedCollectionMethod . ACL ) != 0 )
90
91
{
@@ -136,6 +137,7 @@ private async Task<Computer> ProcessComputerObject(ISearchResultEntry entry,
136
137
ret . Properties . Add ( "name" , resolvedSearchResult . DisplayName ) ;
137
138
ret . Properties . Add ( "distinguishedname" , entry . DistinguishedName . ToUpper ( ) ) ;
138
139
ret . Properties . Add ( "domainsid" , resolvedSearchResult . DomainSid ) ;
140
+ ret . Properties . Add ( "highvalue" , false ) ;
139
141
140
142
var hasLaps = entry . HasLAPS ( ) ;
141
143
ret . Properties . Add ( "haslaps" , hasLaps ) ;
@@ -320,6 +322,7 @@ private Group ProcessGroupObject(ISearchResultEntry entry,
320
322
ret . Properties . Add ( "name" , resolvedSearchResult . DisplayName ) ;
321
323
ret . Properties . Add ( "distinguishedname" , entry . DistinguishedName . ToUpper ( ) ) ;
322
324
ret . Properties . Add ( "domainsid" , resolvedSearchResult . DomainSid ) ;
325
+ ret . Properties . Add ( "highvalue" , IsHighValueGroup ( resolvedSearchResult . ObjectId ) ) ;
323
326
324
327
if ( ( _methods & ResolvedCollectionMethod . ACL ) != 0 )
325
328
{
@@ -341,6 +344,30 @@ private Group ProcessGroupObject(ISearchResultEntry entry,
341
344
return ret ;
342
345
}
343
346
347
+ private bool IsHighValueGroup ( string objectId )
348
+ {
349
+ // TODO: replace w/ a more definitive/centralized list
350
+ var suffixes = new string [ ]
351
+ {
352
+ "-512" ,
353
+ "-516" ,
354
+ "-519" ,
355
+ "S-1-5-32-544" ,
356
+ "S-1-5-32-548" ,
357
+ "S-1-5-32-549" ,
358
+ "S-1-5-32-550" ,
359
+ "S-1-5-32-551" ,
360
+ } ;
361
+ foreach ( var suffix in suffixes )
362
+ {
363
+ if ( objectId . EndsWith ( suffix ) )
364
+ {
365
+ return true ;
366
+ }
367
+ }
368
+ return false ;
369
+ }
370
+
344
371
private async Task < Domain > ProcessDomainObject ( ISearchResultEntry entry ,
345
372
ResolvedSearchResult resolvedSearchResult )
346
373
{
@@ -353,6 +380,7 @@ private async Task<Domain> ProcessDomainObject(ISearchResultEntry entry,
353
380
ret . Properties . Add ( "name" , resolvedSearchResult . DisplayName ) ;
354
381
ret . Properties . Add ( "distinguishedname" , entry . DistinguishedName . ToUpper ( ) ) ;
355
382
ret . Properties . Add ( "domainsid" , resolvedSearchResult . DomainSid ) ;
383
+ ret . Properties . Add ( "highvalue" , true ) ;
356
384
357
385
if ( ( _methods & ResolvedCollectionMethod . ACL ) != 0 )
358
386
{
@@ -393,6 +421,7 @@ private GPO ProcessGPOObject(ISearchResultEntry entry,
393
421
ret . Properties . Add ( "name" , resolvedSearchResult . DisplayName ) ;
394
422
ret . Properties . Add ( "distinguishedname" , entry . DistinguishedName . ToUpper ( ) ) ;
395
423
ret . Properties . Add ( "domainsid" , resolvedSearchResult . DomainSid ) ;
424
+ ret . Properties . Add ( "highvalue" , false ) ;
396
425
397
426
if ( ( _methods & ResolvedCollectionMethod . ACL ) != 0 )
398
427
{
@@ -418,6 +447,7 @@ private async Task<OU> ProcessOUObject(ISearchResultEntry entry,
418
447
ret . Properties . Add ( "name" , resolvedSearchResult . DisplayName ) ;
419
448
ret . Properties . Add ( "distinguishedname" , entry . DistinguishedName . ToUpper ( ) ) ;
420
449
ret . Properties . Add ( "domainsid" , resolvedSearchResult . DomainSid ) ;
450
+ ret . Properties . Add ( "highvalue" , false ) ;
421
451
422
452
if ( ( _methods & ResolvedCollectionMethod . ACL ) != 0 )
423
453
{
@@ -457,6 +487,7 @@ private Container ProcessContainerObject(ISearchResultEntry entry,
457
487
ret . Properties . Add ( "name" , resolvedSearchResult . DisplayName ) ;
458
488
ret . Properties . Add ( "distinguishedname" , entry . DistinguishedName . ToUpper ( ) ) ;
459
489
ret . Properties . Add ( "domainsid" , resolvedSearchResult . DomainSid ) ;
490
+ ret . Properties . Add ( "highvalue" , false ) ;
460
491
461
492
if ( ( _methods & ResolvedCollectionMethod . Container ) != 0 )
462
493
ret . ChildObjects = _containerProcessor . GetContainerChildObjects ( entry . DistinguishedName ) . ToArray ( ) ;
@@ -477,4 +508,4 @@ private Container ProcessContainerObject(ISearchResultEntry entry,
477
508
return ret ;
478
509
}
479
510
}
480
- }
511
+ }
0 commit comments