-Added negations to some -GroupScope and -GroupProperty values

This commit is contained in:
HarmJ0y 2017-05-25 01:30:25 -04:00
parent 783bff3cc0
commit d9e9231755
1 changed files with 14 additions and 9 deletions

View File

@ -8751,11 +8751,12 @@ Switch. Return users with '(adminCount=1)' (meaning are/were privileged).
.PARAMETER GroupScope .PARAMETER GroupScope
Specifies the scope (DomainLocal, Global, or Universal) of the group(s) to search for. Specifies the scope (DomainLocal, Global, or Universal) of the group(s) to search for.
Also accepts NotDomainLocal, NotGloba, and NotUniversal as negations.
.PARAMETER GroupProperty .PARAMETER GroupProperty
Specifies a specific property to search for when performing the group search. Specifies a specific property to search for when performing the group search.
Possible values are Security, Distribution, and CreatedBySystem. Possible values are Security, Distribution, CreatedBySystem, and NotCreatedBySystem.
.PARAMETER Domain .PARAMETER Domain
@ -8919,12 +8920,12 @@ Custom PSObject with translated group property fields.
[Switch] [Switch]
$AdminCount, $AdminCount,
[ValidateSet('DomainLocal', 'Global', 'Universal')] [ValidateSet('DomainLocal', 'NotDomainLocal', 'Global', 'NotGlobal', 'Universal', 'NotUniversal')]
[Alias('Scope')] [Alias('Scope')]
[String] [String]
$GroupScope, $GroupScope,
[ValidateSet('Security', 'Distribution', 'CreatedBySystem')] [ValidateSet('Security', 'Distribution', 'CreatedBySystem', 'NotCreatedBySystem')]
[String] [String]
$GroupProperty, $GroupProperty,
@ -9075,18 +9076,22 @@ Custom PSObject with translated group property fields.
if ($PSBoundParameters['GroupScope']) { if ($PSBoundParameters['GroupScope']) {
$GroupScopeValue = $PSBoundParameters['GroupScope'] $GroupScopeValue = $PSBoundParameters['GroupScope']
$Filter = Switch ($GroupScopeValue) { $Filter = Switch ($GroupScopeValue) {
'DomainLocal' { '(groupType:1.2.840.113556.1.4.803:=4)' } 'DomainLocal' { '(groupType:1.2.840.113556.1.4.803:=4)' }
'Global' { '(groupType:1.2.840.113556.1.4.803:=2)' } 'NotDomainLocal' { '(!(groupType:1.2.840.113556.1.4.803:=4))' }
'Universal' { '(groupType:1.2.840.113556.1.4.803:=8)' } 'Global' { '(groupType:1.2.840.113556.1.4.803:=2)' }
'NotGlobal' { '(!(groupType:1.2.840.113556.1.4.803:=2))' }
'Universal' { '(groupType:1.2.840.113556.1.4.803:=8)' }
'NotUniversal' { '(!(groupType:1.2.840.113556.1.4.803:=8))' }
} }
Write-Verbose "[Get-DomainGroup] Searching for group scope '$GroupScopeValue'" Write-Verbose "[Get-DomainGroup] Searching for group scope '$GroupScopeValue'"
} }
if ($PSBoundParameters['GroupProperty']) { if ($PSBoundParameters['GroupProperty']) {
$GroupPropertyValue = $PSBoundParameters['GroupProperty'] $GroupPropertyValue = $PSBoundParameters['GroupProperty']
$Filter = Switch ($GroupPropertyValue) { $Filter = Switch ($GroupPropertyValue) {
'Security' { '(groupType:1.2.840.113556.1.4.803:=2147483648)' } 'Security' { '(groupType:1.2.840.113556.1.4.803:=2147483648)' }
'Distribution' { '(!(groupType:1.2.840.113556.1.4.803:=2147483648))' } 'Distribution' { '(!(groupType:1.2.840.113556.1.4.803:=2147483648))' }
'CreatedBySystem' { '(groupType:1.2.840.113556.1.4.803:=1)' } 'CreatedBySystem' { '(groupType:1.2.840.113556.1.4.803:=1)' }
'NotCreatedBySystem' { '(!(groupType:1.2.840.113556.1.4.803:=1))' }
} }
Write-Verbose "[Get-DomainGroup] Searching for group property '$GroupPropertyValue'" Write-Verbose "[Get-DomainGroup] Searching for group property '$GroupPropertyValue'"
} }